Gentoo Archives: gentoo-commits

From: "Timo Gurr (tgurr)" <tgurr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-print/cups: cups-1.2.12-r4.ebuild ChangeLog cups-1.2.12-r8.ebuild cups-1.3.8-r2.ebuild cups-1.3.9.ebuild cups-1.3.7-r1.ebuild cups-1.3.8.ebuild cups-1.2.12-r7.ebuild
Date: Fri, 10 Oct 2008 19:38:53
Message-Id: E1KoNp4-0008Ch-HH@stork.gentoo.org
1 tgurr 08/10/10 19:38:50
2
3 Modified: cups-1.2.12-r4.ebuild ChangeLog
4 cups-1.2.12-r8.ebuild
5 Added: cups-1.3.8-r2.ebuild cups-1.3.9.ebuild
6 Removed: cups-1.3.7-r1.ebuild cups-1.3.8.ebuild
7 cups-1.2.12-r7.ebuild
8 Log:
9 Bump CUPS to new version 1.3.9 and revision 1.3.8-r2 to address some security issues, bug #238976 and fix the broken desktop file, bug #236706 (Thanks to Pacho Ramos). Remove keywords on 1.2.12 to prevent users from installing a unsecure CUPS version.
10 (Portage version: 2.2_rc12/cvs/Linux 2.6.26-gentoo-r1 x86_64, RepoMan options: --force)
11
12 Revision Changes Path
13 1.8 net-print/cups/cups-1.2.12-r4.ebuild
14
15 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.2.12-r4.ebuild?rev=1.8&view=markup
16 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.2.12-r4.ebuild?rev=1.8&content-type=text/plain
17 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.2.12-r4.ebuild?r1=1.7&r2=1.8
18
19 Index: cups-1.2.12-r4.ebuild
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.2.12-r4.ebuild,v
22 retrieving revision 1.7
23 retrieving revision 1.8
24 diff -u -r1.7 -r1.8
25 --- cups-1.2.12-r4.ebuild 16 Jul 2008 22:47:37 -0000 1.7
26 +++ cups-1.2.12-r4.ebuild 10 Oct 2008 19:38:50 -0000 1.8
27 @@ -1,6 +1,6 @@
28 # Copyright 1999-2008 Gentoo Foundation
29 # Distributed under the terms of the GNU General Public License v2
30 -# $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.2.12-r4.ebuild,v 1.7 2008/07/16 22:47:37 tgurr Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.2.12-r4.ebuild,v 1.8 2008/10/10 19:38:50 tgurr Exp $
32
33 WANT_AUTOMAKE=latest
34
35 @@ -14,7 +14,7 @@
36
37 LICENSE="GPL-2"
38 SLOT="0"
39 -KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
40 +KEYWORDS="arm m68k s390 sh"
41 IUSE="ldap ssl slp pam php samba nls dbus tiff png ppds jpeg X"
42
43 DEP="pam? ( virtual/pam )
44
45
46
47 1.328 net-print/cups/ChangeLog
48
49 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/ChangeLog?rev=1.328&view=markup
50 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/ChangeLog?rev=1.328&content-type=text/plain
51 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/ChangeLog?r1=1.327&r2=1.328
52
53 Index: ChangeLog
54 ===================================================================
55 RCS file: /var/cvsroot/gentoo-x86/net-print/cups/ChangeLog,v
56 retrieving revision 1.327
57 retrieving revision 1.328
58 diff -u -r1.327 -r1.328
59 --- ChangeLog 24 Sep 2008 05:49:03 -0000 1.327
60 +++ ChangeLog 10 Oct 2008 19:38:50 -0000 1.328
61 @@ -1,6 +1,21 @@
62 # ChangeLog for net-print/cups
63 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
64 -# $Header: /var/cvsroot/gentoo-x86/net-print/cups/ChangeLog,v 1.327 2008/09/24 05:49:03 jer Exp $
65 +# $Header: /var/cvsroot/gentoo-x86/net-print/cups/ChangeLog,v 1.328 2008/10/10 19:38:50 tgurr Exp $
66 +
67 +*cups-1.3.9 (10 Oct 2008)
68 +*cups-1.3.8-r2 (10 Oct 2008)
69 +
70 + 10 Oct 2008; Timo Gurr <tgurr@g.o>
71 + +files/cups-1.3.8-CVE-2008-3639.patch,
72 + +files/cups-1.3.8-CVE-2008-3640.patch,
73 + +files/cups-1.3.8-CVE-2008-3641.patch, +files/cups-1.3.8-str2924.patch,
74 + cups-1.2.12-r4.ebuild, -cups-1.2.12-r7.ebuild, cups-1.2.12-r8.ebuild,
75 + -cups-1.3.7-r1.ebuild, -cups-1.3.8.ebuild, +cups-1.3.8-r2.ebuild,
76 + +cups-1.3.9.ebuild:
77 + Bump CUPS to new version 1.3.9 and revision 1.3.8-r2 to address some
78 + security issues, bug #238976 and fix the broken desktop file, bug #236706
79 + (Thanks to Pacho Ramos). Remove keywords on 1.2.12 to prevent users from
80 + installing a unsecure CUPS version.
81
82 24 Sep 2008; Jeroen Roovers <jer@g.o> cups-1.3.8-r1.ebuild:
83 Stable for HPPA (bug #235907).
84
85
86
87 1.10 net-print/cups/cups-1.2.12-r8.ebuild
88
89 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.2.12-r8.ebuild?rev=1.10&view=markup
90 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.2.12-r8.ebuild?rev=1.10&content-type=text/plain
91 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.2.12-r8.ebuild?r1=1.9&r2=1.10
92
93 Index: cups-1.2.12-r8.ebuild
94 ===================================================================
95 RCS file: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.2.12-r8.ebuild,v
96 retrieving revision 1.9
97 retrieving revision 1.10
98 diff -u -r1.9 -r1.10
99 --- cups-1.2.12-r8.ebuild 15 Jun 2008 01:14:09 -0000 1.9
100 +++ cups-1.2.12-r8.ebuild 10 Oct 2008 19:38:50 -0000 1.10
101 @@ -1,6 +1,6 @@
102 # Copyright 1999-2008 Gentoo Foundation
103 # Distributed under the terms of the GNU General Public License v2
104 -# $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.2.12-r8.ebuild,v 1.9 2008/06/15 01:14:09 zmedico Exp $
105 +# $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.2.12-r8.ebuild,v 1.10 2008/10/10 19:38:50 tgurr Exp $
106
107 inherit autotools eutils flag-o-matic multilib pam
108
109 @@ -12,7 +12,7 @@
110
111 LICENSE="GPL-2"
112 SLOT="0"
113 -KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc ~sparc-fbsd x86 ~x86-fbsd"
114 +KEYWORDS="arm m68k s390 sh"
115 IUSE="ldap ssl slp pam php samba nls dbus tiff png ppds jpeg X"
116
117 DEP="pam? ( virtual/pam )
118
119
120
121 1.1 net-print/cups/cups-1.3.8-r2.ebuild
122
123 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.3.8-r2.ebuild?rev=1.1&view=markup
124 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.3.8-r2.ebuild?rev=1.1&content-type=text/plain
125
126 Index: cups-1.3.8-r2.ebuild
127 ===================================================================
128 # Copyright 1999-2008 Gentoo Foundation
129 # Distributed under the terms of the GNU General Public License v2
130 # $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.3.8-r2.ebuild,v 1.1 2008/10/10 19:38:50 tgurr Exp $
131
132 inherit autotools eutils flag-o-matic multilib pam
133
134 MY_P=${P/_}
135
136 DESCRIPTION="The Common Unix Printing System"
137 HOMEPAGE="http://www.cups.org/"
138 SRC_URI="http://ftp.easysw.com/pub/cups/${PV}/${MY_P}-source.tar.bz2"
139
140 LICENSE="GPL-2"
141 SLOT="0"
142 KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc ~sparc-fbsd x86 ~x86-fbsd"
143 IUSE="acl avahi dbus gnutls java jpeg kerberos ldap pam perl php png ppds python samba slp ssl static tiff X xinetd zeroconf"
144
145 COMMON_DEPEND="acl? ( kernel_linux? ( sys-apps/acl sys-apps/attr ) )
146 avahi? ( net-dns/avahi )
147 dbus? ( sys-apps/dbus )
148 gnutls? ( net-libs/gnutls )
149 java? ( >=virtual/jre-1.4 )
150 jpeg? ( >=media-libs/jpeg-6b )
151 kerberos? ( virtual/krb5 )
152 ldap? ( net-nds/openldap )
153 pam? ( virtual/pam )
154 perl? ( dev-lang/perl )
155 php? ( dev-lang/php )
156 png? ( >=media-libs/libpng-1.2.1 )
157 python? ( dev-lang/python )
158 slp? ( >=net-libs/openslp-1.0.4 )
159 ssl? ( !gnutls? ( >=dev-libs/openssl-0.9.8g ) )
160 tiff? ( >=media-libs/tiff-3.5.5 )
161 xinetd? ( sys-apps/xinetd )
162 zeroconf? ( !avahi? ( net-misc/mDNSResponder ) )
163 app-text/libpaper
164 dev-libs/libgcrypt"
165
166 DEPEND="${COMMON_DEPEND}
167 !<net-print/foomatic-filters-ppds-20070501
168 !<net-print/hplip-1.7.4a-r1"
169
170 RDEPEND="${COMMON_DEPEND}
171 !virtual/lpr
172 X? ( x11-misc/xdg-utils )
173 >=app-text/poppler-0.4.3-r1"
174
175 PDEPEND="
176 ppds? ( || (
177 (
178 net-print/foomatic-filters-ppds
179 net-print/foomatic-db-ppds
180 )
181 net-print/foomatic-filters-ppds
182 net-print/foomatic-db-ppds
183 net-print/hplip
184 net-print/gutenprint
185 net-print/foo2zjs
186 net-print/cups-pdf
187 ) )
188 samba? ( >=net-fs/samba-3.0.8 )
189 virtual/ghostscript"
190
191 PROVIDE="virtual/lpr"
192
193 # upstream includes an interactive test which is a nono for gentoo.
194 # therefore, since the printing herd has bigger fish to fry, for now,
195 # we just leave it out, even if FEATURES=test
196 RESTRICT="test"
197
198 S="${WORKDIR}/${MY_P}"
199
200 LANGS="de en es et fr he id it ja pl sv zh_TW"
201 for X in ${LANGS} ; do
202 IUSE="${IUSE} linguas_${X}"
203 done
204
205 pkg_setup() {
206 if use avahi && ! built_with_use net-dns/avahi mdnsresponder-compat ; then
207 echo
208 eerror "In order to have cups working with avahi zeroconf support, you need"
209 eerror "to have net-dns/avahi emerged with \"mdnsresponder-compat\" in your USE"
210 eerror "flag. Please add that flag, re-emerge avahi, and then emerge cups again."
211 die "net-dns/avahi is missing the mdnsresponder-compat feature."
212 fi
213
214 enewgroup lp
215 enewuser lp -1 -1 -1 lp
216
217 enewgroup lpadmin 106
218 }
219
220 src_unpack() {
221 unpack ${A}
222 cd "${S}"
223
224 # disable configure automagic for acl/attr, upstream bug STR #2723
225 epatch "${FILESDIR}/${PN}-1.3.0-configure.patch"
226
227 # create a missing symlink to allow https printing via IPP, bug #217293
228 epatch "${FILESDIR}/${PN}-1.3.7-backend-https.patch"
229
230 # Upstream fix for using the webinterface via SSL with FF3, upstream bug STR #2892
231 epatch "${FILESDIR}/${PN}-1.3.8-str2892-1.3.patch"
232
233 # Upstream fix for broken .desktop file
234 epatch "${FILESDIR}/${PN}-1.3.8-str2924.patch"
235
236 # security bug #238976
237 epatch "${FILESDIR}/${PN}-1.3.8-CVE-2008-3639.patch"
238 epatch "${FILESDIR}/${PN}-1.3.8-CVE-2008-3640.patch"
239 epatch "${FILESDIR}/${PN}-1.3.8-CVE-2008-3641.patch"
240
241 # cups does not use autotools "the usual way" and ship a static config.h.in
242 eaclocal
243 eautoconf
244 }
245
246 src_compile() {
247 # needed to prevent ghostscript compile failures
248 use kerberos && strip-flags
249
250 # locale support
251 strip-linguas ${LANGS}
252
253 if [ -z "${LINGUAS}" ] ; then
254 export LINGUAS=all
255 fi
256
257 export DSOFLAGS="${LDFLAGS}"
258
259 if use ldap ; then
260 append-flags -DLDAP_DEPRECATED
261 fi
262
263 local myconf
264
265 if use avahi || use zeroconf ; then
266 myconf="${myconf} --enable-dnssd"
267 else
268 myconf="${myconf} --disable-dnssd"
269 fi
270
271 if use ssl || use gnutls ; then
272 myconf="${myconf} \
273 $(use_enable gnutls) \
274 $(use_enable !gnutls openssl)"
275 else
276 myconf="${myconf} \
277 --disable-gnutls \
278 --disable-openssl"
279 fi
280
281 econf \
282 --libdir=/usr/$(get_libdir) \
283 --localstatedir=/var \
284 --with-cups-user=lp \
285 --with-cups-group=lp \
286 --with-docdir=/usr/share/cups/html \
287 --with-languages=${LINGUAS} \
288 --with-system-groups=lpadmin \
289 --with-xinetd=/etc/xinetd.d \
290 $(use_enable acl) \
291 $(use_enable dbus) \
292 $(use_enable jpeg) \
293 $(use_enable kerberos gssapi) \
294 $(use_enable ldap) \
295 $(use_enable pam) \
296 $(use_enable png) \
297 $(use_enable slp) \
298 $(use_enable static) \
299 $(use_enable tiff) \
300 $(use_with java) \
301 $(use_with perl) \
302 $(use_with php) \
303 $(use_with python) \
304 --enable-libpaper \
305 --enable-threads \
306 --disable-pdftops \
307 ${myconf}
308
309 # install in /usr/libexec always, instead of using /usr/lib/cups, as that
310 # makes more sense when facing multilib support.
311 sed -i -e 's:SERVERBIN.*:SERVERBIN = "$(BUILDROOT)"/usr/libexec/cups:' Makedefs
312 sed -i -e 's:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN "/usr/libexec/cups":' config.h
313 sed -i -e 's:cups_serverbin=.*:cups_serverbin=/usr/libexec/cups:' cups-config
314
315 emake || die "emake failed"
316 }
317
318 src_install() {
319 emake BUILDROOT="${D}" install || die "emake install failed"
320 dodoc {CHANGES{,-1.{0,1}},CREDITS,README}.txt || die "dodoc install failed"
321
322 # clean out cups init scripts
323 rm -rf "${D}"/etc/{init.d/cups,rc*,pam.d/cups}
324
325 # install our init script
326 local neededservices
327 use avahi && neededservices="$neededservices avahi-daemon"
328 use dbus && neededservices="$neededservices dbus"
329 use zeroconf && ! use avahi && neededservices="$neededservices mDNSResponderPosix"
330 [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
331 sed -e "s/@neededservices@/$neededservices/" "${FILESDIR}"/cupsd.init.d > "${T}"/cupsd
332 doinitd "${T}"/cupsd
333
334 # install our pam script
335 pamd_mimic_system cups auth account
336
337 if use xinetd ; then
338 # correct path
339 sed -i -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" "${D}"/etc/xinetd.d/cups-lpd
340 # it is safer to disable this by default, bug #137130
341 grep -w 'disable' "${D}"/etc/xinetd.d/cups-lpd || \
342 sed -i -e "s:}:\tdisable = yes\n}:" "${D}"/etc/xinetd.d/cups-lpd
343 else
344 rm -rf "${D}"/etc/xinetd.d
345 fi
346
347 # install pdftops filter
348 exeinto /usr/libexec/cups/filter/
349 newexe "${FILESDIR}"/pdftops-1.20.gentoo pdftops
350
351 # only for gs-esp this is correct, see bug #163897
352 if has_version app-text/ghostscript-gpl || has_version app-text/ghostscript-gnu ; then
353 sed -i -e "s:#application/vnd.cups-postscript:application/vnd.cups-postscript:" "${D}"/etc/cups/mime.convs
354 fi
355
356 keepdir /usr/share/cups/profiles /usr/libexec/cups/driver /var/log/cups \
357 /var/run/cups/certs /var/cache/cups /var/spool/cups/tmp /etc/cups/ssl
358
359 # .desktop handling. X useflag. xdg-open from freedesktop is preferred, upstream bug STR #2724.
360 if use X ; then
361 sed -i -e "s:htmlview:xdg-open:" "${D}"/usr/share/applications/cups.desktop
362 else
363 rm -r "${D}"/usr/share/applications
364 fi
365
366 # fix a symlink collision, see bug #172341
367 dodir /usr/share/ppd
368 dosym /usr/share/ppd /usr/share/cups/model/foomatic-ppds
369
370 # create RSS feed directory
371 diropts -m 0740 -o lp -g lp
372 dodir /var/cache/cups/rss
373
374 # create /etc/cups/client.conf, bug #196967
375 echo "ServerName localhost" >> "${D}"/etc/cups/client.conf
376 }
377
378 pkg_preinst() {
379 # cleanups
380 [ -n "${PN}" ] && rm -fR "${ROOT}"/usr/share/doc/"${PN}"-*
381 has_version "=${CATEGORY}/${PN}-1.2*"
382 upgrade_from_1_2=$?
383 }
384
385 pkg_postinst() {
386 echo
387 elog "For information about installing a printer and general cups setup"
388 elog "take a look at: http://www.gentoo.org/doc/en/printing-howto.xml"
389 echo
390
391 local good_gs=false
392 for x in app-text/ghostscript-gpl app-text/ghostscript-gnu app-text/ghostscript-esp ; do
393 if has_version ${x} && built_with_use ${x} cups ; then
394 good_gs=true
395 break
396 fi
397 done
398 if ! ${good_gs} ; then
399 echo
400 ewarn "You need to emerge ghostscript with the \"cups\" USE flag turned on."
401 echo
402 fi
403
404 if [[ $upgrade_from_1_2 = 0 ]] ; then
405 echo
406 ewarn "You have upgraded from an older cups version. Please make sure"
407 ewarn "to run \"etc-update\" and \"revdep-rebuild\" NOW."
408 echo
409 fi
410
411 if [ -e "${ROOT}"/usr/lib/cups ] ; then
412 echo
413 ewarn "/usr/lib/cups exists - You need to remerge every ebuild that"
414 ewarn "installed into /usr/lib/cups and /etc/cups, qfile is in portage-utils:"
415 ewarn "# FEATURES=-collision-protect emerge -va1 \$(qfile -qC /usr/lib/cups /etc/cups | sed \"s:net-print/cups$::\")"
416 echo
417 ewarn "FEATURES=-collision-protect is needed to overwrite the compatibility"
418 ewarn "symlinks installed by this package, it won't be needed on later merges."
419 ewarn "You should also run revdep-rebuild"
420 echo
421
422 # place symlinks to make the update smoothless
423 for i in "${ROOT}"/usr/lib/cups/{backend,filter}/* ; do
424 if [ "${i/\*}" == "${i}" ] && ! [ -e ${i/lib/libexec} ] ; then
425 ln -s ${i} ${i/lib/libexec}
426 fi
427 done
428 fi
429 }
430
431
432
433 1.1 net-print/cups/cups-1.3.9.ebuild
434
435 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.3.9.ebuild?rev=1.1&view=markup
436 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-print/cups/cups-1.3.9.ebuild?rev=1.1&content-type=text/plain
437
438 Index: cups-1.3.9.ebuild
439 ===================================================================
440 # Copyright 1999-2008 Gentoo Foundation
441 # Distributed under the terms of the GNU General Public License v2
442 # $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.3.9.ebuild,v 1.1 2008/10/10 19:38:50 tgurr Exp $
443
444 inherit autotools eutils flag-o-matic multilib pam
445
446 MY_P=${P/_}
447
448 DESCRIPTION="The Common Unix Printing System"
449 HOMEPAGE="http://www.cups.org/"
450 SRC_URI="http://ftp.easysw.com/pub/cups/${PV}/${MY_P}-source.tar.bz2"
451
452 LICENSE="GPL-2"
453 SLOT="0"
454 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
455 IUSE="acl avahi dbus gnutls java jpeg kerberos ldap pam perl php png ppds python samba slp ssl static tiff X xinetd zeroconf"
456
457 COMMON_DEPEND="acl? ( kernel_linux? ( sys-apps/acl sys-apps/attr ) )
458 avahi? ( net-dns/avahi )
459 dbus? ( sys-apps/dbus )
460 gnutls? ( net-libs/gnutls )
461 java? ( >=virtual/jre-1.4 )
462 jpeg? ( >=media-libs/jpeg-6b )
463 kerberos? ( virtual/krb5 )
464 ldap? ( net-nds/openldap )
465 pam? ( virtual/pam )
466 perl? ( dev-lang/perl )
467 php? ( dev-lang/php )
468 png? ( >=media-libs/libpng-1.2.1 )
469 python? ( dev-lang/python )
470 slp? ( >=net-libs/openslp-1.0.4 )
471 ssl? ( !gnutls? ( >=dev-libs/openssl-0.9.8g ) )
472 tiff? ( >=media-libs/tiff-3.5.5 )
473 xinetd? ( sys-apps/xinetd )
474 zeroconf? ( !avahi? ( net-misc/mDNSResponder ) )
475 app-text/libpaper
476 dev-libs/libgcrypt"
477
478 DEPEND="${COMMON_DEPEND}
479 !<net-print/foomatic-filters-ppds-20070501
480 !<net-print/hplip-1.7.4a-r1"
481
482 RDEPEND="${COMMON_DEPEND}
483 !virtual/lpr
484 X? ( x11-misc/xdg-utils )
485 >=app-text/poppler-0.4.3-r1"
486
487 PDEPEND="
488 ppds? ( || (
489 (
490 net-print/foomatic-filters-ppds
491 net-print/foomatic-db-ppds
492 )
493 net-print/foomatic-filters-ppds
494 net-print/foomatic-db-ppds
495 net-print/hplip
496 net-print/gutenprint
497 net-print/foo2zjs
498 net-print/cups-pdf
499 ) )
500 samba? ( >=net-fs/samba-3.0.8 )
501 virtual/ghostscript"
502
503 PROVIDE="virtual/lpr"
504
505 # upstream includes an interactive test which is a nono for gentoo.
506 # therefore, since the printing herd has bigger fish to fry, for now,
507 # we just leave it out, even if FEATURES=test
508 RESTRICT="test"
509
510 S="${WORKDIR}/${MY_P}"
511
512 LANGS="de en es et fr he id it ja pl sv zh_TW"
513 for X in ${LANGS} ; do
514 IUSE="${IUSE} linguas_${X}"
515 done
516
517 pkg_setup() {
518 if use avahi && ! built_with_use net-dns/avahi mdnsresponder-compat ; then
519 echo
520 eerror "In order to have cups working with avahi zeroconf support, you need"
521 eerror "to have net-dns/avahi emerged with \"mdnsresponder-compat\" in your USE"
522 eerror "flag. Please add that flag, re-emerge avahi, and then emerge cups again."
523 die "net-dns/avahi is missing the mdnsresponder-compat feature."
524 fi
525
526 enewgroup lp
527 enewuser lp -1 -1 -1 lp
528
529 enewgroup lpadmin 106
530 }
531
532 src_unpack() {
533 unpack ${A}
534 cd "${S}"
535
536 # disable configure automagic for acl/attr, upstream bug STR #2723
537 epatch "${FILESDIR}/${PN}-1.3.0-configure.patch"
538
539 # create a missing symlink to allow https printing via IPP, bug #217293
540 epatch "${FILESDIR}/${PN}-1.3.7-backend-https.patch"
541
542 # cups does not use autotools "the usual way" and ship a static config.h.in
543 eaclocal
544 eautoconf
545 }
546
547 src_compile() {
548 # needed to prevent ghostscript compile failures
549 use kerberos && strip-flags
550
551 # locale support
552 strip-linguas ${LANGS}
553
554 if [ -z "${LINGUAS}" ] ; then
555 export LINGUAS=all
556 fi
557
558 export DSOFLAGS="${LDFLAGS}"
559
560 if use ldap ; then
561 append-flags -DLDAP_DEPRECATED
562 fi
563
564 local myconf
565
566 if use avahi || use zeroconf ; then
567 myconf="${myconf} --enable-dnssd"
568 else
569 myconf="${myconf} --disable-dnssd"
570 fi
571
572 if use ssl || use gnutls ; then
573 myconf="${myconf} \
574 $(use_enable gnutls) \
575 $(use_enable !gnutls openssl)"
576 else
577 myconf="${myconf} \
578 --disable-gnutls \
579 --disable-openssl"
580 fi
581
582 econf \
583 --libdir=/usr/$(get_libdir) \
584 --localstatedir=/var \
585 --with-cups-user=lp \
586 --with-cups-group=lp \
587 --with-docdir=/usr/share/cups/html \
588 --with-languages=${LINGUAS} \
589 --with-system-groups=lpadmin \
590 --with-xinetd=/etc/xinetd.d \
591 $(use_enable acl) \
592 $(use_enable dbus) \
593 $(use_enable jpeg) \
594 $(use_enable kerberos gssapi) \
595 $(use_enable ldap) \
596 $(use_enable pam) \
597 $(use_enable png) \
598 $(use_enable slp) \
599 $(use_enable static) \
600 $(use_enable tiff) \
601 $(use_with java) \
602 $(use_with perl) \
603 $(use_with php) \
604 $(use_with python) \
605 --enable-libpaper \
606 --enable-threads \
607 --disable-pdftops \
608 ${myconf}
609
610 # install in /usr/libexec always, instead of using /usr/lib/cups, as that
611 # makes more sense when facing multilib support.
612 sed -i -e 's:SERVERBIN.*:SERVERBIN = "$(BUILDROOT)"/usr/libexec/cups:' Makedefs
613 sed -i -e 's:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN "/usr/libexec/cups":' config.h
614 sed -i -e 's:cups_serverbin=.*:cups_serverbin=/usr/libexec/cups:' cups-config
615
616 emake || die "emake failed"
617 }
618
619 src_install() {
620 emake BUILDROOT="${D}" install || die "emake install failed"
621 dodoc {CHANGES{,-1.{0,1}},CREDITS,README}.txt || die "dodoc install failed"
622
623 # clean out cups init scripts
624 rm -rf "${D}"/etc/{init.d/cups,rc*,pam.d/cups}
625
626 # install our init script
627 local neededservices
628 use avahi && neededservices="$neededservices avahi-daemon"
629 use dbus && neededservices="$neededservices dbus"
630 use zeroconf && ! use avahi && neededservices="$neededservices mDNSResponderPosix"
631 [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
632 sed -e "s/@neededservices@/$neededservices/" "${FILESDIR}"/cupsd.init.d > "${T}"/cupsd
633 doinitd "${T}"/cupsd
634
635 # install our pam script
636 pamd_mimic_system cups auth account
637
638 if use xinetd ; then
639 # correct path
640 sed -i -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" "${D}"/etc/xinetd.d/cups-lpd
641 # it is safer to disable this by default, bug #137130
642 grep -w 'disable' "${D}"/etc/xinetd.d/cups-lpd || \
643 sed -i -e "s:}:\tdisable = yes\n}:" "${D}"/etc/xinetd.d/cups-lpd
644 else
645 rm -rf "${D}"/etc/xinetd.d
646 fi
647
648 # install pdftops filter
649 exeinto /usr/libexec/cups/filter/
650 newexe "${FILESDIR}"/pdftops-1.20.gentoo pdftops
651
652 # only for gs-esp this is correct, see bug #163897
653 if has_version app-text/ghostscript-gpl || has_version app-text/ghostscript-gnu ; then
654 sed -i -e "s:#application/vnd.cups-postscript:application/vnd.cups-postscript:" "${D}"/etc/cups/mime.convs
655 fi
656
657 keepdir /usr/share/cups/profiles /usr/libexec/cups/driver /var/log/cups \
658 /var/run/cups/certs /var/cache/cups /var/spool/cups/tmp /etc/cups/ssl
659
660 # .desktop handling. X useflag. xdg-open from freedesktop is preferred, upstream bug STR #2724.
661 if use X ; then
662 sed -i -e "s:htmlview:xdg-open:" "${D}"/usr/share/applications/cups.desktop
663 else
664 rm -r "${D}"/usr/share/applications
665 fi
666
667 # fix a symlink collision, see bug #172341
668 dodir /usr/share/ppd
669 dosym /usr/share/ppd /usr/share/cups/model/foomatic-ppds
670
671 # create RSS feed directory
672 diropts -m 0740 -o lp -g lp
673 dodir /var/cache/cups/rss
674
675 # create /etc/cups/client.conf, bug #196967
676 echo "ServerName localhost" >> "${D}"/etc/cups/client.conf
677 }
678
679 pkg_preinst() {
680 # cleanups
681 [ -n "${PN}" ] && rm -fR "${ROOT}"/usr/share/doc/"${PN}"-*
682 has_version "=${CATEGORY}/${PN}-1.2*"
683 upgrade_from_1_2=$?
684 }
685
686 pkg_postinst() {
687 echo
688 elog "For information about installing a printer and general cups setup"
689 elog "take a look at: http://www.gentoo.org/doc/en/printing-howto.xml"
690 echo
691
692 local good_gs=false
693 for x in app-text/ghostscript-gpl app-text/ghostscript-gnu app-text/ghostscript-esp ; do
694 if has_version ${x} && built_with_use ${x} cups ; then
695 good_gs=true
696 break
697 fi
698 done
699 if ! ${good_gs} ; then
700 echo
701 ewarn "You need to emerge ghostscript with the \"cups\" USE flag turned on."
702 echo
703 fi
704
705 if [[ $upgrade_from_1_2 = 0 ]] ; then
706 echo
707 ewarn "You have upgraded from an older cups version. Please make sure"
708 ewarn "to run \"etc-update\" and \"revdep-rebuild\" NOW."
709 echo
710 fi
711
712 if [ -e "${ROOT}"/usr/lib/cups ] ; then
713 echo
714 ewarn "/usr/lib/cups exists - You need to remerge every ebuild that"
715 ewarn "installed into /usr/lib/cups and /etc/cups, qfile is in portage-utils:"
716 ewarn "# FEATURES=-collision-protect emerge -va1 \$(qfile -qC /usr/lib/cups /etc/cups | sed \"s:net-print/cups$::\")"
717 echo
718 ewarn "FEATURES=-collision-protect is needed to overwrite the compatibility"
719 ewarn "symlinks installed by this package, it won't be needed on later merges."
720 ewarn "You should also run revdep-rebuild"
721 echo
722
723 # place symlinks to make the update smoothless
724 for i in "${ROOT}"/usr/lib/cups/{backend,filter}/* ; do
725 if [ "${i/\*}" == "${i}" ] && ! [ -e ${i/lib/libexec} ] ; then
726 ln -s ${i} ${i/lib/libexec}
727 fi
728 done
729 fi
730 }