Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-print/cups/files/, net-print/cups/
Date: Fri, 30 Jun 2017 21:49:37
Message-Id: 1498859364.124b7ed7b9e73215f832640b729f090fd39c7015.polynomial-c@gentoo
1 commit: 124b7ed7b9e73215f832640b729f090fd39c7015
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 30 21:45:04 2017 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 30 21:49:24 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=124b7ed7
7
8 net-print/cups: Bump to version 2.2.4
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 net-print/cups/Manifest | 1 +
13 net-print/cups/cups-2.2.4.ebuild | 349 +++++++++++++++++++++
14 .../cups/files/cups-2.2.4-fix-install-perms.patch | 18 ++
15 3 files changed, 368 insertions(+)
16
17 diff --git a/net-print/cups/Manifest b/net-print/cups/Manifest
18 index 001caaa444e..ecf1c7b02ab 100644
19 --- a/net-print/cups/Manifest
20 +++ b/net-print/cups/Manifest
21 @@ -1,3 +1,4 @@
22 DIST cups-2.1.4.tar.gz 9572653 SHA256 1f182f145489e2454969b221056b6b9bac2beb4e38cd75fa12a9ec15d24d5301 SHA512 5f36d21e1e094323f1811229b452f096f3f0b264757b3c3b1742bbd7ea0059e34d3cd2fbf3b6856d25a04ae1779babafa6d598a8ba249448fce3bf7cafa59aae WHIRLPOOL 217b9024c34369c8839b0a1b2b3924eb00e9b8d87cfd8d50a59ad0c33c1044f53d479246d67dff4598049efd15259def90e4bcddc6c3c20dff38811e159d2c4b
23 DIST cups-2.2.2.tar.gz 9489493 SHA256 5e7b396b41f55231dde8dd0465cdd81583cd47ecffe4960c777162fbe3cce03c SHA512 98640b62f706609bbe703318999efb8f78c747e751aafaa1a6f38f4f0dca6fad84ec7e1dfbe9ce17b02ba2ac3fd6e8e480582be5c2cee8eaa707c0ca7eb1978f WHIRLPOOL 745c80114dcac1ed61eec8a8d903ced0d005ec0ad2c05883dcb0aaf9afaf1c410801245ef6bdcb5b77f09a9d96f90e2f94d553b4a19d9425d4005738c8508feb
24 DIST cups-2.2.3.tar.gz 9496214 SHA256 7aa7e8d581f0eb204f75203082403bfa931f8c058bffae71b210800102e5feb5 SHA512 95d8f18fad5b3fd25fe88cc29d159723dcfa735248503d0285949fcd7451f0ccac286719077d0f8a8eda7ee9a053a3d30fa3fd28cb74b59336b6718552d9d2e8 WHIRLPOOL 3aa43f1b83ee62939939bd148c2ab13985143746f7acc3d9c82283e1b096524c7738ae5e1670e717c9329f8d3e917cfcc1c8a7e33af93baa74ea83837d92b5f9
25 +DIST cups-2.2.4.tar.gz 9984903 SHA256 339fb0c0a70a1edf1ef169f2afb21bab92cdd3074adf630352c427b795f20fa7 SHA512 765fe49d1a7a491d7d5db051f73d039d183d0f7a560e9fd89f6732b8a699d3246080e1aaed4ddfed3a9fbdb876b09aa22939d6ee5da2280b1246e4ba933c55f0 WHIRLPOOL 86557f6244b7aa7b19cc67caff7c845291d09699353bd337090111f92b6afb6b9e175ca68df8a15d8915a5a15fd72348805e4ecb7da532a994f46b2c2d4cdada
26
27 diff --git a/net-print/cups/cups-2.2.4.ebuild b/net-print/cups/cups-2.2.4.ebuild
28 new file mode 100644
29 index 00000000000..42bac42a67b
30 --- /dev/null
31 +++ b/net-print/cups/cups-2.2.4.ebuild
32 @@ -0,0 +1,349 @@
33 +# Copyright 1999-2017 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +inherit autotools fdo-mime gnome2-utils flag-o-matic linux-info \
41 + multilib multilib-minimal pam python-single-r1 user versionator \
42 + java-pkg-opt-2 systemd toolchain-funcs
43 +
44 +MY_P=${P/_rc/rc}
45 +MY_P=${MY_P/_beta/b}
46 +MY_PV=${PV/_rc/rc}
47 +MY_PV=${MY_PV/_beta/b}
48 +
49 +if [[ ${PV} == *9999 ]]; then
50 + inherit git-r3
51 + EGIT_REPO_URI="https://github.com/apple/cups.git"
52 + if [[ ${PV} != 9999 ]]; then
53 + EGIT_BRANCH=branch-${PV/.9999}
54 + fi
55 +else
56 + SRC_URI="https://github.com/apple/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
57 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint"
58 +fi
59 +
60 +DESCRIPTION="The Common Unix Printing System"
61 +HOMEPAGE="http://www.cups.org/"
62 +
63 +LICENSE="GPL-2"
64 +SLOT="0"
65 +IUSE="acl dbus debug java kerberos lprng-compat pam
66 + python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf"
67 +
68 +LANGS="ca cs de es fr it ja ru"
69 +for X in ${LANGS} ; do
70 + IUSE="${IUSE} +linguas_${X}"
71 +done
72 +
73 +CDEPEND="
74 + app-text/libpaper
75 + sys-libs/zlib
76 + acl? (
77 + kernel_linux? (
78 + sys-apps/acl
79 + sys-apps/attr
80 + )
81 + )
82 + dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
83 + java? ( >=virtual/jre-1.6:* )
84 + kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
85 + !lprng-compat? ( !net-print/lprng )
86 + pam? ( virtual/pam )
87 + python? ( ${PYTHON_DEPS} )
88 + ssl? (
89 + >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}]
90 + )
91 + systemd? ( sys-apps/systemd )
92 + usb? ( virtual/libusb:1 )
93 + X? ( x11-misc/xdg-utils )
94 + xinetd? ( sys-apps/xinetd )
95 + zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
96 + abi_x86_32? (
97 + !<=app-emulation/emul-linux-x86-baselibs-20140508
98 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
99 + )
100 +"
101 +
102 +DEPEND="${CDEPEND}
103 + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
104 +"
105 +
106 +RDEPEND="${CDEPEND}
107 + selinux? ( sec-policy/selinux-cups )
108 +"
109 +
110 +PDEPEND=">=net-print/cups-filters-1.0.43"
111 +
112 +REQUIRED_USE="
113 + python? ( ${PYTHON_REQUIRED_USE} )
114 + usb? ( threads )
115 +"
116 +
117 +# upstream includes an interactive test which is a nono for gentoo
118 +RESTRICT="test"
119 +
120 +# systemd-socket.patch from Fedora
121 +PATCHES=(
122 + "${FILESDIR}/${PN}-2.2.0-dont-compress-manpages.patch"
123 + "${FILESDIR}/${PN}-2.2.4-fix-install-perms.patch"
124 + "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
125 + "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
126 + "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
127 +)
128 +
129 +MULTILIB_CHOST_TOOLS=(
130 + /usr/bin/cups-config
131 +)
132 +
133 +pkg_setup() {
134 + enewgroup lp
135 + enewuser lp -1 -1 -1 lp
136 + enewgroup lpadmin 106
137 +
138 + use python && python-single-r1_pkg_setup
139 +
140 + if use kernel_linux; then
141 + linux-info_pkg_setup
142 + if ! linux_config_exists; then
143 + ewarn "Can't check the linux kernel configuration."
144 + ewarn "You might have some incompatible options enabled."
145 + else
146 + # recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug 501122)
147 + if use usb; then
148 + if linux_chkconfig_present USB_PRINTER; then
149 + elog "Your USB printers will be managed via libusb. In case you run into problems, "
150 + elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
151 + elog "usblp kernel module."
152 + elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
153 + fi
154 + else
155 + #here we should warn user that he should enable it so he can print
156 + if ! linux_chkconfig_present USB_PRINTER; then
157 + ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
158 + ewarn "support in your kernel."
159 + ewarn "Please enable it:"
160 + ewarn " CONFIG_USB_PRINTER=y"
161 + ewarn "in /usr/src/linux/.config or"
162 + ewarn " Device Drivers --->"
163 + ewarn " USB support --->"
164 + ewarn " [*] USB Printer support"
165 + ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
166 + fi
167 + fi
168 + fi
169 + fi
170 +}
171 +
172 +src_prepare() {
173 + default
174 +
175 + # Remove ".SILENT" rule for verbose output (bug 524338).
176 + sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed"
177 +
178 + # Fix install-sh, posix sh does not have 'function'.
179 + sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh"
180 +
181 + AT_M4DIR=config-scripts eaclocal
182 + eautoconf
183 +
184 + # custom Makefiles
185 + multilib_copy_sources
186 +}
187 +
188 +multilib_src_configure() {
189 + export DSOFLAGS="${LDFLAGS}"
190 +
191 + einfo LANGS=\"${LANGS}\"
192 + einfo LINGUAS=\"${LINGUAS}\"
193 +
194 + local myeconfargs=()
195 +
196 + # explicitly specify compiler wrt bug 524340
197 + #
198 + # need to override KRB5CONFIG for proper flags
199 + # https://www.cups.org/str.php?L4423
200 + myeconfargs+=(
201 + CC="$(tc-getCC)"
202 + CXX="$(tc-getCXX)"
203 + KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config
204 + --libdir="${EPREFIX}"/usr/$(get_libdir)
205 + --localstatedir="${EPREFIX}"/var
206 + --with-exe-file-perm=755
207 + --with-rundir="${EPREFIX}"/run/cups
208 + --with-cups-user=lp
209 + --with-cups-group=lp
210 + --with-docdir="${EPREFIX}"/usr/share/cups/html
211 + --with-languages="${LINGUAS}"
212 + --with-system-groups=lpadmin
213 + --with-xinetd="${EPREFIX}"/etc/xinetd.d
214 + $(multilib_native_use_enable acl)
215 + $(use_enable dbus)
216 + $(use_enable debug)
217 + $(use_enable debug debug-guards)
218 + $(use_enable debug debug-printfs)
219 + $(multilib_native_use_with java)
220 + $(use_enable kerberos gssapi)
221 + $(multilib_native_use_enable pam)
222 + $(multilib_native_use_with python python "${PYTHON}")
223 + $(use_enable static-libs static)
224 + $(use_enable threads)
225 + $(use_enable ssl gnutls)
226 + $(use_enable systemd)
227 + $(multilib_native_use_enable usb libusb)
228 + $(use_enable zeroconf avahi)
229 + --disable-dnssd
230 + --without-perl
231 + --without-php
232 + $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper)
233 + )
234 +
235 + if tc-is-static-only; then
236 + myeconfargs+=(
237 + --disable-shared
238 + )
239 + fi
240 +
241 + econf "${myeconfargs[@]}"
242 +
243 + # install in /usr/libexec always, instead of using /usr/lib/cups, as that
244 + # makes more sense when facing multilib support.
245 + sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
246 + sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
247 + sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
248 +
249 + # additional path corrections needed for prefix, see bug 597728
250 + sed -i -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" Makedefs || die
251 + sed -i -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" Makedefs || die
252 + sed -i -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" Makedefs || die
253 + sed -i -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" Makedefs || die
254 +}
255 +
256 +multilib_src_compile() {
257 + if multilib_is_native_abi; then
258 + default
259 + else
260 + emake libs
261 + fi
262 +}
263 +
264 +multilib_src_test() {
265 + multilib_is_native_abi && default
266 +}
267 +
268 +multilib_src_install() {
269 + if multilib_is_native_abi; then
270 + emake BUILDROOT="${D}" install
271 + else
272 + emake BUILDROOT="${D}" install-libs install-headers
273 + dobin cups-config
274 + fi
275 +}
276 +
277 +multilib_src_install_all() {
278 + dodoc {CHANGES,CREDITS,README}.md
279 +
280 + # move the default config file to docs
281 + dodoc "${ED}"/etc/cups/cupsd.conf.default
282 + rm -f "${ED}"/etc/cups/cupsd.conf.default
283 +
284 + # clean out cups init scripts
285 + rm -rf "${ED}"/etc/{init.d/cups,rc*,pam.d/cups}
286 +
287 + # install our init script
288 + local neededservices
289 + use zeroconf && neededservices+=" avahi-daemon"
290 + use dbus && neededservices+=" dbus"
291 + [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
292 + cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
293 + sed -i \
294 + -e "s/@neededservices@/$neededservices/" \
295 + "${T}"/cupsd || die
296 + doinitd "${T}"/cupsd
297 +
298 + # install our pam script
299 + pamd_mimic_system cups auth account
300 +
301 + if use xinetd ; then
302 + # correct path
303 + sed -i \
304 + -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
305 + "${ED}"/etc/xinetd.d/cups-lpd || die
306 + # it is safer to disable this by default, bug #137130
307 + grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
308 + { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
309 + # write permission for file owner (root), bug #296221
310 + fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed"
311 + else
312 + # always configure with --with-xinetd= and clean up later,
313 + # bug #525604
314 + rm -rf "${ED}"/etc/xinetd.d
315 + fi
316 +
317 + keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \
318 + /var/log/cups /var/spool/cups/tmp
319 +
320 + keepdir /etc/cups/{interfaces,ppd,ssl}
321 +
322 + use X || rm -r "${ED}"/usr/share/applications
323 +
324 + # create /etc/cups/client.conf, bug #196967 and #266678
325 + echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
326 +
327 + # the following file is now provided by cups-filters:
328 + rm -r "${ED}"/usr/share/cups/banners || die
329 +
330 + # the following are created by the init script
331 + rm -r "${ED}"/var/cache/cups || die
332 + rm -r "${ED}"/run || die
333 +
334 + # for the special case of running lprng and cups together, bug 467226
335 + if use lprng-compat ; then
336 + rm -fv "${ED}"/usr/bin/{lp*,cancel}
337 + rm -fv "${ED}"/usr/sbin/lp*
338 + rm -fv "${ED}"/usr/share/man/man1/{lp*,cancel*}
339 + rm -fv "${ED}"/usr/share/man/man8/lp*
340 + ewarn "Not installing lp... binaries, since the lprng-compat useflag is set."
341 + ewarn "Unless you plan to install an exotic server setup, you most likely"
342 + ewarn "do not want this. Disable the useflag then and all will be fine."
343 + fi
344 +}
345 +
346 +pkg_preinst() {
347 + gnome2_icon_savelist
348 +}
349 +
350 +pkg_postinst() {
351 + # Update desktop file database and gtk icon cache (bug 370059)
352 + gnome2_icon_cache_update
353 + fdo-mime_desktop_database_update
354 +
355 + local v
356 +
357 + for v in ${REPLACING_VERSIONS}; do
358 + if ! version_is_at_least 2.2.2-r2 ${v}; then
359 + echo
360 + ewarn "The cupsd init script switched to using pidfiles. Shutting down"
361 + ewarn "cupsd will fail the next time. To fix this, please run once as root"
362 + ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
363 + echo
364 + break
365 + fi
366 + done
367 +
368 + for v in ${REPLACING_VERSIONS}; do
369 + echo
370 + elog "For information about installing a printer and general cups setup"
371 + elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
372 + echo
373 + break
374 + done
375 +}
376 +
377 +pkg_postrm() {
378 + # Update desktop file database and gtk icon cache (bug 370059)
379 + gnome2_icon_cache_update
380 + fdo-mime_desktop_database_update
381 +}
382
383 diff --git a/net-print/cups/files/cups-2.2.4-fix-install-perms.patch b/net-print/cups/files/cups-2.2.4-fix-install-perms.patch
384 new file mode 100644
385 index 00000000000..b9fda922d2c
386 --- /dev/null
387 +++ b/net-print/cups/files/cups-2.2.4-fix-install-perms.patch
388 @@ -0,0 +1,18 @@
389 +--- cups-2.2.4/Makedefs.in
390 ++++ cups-2.2.4/Makedefs.in
391 +@@ -39,12 +39,12 @@
392 + #
393 +
394 + INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
395 +-INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
396 ++INSTALL_COMPDATA = $(INSTALL) -c -m 644 @INSTALL_GZIP@
397 + INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
398 +-INSTALL_DATA = $(INSTALL) -c -m 444
399 ++INSTALL_DATA = $(INSTALL) -c -m 644
400 + INSTALL_DIR = $(INSTALL) -d
401 + INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
402 +-INSTALL_MAN = $(INSTALL) -c -m 444
403 ++INSTALL_MAN = $(INSTALL) -c -m 644
404 + INSTALL_SCRIPT = $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
405 +
406 + #