net-print/cups-filters: drop unused base eclass
[gentoo.git] / net-print / cups-filters / cups-filters-1.5.0.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 GENTOO_DEPEND_ON_PERL=no
8
9 inherit eutils perl-module autotools 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="http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat"
20
21 LICENSE="MIT GPL-2"
22 SLOT="0"
23 IUSE="dbus +foomatic jpeg ldap perl png static-libs tiff zeroconf"
24
25 RDEPEND="
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:=
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         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         sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
52         eautoreconf
53 }
54
55 src_configure() {
56         econf \
57                 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
58                 $(use_enable dbus) \
59                 $(use_enable zeroconf avahi) \
60                 $(use_enable static-libs static) \
61                 $(use_enable ldap) \
62                 --with-fontdir="fonts/conf.avail" \
63                 --with-pdftops=pdftops \
64                 --enable-imagefilters \
65                 $(use_with jpeg) \
66                 $(use_with png) \
67                 $(use_with tiff) \
68                 --with-rcdir=no \
69                 --with-browseremoteprotocols=DNSSD,CUPS \
70                 --without-php
71 }
72
73 src_compile() {
74         MAKEOPTS=-j1 default
75
76         if use perl; then
77                 pushd "${S}/scripting/perl" > /dev/null
78                 perl-module_src_configure
79                 perl-module_src_compile
80                 popd > /dev/null
81         fi
82 }
83
84 src_install() {
85         default
86
87         if use perl; then
88                 pushd "${S}/scripting/perl" > /dev/null
89                 perl-module_src_install
90                 perl_delete_localpod
91                 popd > /dev/null
92         fi
93
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
97
98         prune_libtool_files --all
99
100         cp "${FILESDIR}"/cups-browsed.init.d "${T}"/cups-browsed || die
101
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
105         fi
106
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
112         fi
113
114         doinitd "${T}"/cups-browsed
115         systemd_dounit "${S}/utils/cups-browsed.service"
116 }
117
118 pkg_postinst() {
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."
122         fi
123 }