1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 GENTOO_DEPEND_ON_PERL=no
8 inherit perl-module systemd
10 if [[ "${PV}" == "9999" ]] ; then
12 EBZR_REPO_URI="http://bzr.linuxfoundation.org/openprinting/cups-filters"
14 SRC_URI="http://www.openprinting.org/download/${PN}/${P}.tar.xz"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~m68k-mint"
17 DESCRIPTION="Cups PDF filters"
18 HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/pdf_as_standard_print_job_format"
22 IUSE="dbus +foomatic ipp_autosetup jpeg ldap pdf perl png +postscript static-libs tiff zeroconf"
25 postscript? ( >=app-text/ghostscript-gpl-9.09[cups] )
26 >=app-text/poppler-0.32:=[cxx,jpeg?,lcms,tiff?,utils]
27 >=app-text/qpdf-3.0.2:=
32 >=net-print/cups-1.7.3
33 !<=net-print/cups-1.5.9999
36 dbus? ( sys-apps/dbus )
37 foomatic? ( !net-print/foomatic-filters )
38 jpeg? ( virtual/jpeg:0 )
39 ldap? ( net-nds/openldap )
40 pdf? ( app-text/mupdf )
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
52 [[ "${PV}" == "9999" ]] && eautoreconf
57 --docdir="${EPREFIX}/usr/share/doc/${PF}"
59 --localstatedir="${EPREFIX}"/var
60 --with-browseremoteprotocols=DNSSD,CUPS
61 --with-cups-rundir="${EPREFIX}"/run/cups
62 --with-fontdir="fonts/conf.avail"
63 --with-pdftops=pdftops
67 $(use_enable foomatic)
68 $(use_enable ipp_autosetup auto-setup-driverless)
70 $(use_enable pdf mutool)
71 $(use_enable postscript ghostscript)
72 $(use_enable postscript ijs)
73 $(use_enable static-libs static)
74 $(use_enable zeroconf avahi)
79 econf "${myeconfargs[@]}"
86 pushd "${S}/scripting/perl" > /dev/null
87 perl-module_src_configure
88 perl-module_src_compile
97 pushd "${S}/scripting/perl" > /dev/null
98 perl-module_src_install
103 if use postscript; then
104 # workaround: some printer drivers still require pstoraster and pstopxl, bug #383831
105 dosym gstoraster /usr/libexec/cups/filter/pstoraster
106 dosym gstopxl /usr/libexec/cups/filter/pstopxl
109 find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
111 cp "${FILESDIR}"/cups-browsed.init.d-r1 "${T}"/cups-browsed || die
113 if ! use zeroconf ; then
114 sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die
115 sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die
118 doinitd "${T}"/cups-browsed
119 systemd_dounit "${S}/utils/cups-browsed.service"
127 if ! use foomatic ; then
128 ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely."
129 ewarn "necessary. net-print/foomatic-filters as replacement is deprecated and unmaintained."