Lines 1-38
Link Here
|
1 |
# Copyright 1999-2009 Gentoo Foundation |
1 |
# Copyright 1999-2009 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-print/hplip/hplip-3.9.8.ebuild,v 1.1 2009/09/24 19:55:40 flameeyes Exp $ |
3 |
# $Header: $ |
4 |
|
4 |
|
5 |
EAPI="2" |
5 |
EAPI="2" |
6 |
|
6 |
|
7 |
inherit eutils fdo-mime linux-info python autotools |
7 |
inherit fdo-mime linux-info python autotools |
8 |
|
8 |
|
9 |
DESCRIPTION="HP Linux Imaging and Printing System. Includes net-print/hpijs, scanner drivers and service tools." |
9 |
DESCRIPTION="HP Linux Imaging and Printing System. Includes printer, scanner, fax drivers and service tools." |
10 |
HOMEPAGE="http://hplip.sourceforge.net/" |
10 |
HOMEPAGE="http://hplip.sourceforge.net/" |
11 |
SRC_URI="mirror://sourceforge/hplip/${P}.tar.gz" |
11 |
SRC_URI="mirror://sourceforge/hplip/${P}.tar.gz" |
12 |
|
12 |
|
13 |
LICENSE="GPL-2" |
13 |
LICENSE="GPL-2" |
14 |
SLOT="0" |
14 |
SLOT="0" |
15 |
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
15 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
16 |
|
16 |
|
17 |
IUSE="+cups cupsddk dbus doc fax gtk minimal parport policykit ppds qt3 qt4 scanner snmp" |
17 |
IUSE="doc fax gtk +hpcups hpijs libnotify minimal parport policykit qt3 qt4 scanner snmp -static" |
18 |
|
18 |
|
19 |
# Note : libusb-compat untested (calchan 20090516) |
19 |
# Note : libusb-compat untested (calchan 20090516) |
20 |
|
20 |
|
21 |
DEPEND="!net-print/hpijs |
21 |
COMMON_DEPEND=" |
22 |
!net-print/hpoj |
|
|
23 |
>=dev-lang/python-2.4.4[threads] |
24 |
virtual/ghostscript |
22 |
virtual/ghostscript |
25 |
media-libs/jpeg |
23 |
media-libs/jpeg |
|
|
24 |
hpijs? ( >=net-print/foomatic-filters-3.0.20080507[cups] ) |
25 |
!static? ( || ( >=net-print/cups-1.4.0 net-print/cupsddk ) ) |
26 |
!minimal? ( |
26 |
!minimal? ( |
27 |
net-print/cups |
27 |
net-print/cups |
28 |
virtual/libusb:0 |
28 |
virtual/libusb:0 |
29 |
cupsddk? ( |
29 |
>=dev-lang/python-2.4.4[threads,xml] |
30 |
foomatic? ( >=net-print/foomatic-filters-3.0.20080507[cups] ) |
|
|
31 |
|| ( >=net-print/cups-1.4.0 net-print/cupsddk ) |
32 |
) |
33 |
ppds? ( |
34 |
foomatic? ( >=net-print/foomatic-filters-3.0.20080507[cups] ) |
35 |
) |
36 |
scanner? ( >=media-gfx/sane-backends-1.0.19-r1 ) |
30 |
scanner? ( >=media-gfx/sane-backends-1.0.19-r1 ) |
37 |
snmp? ( |
31 |
snmp? ( |
38 |
net-analyzer/net-snmp |
32 |
net-analyzer/net-snmp |
Lines 40-72
Link Here
|
40 |
) |
34 |
) |
41 |
)" |
35 |
)" |
42 |
|
36 |
|
43 |
RDEPEND="${DEPEND} |
37 |
DEPEND="${COMMON_DEPEND} |
|
|
38 |
dev-util/pkgconfig" |
39 |
|
40 |
RDEPEND="${COMMON_DEPEND} |
44 |
!minimal? ( |
41 |
!minimal? ( |
45 |
kernel_linux? ( >=sys-fs/udev-114 ) |
42 |
kernel_linux? ( >=sys-fs/udev-114 ) |
46 |
scanner? ( |
43 |
scanner? ( |
47 |
dev-python/imaging |
44 |
dev-python/imaging |
48 |
dev-python/reportlab |
|
|
49 |
gtk? ( media-gfx/xsane ) |
45 |
gtk? ( media-gfx/xsane ) |
50 |
!gtk? ( media-gfx/sane-frontends ) |
46 |
!gtk? ( media-gfx/sane-frontends ) |
51 |
) |
47 |
) |
52 |
fax? ( |
48 |
fax? ( |
53 |
dev-python/reportlab |
49 |
dev-python/reportlab |
|
|
50 |
sys-apps/dbus |
51 |
dev-python/dbus-python |
54 |
) |
52 |
) |
55 |
qt3? ( !qt4? ( |
53 |
qt3? ( !qt4? ( |
56 |
dev-python/PyQt |
54 |
dev-python/PyQt |
57 |
) ) |
55 |
) ) |
58 |
qt4? ( |
56 |
qt4? ( |
59 |
dev-python/PyQt4[X] |
57 |
dev-python/PyQt4[dbus,X] |
60 |
) |
|
|
61 |
dbus? ( |
62 |
sys-apps/dbus |
63 |
dev-python/dbus-python |
64 |
dev-python/pygobject |
65 |
) |
66 |
policykit? ( |
67 |
sys-auth/policykit |
68 |
dev-python/pygobject |
58 |
dev-python/pygobject |
69 |
dev-python/dbus-python |
59 |
libnotify? ( |
|
|
60 |
dev-python/notify-python |
61 |
) |
62 |
policykit? ( |
63 |
sys-auth/policykit |
64 |
) |
70 |
) |
65 |
) |
71 |
)" |
66 |
)" |
72 |
|
67 |
|
Lines 74-91
Link Here
|
74 |
ERROR_PARPORT="Please make sure parallel port support is enabled in your kernel (PARPORT and PPDEV)." |
69 |
ERROR_PARPORT="Please make sure parallel port support is enabled in your kernel (PARPORT and PPDEV)." |
75 |
|
70 |
|
76 |
pkg_setup() { |
71 |
pkg_setup() { |
77 |
! use qt3 && ! use qt4 && ewarn "You need USE=qt3 or USE=qt4 for the hplip GUI." |
72 |
! use qt3 && ! use qt4 && ewarn "You need USE=qt4 or USE=qt3 for the hplip GUI." |
78 |
|
73 |
|
79 |
use scanner && ! use gtk && ewarn "You need USE=gtk for the scanner GUI." |
74 |
use scanner && ! use gtk && ewarn "You need USE=gtk for the scanner GUI." |
80 |
|
75 |
|
81 |
if ! use ppds && ! use cupsddk && ! use cups; then |
76 |
if ! use hpcups && ! use hpijs ; then |
82 |
ewarn "Installing neither static (USE=-ppds) nor dynamic (USE=-cupsddk) PPD files," |
77 |
ewarn "Installing neither hpcups (USE=-hpcups) nor hpijs (USE=-hpijs) driver," |
83 |
ewarn "nor hpcups driver (USE=-cups) which is probably not what you want." |
78 |
ewarn "which is probably not what you want." |
84 |
ewarn "You will almost certainly not be able to print (recommended: USE=\"cups -cupsddk -ppds\")." |
79 |
ewarn "You will almost certainly not be able to print." |
|
|
80 |
ewarn "Recommended USE flags: USE=\"hpcups -hpijs\")." |
85 |
fi |
81 |
fi |
86 |
|
82 |
|
87 |
if use minimal ; then |
83 |
if use minimal ; then |
88 |
ewarn "Installing hpijs driver only, make sure you know what you are doing." |
84 |
ewarn "Installing driver portions only, make sure you know what you are doing." |
89 |
else |
85 |
else |
90 |
use parport && linux-info_pkg_setup |
86 |
use parport && linux-info_pkg_setup |
91 |
fi |
87 |
fi |
Lines 94-204
Link Here
|
94 |
src_prepare() { |
90 |
src_prepare() { |
95 |
sed -i -e "s/'skipstone']/'skipstone', 'epiphany']/" \ |
91 |
sed -i -e "s/'skipstone']/'skipstone', 'epiphany']/" \ |
96 |
-e "s/'skipstone': ''}/'skipstone': '', 'epiphany': '--new-window'}/" \ |
92 |
-e "s/'skipstone': ''}/'skipstone': '', 'epiphany': '--new-window'}/" \ |
97 |
base/utils.py || die "Patching base/utils.py failed" |
93 |
base/utils.py || die "Sed base/utils.py failed" |
98 |
|
94 |
|
99 |
# bug 98428 |
95 |
# bug 98428 |
100 |
sed -i -e "s:/usr/bin/env python:/usr/bin/python:g" hpssd.py || die "Patching hpssd.py failed" |
96 |
sed -i -e "s:/usr/bin/env python:/usr/bin/python:g" hpssd.py || die "Sed hpssd.py failed" |
101 |
|
97 |
|
102 |
# Force recognition of Gentoo distro by hp-check |
98 |
# Force recognition of Gentoo distro by hp-check |
103 |
sed -i \ |
99 |
sed -i \ |
104 |
-e "s:file('/etc/issue', 'r').read():'Gentoo':" \ |
100 |
-e "s:file('/etc/issue', 'r').read():'Gentoo':" \ |
105 |
installer/core_install.py || die "sed core_install.py" |
101 |
installer/core_install.py || die "Sed installer/core_install.py failed" |
106 |
|
102 |
|
107 |
# SYSFS deprecated - https://bugs.launchpad.net/hplip/+bug/346390 |
103 |
# SYSFS deprecated - https://bugs.launchpad.net/hplip/+bug/346390 |
108 |
sed -i -e "s/SYSFS/ATTRS/g" -e "s/sysfs/attrs/g" data/rules/56-hpmud_support.rules || die "sed failed" |
104 |
sed -i -e "s/SYSFS/ATTRS/g" -e "s/sysfs/attrs/g" data/rules/56-hpmud_support.rules \ |
|
|
105 |
|| die "Sed data/rules/56-hpmud_support.rules failed" |
109 |
|
106 |
|
110 |
# Replace udev rules, see bug #197726. |
107 |
# Replace udev rules, see bug #197726. |
111 |
mv data/rules/40-hplip.rules data/rules/70-hplip.rules || die |
108 |
mv data/rules/40-hplip.rules data/rules/70-hplip.rules || die |
112 |
sed -i \ |
109 |
sed -i \ |
113 |
-e "s/40-hplip.rules/70-hplip.rules/g" \ |
110 |
-e "s/40-hplip.rules/70-hplip.rules/g" \ |
114 |
Makefile.am */*.html || die "sed failed" |
111 |
Makefile.am */*.html || die "Sed Makefile.am */*.html failed" |
115 |
|
112 |
|
116 |
sed -i \ |
113 |
sed -i \ |
117 |
-e s:/usr/lib/cups/driver:$(cups-config --serverbin)/driver:g \ |
114 |
-e s:/usr/lib/cups/driver:$(cups-config --serverbin)/driver:g \ |
118 |
installer/core_install.py || die "sed core_install.py" |
115 |
installer/core_install.py || die "Sed installer/core_install.py failed" |
119 |
|
116 |
|
120 |
# Use system foomatic-rip instead of foomatic-rip-hplip |
117 |
# Use system foomatic-rip instead of foomatic-rip-hplip |
121 |
local i |
118 |
local i |
122 |
for i in ppd/{hpcups,hpijs}/*.ppd.gz |
119 |
for i in ppd/{hpcups,hpijs}/*.ppd.gz |
123 |
do |
120 |
do |
124 |
rm -f ${i}.temp |
121 |
rm -f ${i}.temp |
125 |
gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | gzip > ${i}.temp || die "*.ppd.gz sed failed" |
122 |
gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | gzip > ${i}.temp || die "Sed *.ppd.gz failed" |
126 |
mv ${i}.temp ${i} |
123 |
mv ${i}.temp ${i} |
127 |
done |
124 |
done |
128 |
|
125 |
|
129 |
# Qt4 is still undocumented by upstream, so use with caution |
|
|
130 |
local qt_ver |
126 |
local qt_ver |
131 |
use qt3 && qt_ver="3" |
|
|
132 |
use qt4 && qt_ver="4" |
133 |
if use qt3 || use qt4 ; then |
127 |
if use qt3 || use qt4 ; then |
|
|
128 |
use qt3 && qt_ver="3" |
129 |
use qt4 && qt_ver="4" |
134 |
sed -i \ |
130 |
sed -i \ |
135 |
-e "s/%s --force-startup/%s --force-startup --qt${qt_ver}/" \ |
131 |
-e "s/%s --force-startup/%s --force-startup --qt${qt_ver}/" \ |
136 |
-e "s/'--force-startup'/'--force-startup', '--qt${qt_ver}'/" \ |
132 |
-e "s/'--force-startup'/'--force-startup', '--qt${qt_ver}'/" \ |
137 |
base/device.py || die "sed failed" |
133 |
base/device.py || die "Sed base/device.py failed" |
138 |
sed -i \ |
134 |
sed -i \ |
139 |
-e "s/Exec=hp-systray/Exec=hp-systray --qt${qt_ver}/" \ |
135 |
-e "s/Exec=hp-systray/Exec=hp-systray --qt${qt_ver}/" \ |
140 |
hplip-systray.desktop.in || die "sed failed" |
136 |
hplip-systray.desktop.in || die "Sed hplip-systray.desktop.in failed" |
|
|
137 |
fi |
138 |
|
139 |
# htmldocs are not installed under docdir/html |
140 |
# the following sed enables --htmldir configure switch in src_configure |
141 |
if use doc ; then |
142 |
sed -i -e 's/www\([0-9]\)dir = $(docdir)/www\1dir = $(htmldir)/g' Makefile.am || die "Sed Makefile.am failed" |
141 |
fi |
143 |
fi |
142 |
|
144 |
|
143 |
eautoreconf |
145 |
eautoreconf |
144 |
} |
146 |
} |
145 |
|
147 |
|
146 |
src_configure() { |
148 |
src_configure() { |
147 |
local myconf |
149 |
local drv_build gui_build myconf |
148 |
|
150 |
|
149 |
if use qt3 || use qt4 ; then |
151 |
if use qt3 || use qt4 ; then |
150 |
local gui_build="--enable-gui-build" |
152 |
gui_build="--enable-gui-build" |
151 |
if use qt4; then |
153 |
if use qt4 ; then |
152 |
gui_build="${gui_build} --enable-qt4 --disable-qt3" |
154 |
gui_build="${gui_build} --enable-qt4 --disable-qt3" |
|
|
155 |
if use policykit ; then |
156 |
myconf="--enable-policykit" |
157 |
else |
158 |
myconf="--disable-policykit" |
159 |
fi |
153 |
else |
160 |
else |
154 |
use qt3 && gui_build="${gui_build} --enable-qt3 --disable-qt4" |
161 |
use qt3 && gui_build="${gui_build} --enable-qt3 --disable-qt4" |
155 |
fi |
162 |
fi |
156 |
else |
163 |
else |
157 |
local gui_build="--disable-gui-build" |
164 |
gui_build="--disable-gui-build" |
158 |
fi |
165 |
fi |
159 |
|
166 |
|
160 |
if use cupsddk; then |
167 |
if use fax || use qt4 ; then |
161 |
myconf="${myconf} $(use_enable foomatic foomatic-drv-install)" |
168 |
myconf="${myconf} --enable-dbus-build" |
162 |
else |
169 |
else |
163 |
myconf="${myconf} --disable-foomatic-drv-install" |
170 |
myconf="${myconf} --disable-dbus-build" |
164 |
fi |
171 |
fi |
165 |
|
172 |
|
166 |
if use ppds; then |
173 |
if use hpcups ; then |
167 |
myconf="${myconf} $(use_enable foomatic foomatic-ppd-install)" |
174 |
drv_build="${drv_build} $(use_enable hpcups hpcups-install)" |
168 |
else |
175 |
if use static ; then |
169 |
myconf="${myconf} --disable-foomatic-ppd-install" |
176 |
drv_build="${drv_build} --enable-cups-ppd-install" |
|
|
177 |
drv_build="${drv_build} --disable-cups-drv-install" |
178 |
else |
179 |
drv_build="${drv_build} --enable-cups-drv-install" |
180 |
drv_build="${drv_build} --disable-cups-ppd-install" |
181 |
fi |
182 |
fi |
183 |
|
184 |
if use hpijs ; then |
185 |
drv_build="${drv_build} $(use_enable hpijs hpijs-install)" |
186 |
if use static ; then |
187 |
drv_build="${drv_build} --enable-foomatic-ppd-install" |
188 |
drv_build="${drv_build} --disable-foomatic-drv-install" |
189 |
else |
190 |
drv_build="${drv_build} --enable-foomatic-drv-install" |
191 |
drv_build="${drv_build} --disable-foomatic-ppd-install" |
192 |
fi |
170 |
fi |
193 |
fi |
171 |
|
194 |
|
172 |
econf \ |
195 |
econf \ |
173 |
--disable-dependency-tracking \ |
196 |
--disable-dependency-tracking \ |
174 |
--disable-cups11-build \ |
197 |
--disable-cups11-build \ |
|
|
198 |
--disable-lite-build \ |
199 |
--disable-new-hpcups \ |
200 |
--disable-foomatic-rip-hplip-install \ |
201 |
--disable-shadow-build \ |
175 |
--with-cupsbackenddir=$(cups-config --serverbin)/backend \ |
202 |
--with-cupsbackenddir=$(cups-config --serverbin)/backend \ |
176 |
--with-cupsfilterdir=$(cups-config --serverbin)/filter \ |
203 |
--with-cupsfilterdir=$(cups-config --serverbin)/filter \ |
177 |
--disable-foomatic-rip-hplip-install \ |
204 |
--htmldir=/usr/share/doc/${P}/html \ |
178 |
--enable-udev-acl-rules \ |
205 |
--enable-udev-acl-rules \ |
179 |
${myconf} \ |
206 |
${drv_build} \ |
180 |
${gui_build} \ |
207 |
${gui_build} \ |
|
|
208 |
${myconf} \ |
181 |
$(use_enable doc doc-build) \ |
209 |
$(use_enable doc doc-build) \ |
182 |
$(use_enable cups hpcups-install) \ |
|
|
183 |
$(use_enable ppds cups-ppd-install) \ |
184 |
$(use_enable cupsddk cups-drv-install) \ |
185 |
$(use_enable dbus dbus-build) \ |
186 |
$(use_enable fax fax-build) \ |
210 |
$(use_enable fax fax-build) \ |
187 |
$(use_enable minimal hpijs-only-build) \ |
211 |
$(use_enable minimal hpijs-only-build) \ |
188 |
$(use_enable parport pp-build) \ |
212 |
$(use_enable parport pp-build) \ |
189 |
$(use_enable scanner scan-build) \ |
213 |
$(use_enable scanner scan-build) \ |
190 |
$(use_enable snmp network-build) \ |
214 |
$(use_enable snmp network-build) |
191 |
$(use_enable policykit policykit) |
|
|
192 |
} |
215 |
} |
193 |
|
216 |
|
194 |
src_install() { |
217 |
src_install() { |
195 |
emake DESTDIR="${D}" install || die "emake install failed" |
218 |
emake DESTDIR="${D}" install || die "Emake install failed" |
196 |
rm -f "${D}"/etc/sane.d/dll.conf |
219 |
rm -f "${D}"/etc/sane.d/dll.conf |
197 |
|
220 |
|
198 |
use minimal && rm -r "${D}"/usr/$(get_libdir) |
221 |
use minimal && rm -r "${D}"/usr/$(get_libdir) |
199 |
|
222 |
|
200 |
# bug 106035/259763 |
223 |
# bug 106035/259763 |
201 |
if ! use qt3 && ! use qt4; then |
224 |
if ! use qt3 && ! use qt4 ; then |
202 |
rm -r "${D}"/usr/share/applications "${D}"/etc/xdg |
225 |
rm -r "${D}"/usr/share/applications "${D}"/etc/xdg |
203 |
fi |
226 |
fi |
204 |
|
227 |
|
Lines 207-227
Link Here
|
207 |
insinto /usr/kde/3.5/share/autostart |
230 |
insinto /usr/kde/3.5/share/autostart |
208 |
doins hplip-systray.desktop |
231 |
doins hplip-systray.desktop |
209 |
fi |
232 |
fi |
210 |
|
|
|
211 |
pushd doc |
212 |
dohtml -r * |
213 |
popd |
214 |
} |
233 |
} |
215 |
|
234 |
|
216 |
pkg_preinst() { |
235 |
pkg_preinst() { |
217 |
# avoid collisions with cups-1.2 compat symlinks |
236 |
# avoid collisions with cups-1.2 compat symlinks |
218 |
if [ -e "${ROOT}"/usr/lib/cups/backend/hp ] && [ -e "${ROOT}"/usr/libexec/cups/backend/hp ]; then |
237 |
if [ -e "${ROOT}"/usr/lib/cups/backend/hp ] && [ -e "${ROOT}"/usr/libexec/cups/backend/hp ] ; then |
219 |
rm "${ROOT}"/usr/libexec/cups/backend/hp{,fax} |
238 |
rm "${ROOT}"/usr/libexec/cups/backend/hp{,fax} |
220 |
fi |
239 |
fi |
221 |
} |
240 |
} |
222 |
|
241 |
|
223 |
pkg_postinst() { |
242 |
pkg_postinst() { |
224 |
python_mod_optimize /usr/share/${PN} |
243 |
use !minimal && python_mod_optimize /usr/share/${PN} |
225 |
fdo-mime_desktop_database_update |
244 |
fdo-mime_desktop_database_update |
226 |
|
245 |
|
227 |
elog "You should run hp-setup as root if you are installing hplip for the first time, and may also" |
246 |
elog "You should run hp-setup as root if you are installing hplip for the first time, and may also" |
Lines 234-239
Link Here
|
234 |
} |
253 |
} |
235 |
|
254 |
|
236 |
pkg_postrm() { |
255 |
pkg_postrm() { |
237 |
python_mod_cleanup /usr/share/${PN} |
256 |
use !minimal && python_mod_cleanup /usr/share/${PN} |
238 |
fdo-mime_desktop_database_update |
257 |
fdo-mime_desktop_database_update |
239 |
} |
258 |
} |