1 # Copyright 1999-2017 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 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="https://wiki.linuxfoundation.org/openprinting/pdf_as_standard_print_job_format"
23 IUSE="dbus +foomatic jpeg ldap pdf perl png +postscript static-libs tiff zeroconf"
26 postscript? ( >=app-text/ghostscript-gpl-9.09[cups] )
27 >=app-text/poppler-0.32:=[cxx,jpeg?,lcms,tiff?,utils,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 pdf? ( app-text/mupdf )
42 perl? ( dev-lang/perl:= )
43 png? ( media-libs/libpng:0= )
44 tiff? ( media-libs/tiff:0 )
45 zeroconf? ( net-dns/avahi[dbus] )
48 dev-util/gdbus-codegen
53 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
54 --localstatedir="${EPREFIX}"/var \
55 --with-cups-rundir="${EPREFIX}"/run/cups \
57 $(use_enable zeroconf avahi) \
58 $(use_enable static-libs static) \
59 $(use_enable foomatic) \
61 $(use_enable pdf mutool) \
62 $(use_enable postscript ghostscript) \
63 $(use_enable postscript ijs) \
64 --with-fontdir="fonts/conf.avail" \
65 --with-pdftops=pdftops \
66 --enable-imagefilters \
71 --with-browseremoteprotocols=DNSSD,CUPS \
79 pushd "${S}/scripting/perl" > /dev/null
80 perl-module_src_configure
81 perl-module_src_compile
90 pushd "${S}/scripting/perl" > /dev/null
91 perl-module_src_install
96 if use postscript; then
97 # workaround: some printer drivers still require pstoraster and pstopxl, bug #383831
98 dosym gstoraster /usr/libexec/cups/filter/pstoraster
99 dosym gstopxl /usr/libexec/cups/filter/pstopxl
102 prune_libtool_files --all
104 cp "${FILESDIR}"/cups-browsed.init.d-r1 "${T}"/cups-browsed || die
106 if ! use zeroconf ; then
107 sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die
108 sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die
111 doinitd "${T}"/cups-browsed
112 systemd_dounit "${S}/utils/cups-browsed.service"
120 if ! use foomatic ; then
121 ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely."
122 ewarn "necessary. net-print/foomatic-filters as replacement is deprecated and unmaintained."