1 |
commit: 5d061b6cf8a79d5dc2501f4a1d0c61835369a7a4 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 31 11:53:46 2019 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 31 11:54:08 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d061b6c |
7 |
|
8 |
net-print/cups: Security cleanup |
9 |
|
10 |
Bug: https://bugs.gentoo.org/672742 |
11 |
Package-Manager: Portage-2.3.69, Repoman-2.3.16 |
12 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
13 |
|
14 |
net-print/cups/Manifest | 2 - |
15 |
net-print/cups/cups-2.2.10.ebuild | 337 ------------------------------------- |
16 |
net-print/cups/cups-2.2.7.ebuild | 343 -------------------------------------- |
17 |
3 files changed, 682 deletions(-) |
18 |
|
19 |
diff --git a/net-print/cups/Manifest b/net-print/cups/Manifest |
20 |
index 87370e28f33..e62733a63cf 100644 |
21 |
--- a/net-print/cups/Manifest |
22 |
+++ b/net-print/cups/Manifest |
23 |
@@ -1,4 +1,2 @@ |
24 |
-DIST cups-2.2.10-source.tar.gz 10403568 BLAKE2B 42937088758893772545fff7bbfbf4610ae34764b1e962110b7ea88940ddcba92376e55f4665b9815278de566daec07190ad78e5f2b1e37f905447a7fd17bf4e SHA512 1393987a263ebf20089dd3008ae4ed770a27a1f289032604eb9e18f2e863bd0e4215a70118f5a6d3940875625278b6798fbc9070e791ec559179c6cf7dc7b05f |
25 |
DIST cups-2.2.11-source.tar.gz 10405908 BLAKE2B 9b7ee4da9502e42fd1b4a2c57ab709b3127ee8aeb8481a52f37da19fe5578f406260f1551e3fcedcd3a828fbed69267e68fcfd7bfabadf65afce4c3af19b4a1f SHA512 21a6916041b50044d336871f10d1192635458a3d318f19a18ad21d27027dd3839400601019e758424c218225a34aba148ba3a57f0ce3fe14c4df03bd1fde3403 |
26 |
-DIST cups-2.2.7-source.tar.gz 10330296 BLAKE2B 015a64758ee8d2559f4259ff36bf702b93dc695a44e2170d4ecf71b80d5691b4d947decf0a84ff9433b43c6d47dc350a8769d1e230ceda276c13add67e5e8a20 SHA512 780a6a484f38967ff678456ec7b532aa8445a9562663e4e4f6f7a24aac6ec9e8eae36459ee3c025dff053d59ad1d9ecfb823e8a832bae9d384db3d1a10d8860e |
27 |
DIST cups-2.3rc1-source.tar.gz 7926640 BLAKE2B c39bee2c4697eb540cfa02ee2ce0fa8a79d7efd0a7e65db19fada8473997841e5c341c209eba8eb242e57bb21b0dbded1ca340654874b9400318ed2d9332b890 SHA512 d2411c1da576bd7d561c5465fba0824af86d7b52792482d90876847d0869a5a092de12efc761fd403c74be072c6d6eb5bf407525f187051683dba694e5f7febd |
28 |
|
29 |
diff --git a/net-print/cups/cups-2.2.10.ebuild b/net-print/cups/cups-2.2.10.ebuild |
30 |
deleted file mode 100644 |
31 |
index b5fcaa92de9..00000000000 |
32 |
--- a/net-print/cups/cups-2.2.10.ebuild |
33 |
+++ /dev/null |
34 |
@@ -1,337 +0,0 @@ |
35 |
-# Copyright 1999-2018 Gentoo Authors |
36 |
-# Distributed under the terms of the GNU General Public License v2 |
37 |
- |
38 |
-EAPI=6 |
39 |
- |
40 |
-PYTHON_COMPAT=( python2_7 ) |
41 |
- |
42 |
-inherit autotools eapi7-ver gnome2-utils flag-o-matic linux-info xdg-utils multilib multilib-minimal pam python-single-r1 user 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 |
- SRC_URI="https://github.com/apple/cups/releases/download/v${PV}/${P}-source.tar.gz" |
58 |
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint" |
59 |
-fi |
60 |
- |
61 |
-DESCRIPTION="The Common Unix Printing System" |
62 |
-HOMEPAGE="https://www.cups.org/" |
63 |
- |
64 |
-LICENSE="GPL-2" |
65 |
-SLOT="0" |
66 |
-IUSE="acl dbus debug java kerberos lprng-compat pam python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf" |
67 |
- |
68 |
-CDEPEND=" |
69 |
- app-text/libpaper |
70 |
- sys-libs/zlib |
71 |
- acl? ( |
72 |
- kernel_linux? ( |
73 |
- sys-apps/acl |
74 |
- sys-apps/attr |
75 |
- ) |
76 |
- ) |
77 |
- dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] ) |
78 |
- java? ( >=virtual/jre-1.6:* ) |
79 |
- kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] ) |
80 |
- !lprng-compat? ( !net-print/lprng ) |
81 |
- pam? ( virtual/pam ) |
82 |
- python? ( ${PYTHON_DEPS} ) |
83 |
- ssl? ( >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}] ) |
84 |
- systemd? ( sys-apps/systemd ) |
85 |
- usb? ( virtual/libusb:1 ) |
86 |
- X? ( x11-misc/xdg-utils ) |
87 |
- xinetd? ( sys-apps/xinetd ) |
88 |
- zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] ) |
89 |
-" |
90 |
- |
91 |
-DEPEND="${CDEPEND} |
92 |
- >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] |
93 |
-" |
94 |
- |
95 |
-RDEPEND="${CDEPEND} |
96 |
- selinux? ( sec-policy/selinux-cups ) |
97 |
-" |
98 |
- |
99 |
-PDEPEND=">=net-print/cups-filters-1.0.43" |
100 |
- |
101 |
-REQUIRED_USE=" |
102 |
- python? ( ${PYTHON_REQUIRED_USE} ) |
103 |
- usb? ( threads ) |
104 |
-" |
105 |
- |
106 |
-# upstream includes an interactive test which is a nono for gentoo |
107 |
-RESTRICT="test" |
108 |
- |
109 |
-# systemd-socket.patch from Fedora |
110 |
-PATCHES=( |
111 |
- "${FILESDIR}/${PN}-2.2.0-dont-compress-manpages.patch" |
112 |
- "${FILESDIR}/${PN}-2.2.6-fix-install-perms.patch" |
113 |
- "${FILESDIR}/${PN}-1.4.4-nostrip.patch" |
114 |
- "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch" |
115 |
- "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch" |
116 |
-) |
117 |
- |
118 |
-MULTILIB_CHOST_TOOLS=( |
119 |
- /usr/bin/cups-config |
120 |
-) |
121 |
- |
122 |
-pkg_setup() { |
123 |
- enewgroup lp |
124 |
- enewuser lp -1 -1 -1 lp |
125 |
- enewgroup lpadmin 106 |
126 |
- |
127 |
- use python && python-single-r1_pkg_setup |
128 |
- |
129 |
- if use kernel_linux; then |
130 |
- linux-info_pkg_setup |
131 |
- if ! linux_config_exists; then |
132 |
- ewarn "Can't check the linux kernel configuration." |
133 |
- ewarn "You might have some incompatible options enabled." |
134 |
- else |
135 |
- # recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug 501122) |
136 |
- if use usb; then |
137 |
- if linux_chkconfig_present USB_PRINTER; then |
138 |
- elog "Your USB printers will be managed via libusb. In case you run into problems, " |
139 |
- elog "please try disabling USB_PRINTER support in your kernel or blacklisting the" |
140 |
- elog "usblp kernel module." |
141 |
- elog "Alternatively, just disable the usb useflag for cups (your printer will still work)." |
142 |
- fi |
143 |
- else |
144 |
- #here we should warn user that he should enable it so he can print |
145 |
- if ! linux_chkconfig_present USB_PRINTER; then |
146 |
- ewarn "If you plan to use USB printers you should enable the USB_PRINTER" |
147 |
- ewarn "support in your kernel." |
148 |
- ewarn "Please enable it:" |
149 |
- ewarn " CONFIG_USB_PRINTER=y" |
150 |
- ewarn "in /usr/src/linux/.config or" |
151 |
- ewarn " Device Drivers --->" |
152 |
- ewarn " USB support --->" |
153 |
- ewarn " [*] USB Printer support" |
154 |
- ewarn "Alternatively, enable the usb useflag for cups and use the libusb code." |
155 |
- fi |
156 |
- fi |
157 |
- fi |
158 |
- fi |
159 |
-} |
160 |
- |
161 |
-src_prepare() { |
162 |
- default |
163 |
- |
164 |
- # Remove ".SILENT" rule for verbose output (bug 524338). |
165 |
- sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed" |
166 |
- |
167 |
- # Fix install-sh, posix sh does not have 'function'. |
168 |
- sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh" |
169 |
- |
170 |
- AT_M4DIR=config-scripts eaclocal |
171 |
- eautoconf |
172 |
- |
173 |
- # custom Makefiles |
174 |
- multilib_copy_sources |
175 |
-} |
176 |
- |
177 |
-multilib_src_configure() { |
178 |
- export DSOFLAGS="${LDFLAGS}" |
179 |
- |
180 |
- einfo LINGUAS=\"${LINGUAS}\" |
181 |
- |
182 |
- # explicitly specify compiler wrt bug 524340 |
183 |
- # |
184 |
- # need to override KRB5CONFIG for proper flags |
185 |
- # https://github.com/apple/cups/issues/4423 |
186 |
- local myeconfargs=( |
187 |
- CC="$(tc-getCC)" |
188 |
- CXX="$(tc-getCXX)" |
189 |
- KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config |
190 |
- --libdir="${EPREFIX}"/usr/$(get_libdir) |
191 |
- --localstatedir="${EPREFIX}"/var |
192 |
- --with-exe-file-perm=755 |
193 |
- --with-rundir="${EPREFIX}"/run/cups |
194 |
- --with-cups-user=lp |
195 |
- --with-cups-group=lp |
196 |
- --with-docdir="${EPREFIX}"/usr/share/cups/html |
197 |
- --with-languages="${LINGUAS}" |
198 |
- --with-system-groups=lpadmin |
199 |
- --with-xinetd="${EPREFIX}"/etc/xinetd.d |
200 |
- $(multilib_native_use_enable acl) |
201 |
- $(use_enable dbus) |
202 |
- $(use_enable debug) |
203 |
- $(use_enable debug debug-guards) |
204 |
- $(use_enable debug debug-printfs) |
205 |
- $(multilib_native_use_with java) |
206 |
- $(use_enable kerberos gssapi) |
207 |
- $(multilib_native_use_enable pam) |
208 |
- $(multilib_native_use_with python python "${PYTHON}") |
209 |
- $(use_enable static-libs static) |
210 |
- $(use_enable threads) |
211 |
- $(use_enable ssl gnutls) |
212 |
- $(use_enable systemd) |
213 |
- $(multilib_native_use_enable usb libusb) |
214 |
- $(use_enable zeroconf avahi) |
215 |
- --disable-dnssd |
216 |
- --without-perl |
217 |
- --without-php |
218 |
- $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper) |
219 |
- ) |
220 |
- |
221 |
- if tc-is-static-only; then |
222 |
- myeconfargs+=( |
223 |
- --disable-shared |
224 |
- ) |
225 |
- fi |
226 |
- |
227 |
- econf "${myeconfargs[@]}" |
228 |
- |
229 |
- # install in /usr/libexec always, instead of using /usr/lib/cups, as that |
230 |
- # makes more sense when facing multilib support. |
231 |
- sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die |
232 |
- sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die |
233 |
- sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die |
234 |
- |
235 |
- # additional path corrections needed for prefix, see bug 597728 |
236 |
- sed \ |
237 |
- -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" \ |
238 |
- -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" \ |
239 |
- -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" \ |
240 |
- -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" \ |
241 |
- -i Makedefs || die |
242 |
-} |
243 |
- |
244 |
-multilib_src_compile() { |
245 |
- if multilib_is_native_abi; then |
246 |
- default |
247 |
- else |
248 |
- emake libs |
249 |
- fi |
250 |
-} |
251 |
- |
252 |
-multilib_src_test() { |
253 |
- multilib_is_native_abi && default |
254 |
-} |
255 |
- |
256 |
-multilib_src_install() { |
257 |
- if multilib_is_native_abi; then |
258 |
- emake BUILDROOT="${D}" install |
259 |
- else |
260 |
- emake BUILDROOT="${D}" install-libs install-headers |
261 |
- dobin cups-config |
262 |
- fi |
263 |
-} |
264 |
- |
265 |
-multilib_src_install_all() { |
266 |
- dodoc {CHANGES,CREDITS,README}.md |
267 |
- |
268 |
- # move the default config file to docs |
269 |
- dodoc "${ED%/}"/etc/cups/cupsd.conf.default |
270 |
- rm -f "${ED%/}"/etc/cups/cupsd.conf.default |
271 |
- |
272 |
- # clean out cups init scripts |
273 |
- rm -rf "${ED%/}"/etc/{init.d/cups,rc*,pam.d/cups} |
274 |
- |
275 |
- # install our init script |
276 |
- local neededservices |
277 |
- use zeroconf && neededservices+=" avahi-daemon" |
278 |
- use dbus && neededservices+=" dbus" |
279 |
- [[ -n ${neededservices} ]] && neededservices="need${neededservices}" |
280 |
- cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die |
281 |
- sed -i \ |
282 |
- -e "s/@neededservices@/${neededservices}/" \ |
283 |
- "${T}"/cupsd || die |
284 |
- doinitd "${T}"/cupsd |
285 |
- |
286 |
- # install our pam script |
287 |
- pamd_mimic_system cups auth account |
288 |
- |
289 |
- if use xinetd ; then |
290 |
- # correct path |
291 |
- sed -i \ |
292 |
- -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \ |
293 |
- "${ED%/}"/etc/xinetd.d/cups-lpd || die |
294 |
- # it is safer to disable this by default, bug #137130 |
295 |
- grep -w 'disable' "${ED%/}"/etc/xinetd.d/cups-lpd || \ |
296 |
- { sed -i -e "s:}:\tdisable = yes\n}:" "${ED%/}"/etc/xinetd.d/cups-lpd || die ; } |
297 |
- # write permission for file owner (root), bug #296221 |
298 |
- fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed" |
299 |
- else |
300 |
- # always configure with --with-xinetd= and clean up later, |
301 |
- # bug #525604 |
302 |
- rm -rf "${ED%/}"/etc/xinetd.d |
303 |
- fi |
304 |
- |
305 |
- keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \ |
306 |
- /var/log/cups /var/spool/cups/tmp |
307 |
- |
308 |
- keepdir /etc/cups/{interfaces,ppd,ssl} |
309 |
- |
310 |
- if ! use X ; then |
311 |
- rm -r "${ED%/}"/usr/share/applications || die |
312 |
- fi |
313 |
- |
314 |
- # create /etc/cups/client.conf, bug #196967 and #266678 |
315 |
- echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED%/}"/etc/cups/client.conf |
316 |
- |
317 |
- # the following file is now provided by cups-filters: |
318 |
- rm -r "${ED%/}"/usr/share/cups/banners || die |
319 |
- |
320 |
- # the following are created by the init script |
321 |
- rm -r "${ED%/}"/var/cache/cups || die |
322 |
- rm -r "${ED%/}"/run || die |
323 |
- |
324 |
- # for the special case of running lprng and cups together, bug 467226 |
325 |
- if use lprng-compat ; then |
326 |
- rm -fv "${ED%/}"/usr/bin/{lp*,cancel} |
327 |
- rm -fv "${ED%/}"/usr/sbin/lp* |
328 |
- rm -fv "${ED%/}"/usr/share/man/man1/{lp*,cancel*} |
329 |
- rm -fv "${ED%/}"/usr/share/man/man8/lp* |
330 |
- ewarn "Not installing lp... binaries, since the lprng-compat useflag is set." |
331 |
- ewarn "Unless you plan to install an exotic server setup, you most likely" |
332 |
- ewarn "do not want this. Disable the useflag then and all will be fine." |
333 |
- fi |
334 |
-} |
335 |
- |
336 |
-pkg_preinst() { |
337 |
- gnome2_icon_savelist |
338 |
-} |
339 |
- |
340 |
-pkg_postinst() { |
341 |
- # Update desktop file database and gtk icon cache (bug 370059) |
342 |
- gnome2_icon_cache_update |
343 |
- xdg_desktop_database_update |
344 |
- |
345 |
- local v |
346 |
- |
347 |
- for v in ${REPLACING_VERSIONS}; do |
348 |
- if ! ver_test ${v} -ge 2.2.2-r2 ; then |
349 |
- echo |
350 |
- ewarn "The cupsd init script switched to using pidfiles. Shutting down" |
351 |
- ewarn "cupsd will fail the next time. To fix this, please run once as root" |
352 |
- ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start" |
353 |
- echo |
354 |
- break |
355 |
- fi |
356 |
- done |
357 |
- |
358 |
- for v in ${REPLACING_VERSIONS}; do |
359 |
- echo |
360 |
- elog "For information about installing a printer and general cups setup" |
361 |
- elog "take a look at: https://wiki.gentoo.org/wiki/Printing" |
362 |
- echo |
363 |
- break |
364 |
- done |
365 |
-} |
366 |
- |
367 |
-pkg_postrm() { |
368 |
- # Update desktop file database and gtk icon cache (bug 370059) |
369 |
- gnome2_icon_cache_update |
370 |
- xdg_desktop_database_update |
371 |
-} |
372 |
|
373 |
diff --git a/net-print/cups/cups-2.2.7.ebuild b/net-print/cups/cups-2.2.7.ebuild |
374 |
deleted file mode 100644 |
375 |
index f7636e768b3..00000000000 |
376 |
--- a/net-print/cups/cups-2.2.7.ebuild |
377 |
+++ /dev/null |
378 |
@@ -1,343 +0,0 @@ |
379 |
-# Copyright 1999-2019 Gentoo Authors |
380 |
-# Distributed under the terms of the GNU General Public License v2 |
381 |
- |
382 |
-EAPI=6 |
383 |
- |
384 |
-PYTHON_COMPAT=( python2_7 ) |
385 |
- |
386 |
-inherit autotools gnome2-utils flag-o-matic linux-info xdg-utils \ |
387 |
- multilib multilib-minimal pam python-single-r1 user versionator \ |
388 |
- java-pkg-opt-2 systemd toolchain-funcs |
389 |
- |
390 |
-MY_P=${P/_rc/rc} |
391 |
-MY_P=${MY_P/_beta/b} |
392 |
-MY_PV=${PV/_rc/rc} |
393 |
-MY_PV=${MY_PV/_beta/b} |
394 |
- |
395 |
-if [[ ${PV} == *9999 ]]; then |
396 |
- inherit git-r3 |
397 |
- EGIT_REPO_URI="https://github.com/apple/cups.git" |
398 |
- if [[ ${PV} != 9999 ]]; then |
399 |
- EGIT_BRANCH=branch-${PV/.9999} |
400 |
- fi |
401 |
-else |
402 |
- #SRC_URI="https://github.com/apple/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
403 |
- SRC_URI="https://github.com/apple/cups/releases/download/v${PV}/${P}-source.tar.gz" |
404 |
- KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint" |
405 |
-fi |
406 |
- |
407 |
-DESCRIPTION="The Common Unix Printing System" |
408 |
-HOMEPAGE="https://www.cups.org/" |
409 |
- |
410 |
-LICENSE="GPL-2" |
411 |
-SLOT="0" |
412 |
-IUSE="acl dbus debug java kerberos lprng-compat pam |
413 |
- python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf" |
414 |
- |
415 |
-CDEPEND=" |
416 |
- app-text/libpaper |
417 |
- sys-libs/zlib |
418 |
- acl? ( |
419 |
- kernel_linux? ( |
420 |
- sys-apps/acl |
421 |
- sys-apps/attr |
422 |
- ) |
423 |
- ) |
424 |
- dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] ) |
425 |
- java? ( >=virtual/jre-1.6:* ) |
426 |
- kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] ) |
427 |
- !lprng-compat? ( !net-print/lprng ) |
428 |
- pam? ( virtual/pam ) |
429 |
- python? ( ${PYTHON_DEPS} ) |
430 |
- ssl? ( |
431 |
- >=net-libs/gnutls-2.12.23-r6:0=[${MULTILIB_USEDEP}] |
432 |
- ) |
433 |
- systemd? ( sys-apps/systemd ) |
434 |
- usb? ( virtual/libusb:1 ) |
435 |
- X? ( x11-misc/xdg-utils ) |
436 |
- xinetd? ( sys-apps/xinetd ) |
437 |
- zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] ) |
438 |
-" |
439 |
- |
440 |
-DEPEND="${CDEPEND} |
441 |
- >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] |
442 |
-" |
443 |
- |
444 |
-RDEPEND="${CDEPEND} |
445 |
- selinux? ( sec-policy/selinux-cups ) |
446 |
-" |
447 |
- |
448 |
-PDEPEND=">=net-print/cups-filters-1.0.43" |
449 |
- |
450 |
-REQUIRED_USE=" |
451 |
- python? ( ${PYTHON_REQUIRED_USE} ) |
452 |
- usb? ( threads ) |
453 |
-" |
454 |
- |
455 |
-# upstream includes an interactive test which is a nono for gentoo |
456 |
-RESTRICT="test" |
457 |
- |
458 |
-# systemd-socket.patch from Fedora |
459 |
-PATCHES=( |
460 |
- "${FILESDIR}/${PN}-2.2.0-dont-compress-manpages.patch" |
461 |
- "${FILESDIR}/${PN}-2.2.6-fix-install-perms.patch" |
462 |
- "${FILESDIR}/${PN}-1.4.4-nostrip.patch" |
463 |
- "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch" |
464 |
- "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch" |
465 |
- "${FILESDIR}/${PN}-2.3_rc1-no_pam.patch" #651878 |
466 |
-) |
467 |
- |
468 |
-MULTILIB_CHOST_TOOLS=( |
469 |
- /usr/bin/cups-config |
470 |
-) |
471 |
- |
472 |
-pkg_setup() { |
473 |
- enewgroup lp |
474 |
- enewuser lp -1 -1 -1 lp |
475 |
- enewgroup lpadmin 106 |
476 |
- |
477 |
- use python && python-single-r1_pkg_setup |
478 |
- |
479 |
- if use kernel_linux; then |
480 |
- linux-info_pkg_setup |
481 |
- if ! linux_config_exists; then |
482 |
- ewarn "Can't check the linux kernel configuration." |
483 |
- ewarn "You might have some incompatible options enabled." |
484 |
- else |
485 |
- # recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug 501122) |
486 |
- if use usb; then |
487 |
- if linux_chkconfig_present USB_PRINTER; then |
488 |
- elog "Your USB printers will be managed via libusb. In case you run into problems, " |
489 |
- elog "please try disabling USB_PRINTER support in your kernel or blacklisting the" |
490 |
- elog "usblp kernel module." |
491 |
- elog "Alternatively, just disable the usb useflag for cups (your printer will still work)." |
492 |
- fi |
493 |
- else |
494 |
- #here we should warn user that he should enable it so he can print |
495 |
- if ! linux_chkconfig_present USB_PRINTER; then |
496 |
- ewarn "If you plan to use USB printers you should enable the USB_PRINTER" |
497 |
- ewarn "support in your kernel." |
498 |
- ewarn "Please enable it:" |
499 |
- ewarn " CONFIG_USB_PRINTER=y" |
500 |
- ewarn "in /usr/src/linux/.config or" |
501 |
- ewarn " Device Drivers --->" |
502 |
- ewarn " USB support --->" |
503 |
- ewarn " [*] USB Printer support" |
504 |
- ewarn "Alternatively, enable the usb useflag for cups and use the libusb code." |
505 |
- fi |
506 |
- fi |
507 |
- fi |
508 |
- fi |
509 |
-} |
510 |
- |
511 |
-src_prepare() { |
512 |
- default |
513 |
- |
514 |
- # Remove ".SILENT" rule for verbose output (bug 524338). |
515 |
- sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed" |
516 |
- |
517 |
- # Fix install-sh, posix sh does not have 'function'. |
518 |
- sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh" |
519 |
- |
520 |
- AT_M4DIR=config-scripts eaclocal |
521 |
- eautoconf |
522 |
- |
523 |
- # custom Makefiles |
524 |
- multilib_copy_sources |
525 |
-} |
526 |
- |
527 |
-multilib_src_configure() { |
528 |
- export DSOFLAGS="${LDFLAGS}" |
529 |
- |
530 |
- einfo LINGUAS=\"${LINGUAS}\" |
531 |
- |
532 |
- # explicitly specify compiler wrt bug 524340 |
533 |
- # |
534 |
- # need to override KRB5CONFIG for proper flags |
535 |
- # https://github.com/apple/cups/issues/4423 |
536 |
- local myeconfargs=( |
537 |
- CC="$(tc-getCC)" |
538 |
- CXX="$(tc-getCXX)" |
539 |
- KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config |
540 |
- --libdir="${EPREFIX}"/usr/$(get_libdir) |
541 |
- --localstatedir="${EPREFIX}"/var |
542 |
- --with-exe-file-perm=755 |
543 |
- --with-rundir="${EPREFIX}"/run/cups |
544 |
- --with-cups-user=lp |
545 |
- --with-cups-group=lp |
546 |
- --with-docdir="${EPREFIX}"/usr/share/cups/html |
547 |
- --with-languages="${LINGUAS}" |
548 |
- --with-system-groups=lpadmin |
549 |
- --with-xinetd="${EPREFIX}"/etc/xinetd.d |
550 |
- $(multilib_native_use_enable acl) |
551 |
- $(use_enable dbus) |
552 |
- $(use_enable debug) |
553 |
- $(use_enable debug debug-guards) |
554 |
- $(use_enable debug debug-printfs) |
555 |
- $(multilib_native_use_with java) |
556 |
- $(use_enable kerberos gssapi) |
557 |
- $(multilib_native_use_enable pam) |
558 |
- $(multilib_native_use_with python python "${PYTHON}") |
559 |
- $(use_enable static-libs static) |
560 |
- $(use_enable threads) |
561 |
- $(use_enable ssl gnutls) |
562 |
- $(use_enable systemd) |
563 |
- $(multilib_native_use_enable usb libusb) |
564 |
- $(use_enable zeroconf avahi) |
565 |
- --disable-dnssd |
566 |
- --without-perl |
567 |
- --without-php |
568 |
- $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper) |
569 |
- ) |
570 |
- |
571 |
- if tc-is-static-only; then |
572 |
- myeconfargs+=( |
573 |
- --disable-shared |
574 |
- ) |
575 |
- fi |
576 |
- |
577 |
- econf "${myeconfargs[@]}" |
578 |
- |
579 |
- # install in /usr/libexec always, instead of using /usr/lib/cups, as that |
580 |
- # makes more sense when facing multilib support. |
581 |
- sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die |
582 |
- sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die |
583 |
- sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die |
584 |
- |
585 |
- # additional path corrections needed for prefix, see bug 597728 |
586 |
- sed \ |
587 |
- -e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" \ |
588 |
- -e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" \ |
589 |
- -e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" \ |
590 |
- -e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" \ |
591 |
- -i Makedefs || die |
592 |
-} |
593 |
- |
594 |
-multilib_src_compile() { |
595 |
- if multilib_is_native_abi; then |
596 |
- default |
597 |
- else |
598 |
- emake libs |
599 |
- fi |
600 |
-} |
601 |
- |
602 |
-multilib_src_test() { |
603 |
- multilib_is_native_abi && default |
604 |
-} |
605 |
- |
606 |
-multilib_src_install() { |
607 |
- if multilib_is_native_abi; then |
608 |
- emake BUILDROOT="${D}" install |
609 |
- else |
610 |
- emake BUILDROOT="${D}" install-libs install-headers |
611 |
- dobin cups-config |
612 |
- fi |
613 |
-} |
614 |
- |
615 |
-multilib_src_install_all() { |
616 |
- dodoc {CHANGES,CREDITS,README}.md |
617 |
- |
618 |
- # move the default config file to docs |
619 |
- dodoc "${ED%/}"/etc/cups/cupsd.conf.default |
620 |
- rm -f "${ED%/}"/etc/cups/cupsd.conf.default |
621 |
- |
622 |
- # clean out cups init scripts |
623 |
- rm -rf "${ED%/}"/etc/{init.d/cups,rc*,pam.d/cups} |
624 |
- |
625 |
- # install our init script |
626 |
- local neededservices |
627 |
- use zeroconf && neededservices+=" avahi-daemon" |
628 |
- use dbus && neededservices+=" dbus" |
629 |
- [[ -n ${neededservices} ]] && neededservices="need${neededservices}" |
630 |
- cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die |
631 |
- sed -i \ |
632 |
- -e "s/@neededservices@/${neededservices}/" \ |
633 |
- "${T}"/cupsd || die |
634 |
- doinitd "${T}"/cupsd |
635 |
- |
636 |
- # install our pam script |
637 |
- pamd_mimic_system cups auth account |
638 |
- |
639 |
- if use xinetd ; then |
640 |
- # correct path |
641 |
- sed -i \ |
642 |
- -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \ |
643 |
- "${ED%/}"/etc/xinetd.d/cups-lpd || die |
644 |
- # it is safer to disable this by default, bug #137130 |
645 |
- grep -w 'disable' "${ED%/}"/etc/xinetd.d/cups-lpd || \ |
646 |
- { sed -i -e "s:}:\tdisable = yes\n}:" "${ED%/}"/etc/xinetd.d/cups-lpd || die ; } |
647 |
- # write permission for file owner (root), bug #296221 |
648 |
- fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed" |
649 |
- else |
650 |
- # always configure with --with-xinetd= and clean up later, |
651 |
- # bug #525604 |
652 |
- rm -rf "${ED%/}"/etc/xinetd.d |
653 |
- fi |
654 |
- |
655 |
- keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \ |
656 |
- /var/log/cups /var/spool/cups/tmp |
657 |
- |
658 |
- keepdir /etc/cups/{interfaces,ppd,ssl} |
659 |
- |
660 |
- if ! use X ; then |
661 |
- rm -r "${ED%/}"/usr/share/applications || die |
662 |
- fi |
663 |
- |
664 |
- # create /etc/cups/client.conf, bug #196967 and #266678 |
665 |
- echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED%/}"/etc/cups/client.conf |
666 |
- |
667 |
- # the following file is now provided by cups-filters: |
668 |
- rm -r "${ED%/}"/usr/share/cups/banners || die |
669 |
- |
670 |
- # the following are created by the init script |
671 |
- rm -r "${ED%/}"/var/cache/cups || die |
672 |
- rm -r "${ED%/}"/run || die |
673 |
- |
674 |
- # for the special case of running lprng and cups together, bug 467226 |
675 |
- if use lprng-compat ; then |
676 |
- rm -fv "${ED%/}"/usr/bin/{lp*,cancel} |
677 |
- rm -fv "${ED%/}"/usr/sbin/lp* |
678 |
- rm -fv "${ED%/}"/usr/share/man/man1/{lp*,cancel*} |
679 |
- rm -fv "${ED%/}"/usr/share/man/man8/lp* |
680 |
- ewarn "Not installing lp... binaries, since the lprng-compat useflag is set." |
681 |
- ewarn "Unless you plan to install an exotic server setup, you most likely" |
682 |
- ewarn "do not want this. Disable the useflag then and all will be fine." |
683 |
- fi |
684 |
-} |
685 |
- |
686 |
-pkg_preinst() { |
687 |
- gnome2_icon_savelist |
688 |
-} |
689 |
- |
690 |
-pkg_postinst() { |
691 |
- # Update desktop file database and gtk icon cache (bug 370059) |
692 |
- gnome2_icon_cache_update |
693 |
- xdg_desktop_database_update |
694 |
- |
695 |
- local v |
696 |
- |
697 |
- for v in ${REPLACING_VERSIONS}; do |
698 |
- if ! version_is_at_least 2.2.2-r2 ${v}; then |
699 |
- echo |
700 |
- ewarn "The cupsd init script switched to using pidfiles. Shutting down" |
701 |
- ewarn "cupsd will fail the next time. To fix this, please run once as root" |
702 |
- ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start" |
703 |
- echo |
704 |
- break |
705 |
- fi |
706 |
- done |
707 |
- |
708 |
- for v in ${REPLACING_VERSIONS}; do |
709 |
- echo |
710 |
- elog "For information about installing a printer and general cups setup" |
711 |
- elog "take a look at: https://wiki.gentoo.org/wiki/Printing" |
712 |
- echo |
713 |
- break |
714 |
- done |
715 |
-} |
716 |
- |
717 |
-pkg_postrm() { |
718 |
- # Update desktop file database and gtk icon cache (bug 370059) |
719 |
- gnome2_icon_cache_update |
720 |
- xdg_desktop_database_update |
721 |
-} |