net-print/cups-filters: sparc stable wrt bug #619426
[gentoo.git] / net-print / cups-filters / cups-filters-9999.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 GENTOO_DEPEND_ON_PERL=no
7
8 inherit perl-module systemd
9
10 if [[ "${PV}" == "9999" ]] ; then
11         inherit bzr autotools
12         EBZR_REPO_URI="http://bzr.linuxfoundation.org/openprinting/cups-filters"
13 else
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"
16 fi
17 DESCRIPTION="Cups PDF filters"
18 HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/pdf_as_standard_print_job_format"
19
20 LICENSE="MIT GPL-2"
21 SLOT="0"
22 IUSE="dbus +foomatic ipp_autosetup jpeg ldap pdf perl png +postscript static-libs tiff zeroconf"
23
24 RDEPEND="
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:=
28         dev-libs/glib:2
29         media-libs/fontconfig
30         media-libs/freetype:2
31         media-libs/lcms:2
32         >=net-print/cups-1.7.3
33         !<=net-print/cups-1.5.9999
34         sys-devel/bc
35         sys-libs/zlib
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] )
45 "
46 DEPEND="${RDEPEND}
47         dev-util/gdbus-codegen
48 "
49
50 src_prepare() {
51         default
52         [[ "${PV}" == "9999" ]] && eautoreconf
53 }
54
55 src_configure() {
56         local myeconfargs=(
57                 --docdir="${EPREFIX}/usr/share/doc/${PF}"
58                 --enable-imagefilters
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
64                 --with-rcdir=no
65                 --without-php
66                 $(use_enable dbus)
67                 $(use_enable foomatic)
68                 $(use_enable ipp_autosetup auto-setup-driverless)
69                 $(use_enable ldap)
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)
75                 $(use_with jpeg)
76                 $(use_with png)
77                 $(use_with tiff)
78         )
79         econf "${myeconfargs[@]}"
80 }
81
82 src_compile() {
83         default
84
85         if use perl; then
86                 pushd "${S}/scripting/perl" > /dev/null
87                 perl-module_src_configure
88                 perl-module_src_compile
89                 popd > /dev/null
90         fi
91 }
92
93 src_install() {
94         default
95
96         if use perl; then
97                 pushd "${S}/scripting/perl" > /dev/null
98                 perl-module_src_install
99                 perl_delete_localpod
100                 popd > /dev/null
101         fi
102
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
107         fi
108
109         find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
110
111         cp "${FILESDIR}"/cups-browsed.init.d-r1 "${T}"/cups-browsed || die
112
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
116         fi
117
118         doinitd "${T}"/cups-browsed
119         systemd_dounit "${S}/utils/cups-browsed.service"
120 }
121
122 src_test() {
123         emake check
124 }
125
126 pkg_postinst() {
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."
130         fi
131 }