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