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