dev-texlive/texlive-langgreek: Bump to TeX Live 2016.
[gentoo.git] / net-print / cups-filters / cups-filters-1.12.0.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 GENTOO_DEPEND_ON_PERL=no
8
9 inherit eutils perl-module systemd
10
11 if [[ "${PV}" == "9999" ]] ; then
12         inherit bzr
13         EBZR_REPO_URI="http://bzr.linuxfoundation.org/openprinting/cups-filters"
14 else
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"
17 fi
18 DESCRIPTION="Cups PDF filters"
19 HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/pdf_as_standard_print_job_format"
20
21 LICENSE="MIT GPL-2"
22 SLOT="0"
23 IUSE="dbus +foomatic jpeg ldap pdf perl png +postscript static-libs tiff zeroconf"
24
25 RDEPEND="
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:=
29         dev-libs/glib:2
30         media-libs/fontconfig
31         media-libs/freetype:2
32         media-libs/lcms:2
33         >=net-print/cups-1.7.3
34         !<=net-print/cups-1.5.9999
35         sys-devel/bc
36         sys-libs/zlib
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] )
46 "
47 DEPEND="${RDEPEND}
48         dev-util/gdbus-codegen
49 "
50
51 src_configure() {
52         econf \
53                 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
54                 --localstatedir="${EPREFIX}"/var \
55                 --with-cups-rundir="${EPREFIX}"/run/cups \
56                 $(use_enable dbus) \
57                 $(use_enable zeroconf avahi) \
58                 $(use_enable static-libs static) \
59                 $(use_enable foomatic) \
60                 $(use_enable ldap) \
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 \
67                 $(use_with jpeg) \
68                 $(use_with png) \
69                 $(use_with tiff) \
70                 --with-rcdir=no \
71                 --with-browseremoteprotocols=DNSSD,CUPS \
72                 --without-php
73 }
74
75 src_compile() {
76         default
77
78         if use perl; then
79                 pushd "${S}/scripting/perl" > /dev/null
80                 perl-module_src_configure
81                 perl-module_src_compile
82                 popd > /dev/null
83         fi
84 }
85
86 src_install() {
87         default
88
89         if use perl; then
90                 pushd "${S}/scripting/perl" > /dev/null
91                 perl-module_src_install
92                 perl_delete_localpod
93                 popd > /dev/null
94         fi
95
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
100         fi
101
102         prune_libtool_files --all
103
104         cp "${FILESDIR}"/cups-browsed.init.d-r1 "${T}"/cups-browsed || die
105
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
109         fi
110
111         doinitd "${T}"/cups-browsed
112         systemd_dounit "${S}/utils/cups-browsed.service"
113 }
114
115 src_test() {
116         emake check
117 }
118
119 pkg_postinst() {
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."
123         fi
124 }