1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 GENTOO_DEPEND_ON_PERL=no
9 inherit eutils perl-module autotools systemd
11 if [[ "${PV}" == "9999" ]] ; then
13 EBZR_REPO_URI="http://bzr.linuxfoundation.org/openprinting/cups-filters"
15 SRC_URI="http://www.openprinting.org/download/${PN}/${P}.tar.xz"
16 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-fbsd ~m68k-mint"
18 DESCRIPTION="Cups PDF filters"
19 HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat"
23 IUSE="dbus +foomatic jpeg ldap perl png static-libs tiff zeroconf"
26 >=app-text/ghostscript-gpl-9.09
27 >=app-text/poppler-0.32:=[cxx,jpeg?,lcms,tiff?,xpdf-headers(+)]
28 >=app-text/qpdf-3.0.2:=
33 >=net-print/cups-1.7.3
34 !<=net-print/cups-1.5.9999
37 dbus? ( sys-apps/dbus )
38 foomatic? ( !net-print/foomatic-filters )
39 jpeg? ( virtual/jpeg:0 )
40 ldap? ( net-nds/openldap )
41 perl? ( dev-lang/perl:= )
42 png? ( media-libs/libpng:0= )
43 tiff? ( media-libs/tiff:0 )
44 zeroconf? ( net-dns/avahi[dbus] )
47 dev-util/gdbus-codegen
51 sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
57 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
59 $(use_enable zeroconf avahi) \
60 $(use_enable static-libs static) \
62 --with-fontdir="fonts/conf.avail" \
63 --with-pdftops=pdftops \
64 --enable-imagefilters \
69 --with-browseremoteprotocols=DNSSD,CUPS \
77 pushd "${S}/scripting/perl" > /dev/null
78 perl-module_src_configure
79 perl-module_src_compile
88 pushd "${S}/scripting/perl" > /dev/null
89 perl-module_src_install
94 # workaround: some printer drivers still require pstoraster and pstopxl, bug #383831
95 dosym /usr/libexec/cups/filter/gstoraster /usr/libexec/cups/filter/pstoraster
96 dosym /usr/libexec/cups/filter/gstopxl /usr/libexec/cups/filter/pstopxl
98 prune_libtool_files --all
100 cp "${FILESDIR}"/cups-browsed.init.d "${T}"/cups-browsed || die
102 if ! use zeroconf ; then
103 sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die
104 sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die
107 if ! use foomatic ; then
108 # this needs an upstream solution / configure switch
109 rm -v "${ED}/usr/bin/foomatic-rip" || die
110 rm -v "${ED}/usr/libexec/cups/filter/foomatic-rip" || die
111 rm -v "${ED}/usr/share/man/man1/foomatic-rip.1" || die
114 doinitd "${T}"/cups-browsed
115 systemd_dounit "${S}/utils/cups-browsed.service"
119 if ! use foomatic ; then
120 ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely."
121 ewarn "necessary. net-print/foomatic-filters as replacement is deprecated and unmaintained."