|
Lines 1-24
Link Here
|
| 1 |
# Copyright 1999-2008 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-2.8.7.ebuild,v 1.1 2008/08/17 12:46:53 calchan Exp $ |
3 |
# $Header: $ |
| 4 |
|
4 |
|
| 5 |
inherit eutils linux-info python |
5 |
EAPI="1" |
|
|
6 |
|
| 7 |
inherit eutils flag-o-matic fdo-mime linux-info python |
| 8 |
|
| 9 |
IUSE="cupsddk dbus doc fax gtk minimal parport ppds plugins qt3 qt4 scanner snmp" |
| 6 |
|
10 |
|
| 7 |
DESCRIPTION="HP Linux Imaging and Printing System. Includes net-print/hpijs, scanner drivers and service tools." |
11 |
DESCRIPTION="HP Linux Imaging and Printing System. Includes net-print/hpijs, scanner drivers and service tools." |
| 8 |
HOMEPAGE="http://hplip.sourceforge.net/" |
12 |
HOMEPAGE="http://hplip.sourceforge.net/" |
| 9 |
SRC_URI="mirror://sourceforge/hplip/${P}.tar.gz" |
13 |
SRC_URI="plugins? ( http://www.linuxprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${PV}-plugin.run ) |
|
|
14 |
mirror://sourceforge/hplip/${P}.tar.gz" |
| 10 |
|
15 |
|
| 11 |
LICENSE="GPL-2" |
16 |
LICENSE="GPL-2" |
| 12 |
SLOT="0" |
17 |
SLOT="0" |
| 13 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
18 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
| 14 |
|
19 |
|
| 15 |
IUSE="cupsddk dbus doc fax gtk minimal parport ppds qt3 qt4 scanner snmp" |
|
|
| 16 |
|
| 17 |
DEPEND="!net-print/hpijs |
20 |
DEPEND="!net-print/hpijs |
| 18 |
!net-print/hpoj |
21 |
!net-print/hpoj |
| 19 |
virtual/ghostscript |
22 |
virtual/ghostscript |
| 20 |
>=media-libs/jpeg-6b |
23 |
>=media-libs/jpeg-6b |
| 21 |
>=net-print/foomatic-filters-3.0.20080507 |
24 |
>=net-print/foomatic-filters-3.0 |
| 22 |
!minimal? ( |
25 |
!minimal? ( |
| 23 |
>=net-print/cups-1.2 |
26 |
>=net-print/cups-1.2 |
| 24 |
dev-libs/libusb |
27 |
dev-libs/libusb |
|
Lines 32-37
Link Here
|
| 32 |
)" |
35 |
)" |
| 33 |
|
36 |
|
| 34 |
RDEPEND="${DEPEND} |
37 |
RDEPEND="${DEPEND} |
|
|
38 |
app-arch/gzip |
| 35 |
!minimal? ( |
39 |
!minimal? ( |
| 36 |
!<sys-fs/udev-114 |
40 |
!<sys-fs/udev-114 |
| 37 |
scanner? ( |
41 |
scanner? ( |
|
Lines 54-59
Link Here
|
| 54 |
|
58 |
|
| 55 |
CONFIG_CHECK="PARPORT PPDEV" |
59 |
CONFIG_CHECK="PARPORT PPDEV" |
| 56 |
ERROR_PARPORT="Please make sure parallel port support is enabled in your kernel (PARPORT and PPDEV)." |
60 |
ERROR_PARPORT="Please make sure parallel port support is enabled in your kernel (PARPORT and PPDEV)." |
|
|
61 |
RESTRICT="plugins? ( strip )" |
| 57 |
|
62 |
|
| 58 |
pkg_setup() { |
63 |
pkg_setup() { |
| 59 |
! use qt3 && ! use qt4 && ewarn "You need USE=qt3 (recommended) or USE=qt4 for the hplip GUI." |
64 |
! use qt3 && ! use qt4 && ewarn "You need USE=qt3 (recommended) or USE=qt4 for the hplip GUI." |
|
Lines 74-82
Link Here
|
| 74 |
} |
79 |
} |
| 75 |
|
80 |
|
| 76 |
src_unpack() { |
81 |
src_unpack() { |
| 77 |
unpack ${A} |
82 |
unpack ${P}.tar.gz |
|
|
83 |
|
| 84 |
if use plugins; then |
| 85 |
echo ">>> Unpacking hplip-${PV}-plugin.tar.gz to ${WORKDIR}/plugins" |
| 86 |
mkdir -p "${WORKDIR}"/plugins |
| 87 |
cd "${WORKDIR}"/plugins |
| 88 |
tail -c +9523 "${DISTDIR}"/hplip-${PV}-plugin.run > hplip-${PV}-plugin.tar.gz |
| 89 |
tar xf "${WORKDIR}"/plugins/hplip-${PV}-plugin.tar.gz |
| 90 |
rm -f "${WORKDIR}"/plugins/hplip-${PV}-plugin.tar.gz |
| 91 |
fi |
| 92 |
|
| 78 |
cd "${S}" |
93 |
cd "${S}" |
| 79 |
|
94 |
|
|
|
95 |
sed -i -e "s:\/usr\/share\/hal\/fdi\/preprobe\/10osvendor:\/etc\/hal\/fdi\/preprobe:g" Makefile.in || die "Patching hplip.list.in failed" |
| 80 |
sed -i -e "s:\$(doc_DATA)::" Makefile.in || die "Patching Makefile.in failed" |
96 |
sed -i -e "s:\$(doc_DATA)::" Makefile.in || die "Patching Makefile.in failed" |
| 81 |
sed -i -e "s/'skipstone']/'skipstone', 'epiphany']/" \ |
97 |
sed -i -e "s/'skipstone']/'skipstone', 'epiphany']/" \ |
| 82 |
-e "s/'skipstone': ''}/'skipstone': '', 'epiphany': '--new-window'}/" \ |
98 |
-e "s/'skipstone': ''}/'skipstone': '', 'epiphany': '--new-window'}/" \ |
|
Lines 85-102
Link Here
|
| 85 |
# bug 98428 |
101 |
# bug 98428 |
| 86 |
sed -i -e "s:/usr/bin/env python:/usr/bin/python:g" hpssd.py || die "Patching hpssd.py failed" |
102 |
sed -i -e "s:/usr/bin/env python:/usr/bin/python:g" hpssd.py || die "Patching hpssd.py failed" |
| 87 |
|
103 |
|
| 88 |
# Force recognition of Gentoo distro by hp-check |
104 |
# Force recognition of Gentoo distro by hp-check and Gentoo based pathes |
| 89 |
sed -i \ |
105 |
sed -i \ |
| 90 |
-e "s:file('/etc/issue', 'r').read():'Gentoo':" \ |
106 |
-e "s:file('/etc/issue', 'r').read():'Gentoo':" \ |
| 91 |
installer/core_install.py || die "sed core_install.py" |
107 |
installer/core_install.py || die "sed core_install.py" |
|
|
108 |
sed -i \ |
| 109 |
-e s:\/usr\/lib\/cups\/driver:$(cups-config --serverbin)\/driver:g \ |
| 110 |
installer/core_install.py || die "sed core_install.py" |
| 92 |
|
111 |
|
| 93 |
# Replace udev rules, see bug #197726. |
112 |
# Replace udev rules, see bug #197726. |
| 94 |
rm data/rules/55-hpmud.rules |
113 |
rm data/rules/55-hpmud.rules |
| 95 |
cp "${FILESDIR}"/70-hpmud.rules data/rules |
114 |
cp "${FILESDIR}"/70-hpmud.rules data/rules |
| 96 |
sed -i -e "s/55-hpmud.rules/70-hpmud.rules/g" Makefile.* */*.html || die "sed failed" |
115 |
sed -i -e "s/55-hpmud.rules/70-hpmud.rules/g" Makefile.* */*.html || die "sed failed" |
| 97 |
|
116 |
|
| 98 |
# Use system foomatic-rip instead of foomatic-rip-hplip |
117 |
# Use system foomatic-rip instead of foomatic-rip-hpli |
| 99 |
sed -i -e 's/foomatic-rip-hplip/foomatic-rip/' ppd/*.ppd || die "sed failed" |
118 |
local i |
|
|
119 |
for i in ppd/*.ppd.gz |
| 120 |
do |
| 121 |
rm -f $i.temp |
| 122 |
gunzip -c $i | sed 's/foomatic-rip-hplip/foomatic-rip/g' | gzip > $i.temp || die "*.ppd.gz sed failed" |
| 123 |
mv $i.temp $i |
| 124 |
done |
| 100 |
|
125 |
|
| 101 |
# Qt4 is still undocumented by upstream, so use with caution |
126 |
# Qt4 is still undocumented by upstream, so use with caution |
| 102 |
local QT_VER |
127 |
local QT_VER |
|
Lines 118-125
Link Here
|
| 118 |
local GUI_BUILD="--disable-gui-build" |
143 |
local GUI_BUILD="--disable-gui-build" |
| 119 |
fi |
144 |
fi |
| 120 |
|
145 |
|
|
|
146 |
use qt4 && GUI_BUILD="$GUI_BUILD --enable-qt4 --disable-qt3" |
| 147 |
|
| 121 |
econf \ |
148 |
econf \ |
| 122 |
--disable-dependency-tracking \ |
149 |
--enable-dependency-tracking \ |
| 123 |
--disable-cups11-build \ |
150 |
--disable-cups11-build \ |
| 124 |
--with-cupsbackenddir=$(cups-config --serverbin)/backend \ |
151 |
--with-cupsbackenddir=$(cups-config --serverbin)/backend \ |
| 125 |
--with-cupsfilterdir=$(cups-config --serverbin)/filter \ |
152 |
--with-cupsfilterdir=$(cups-config --serverbin)/filter \ |
|
Lines 134-151
Link Here
|
| 134 |
$(use_enable ppds foomatic-ppd-install) \ |
161 |
$(use_enable ppds foomatic-ppd-install) \ |
| 135 |
$(use_enable scanner scan-build) \ |
162 |
$(use_enable scanner scan-build) \ |
| 136 |
$(use_enable snmp network-build) \ |
163 |
$(use_enable snmp network-build) \ |
|
|
164 |
--with-systraydir=/usr/share/autostart \ |
| 137 |
|| die "econf failed" |
165 |
|| die "econf failed" |
| 138 |
emake || die "Compilation failed" |
166 |
emake || die "Compilation failed" |
| 139 |
} |
167 |
} |
| 140 |
|
168 |
|
| 141 |
src_install() { |
169 |
src_install() { |
| 142 |
emake -j1 DESTDIR="${D}" install || die "emake install failed" |
170 |
replace-flags "-j?" "-j1" |
|
|
171 |
emake DESTDIR="${D}" install || die "emake install failed" |
| 143 |
rm -f "${D}"/etc/sane.d/dll.conf |
172 |
rm -f "${D}"/etc/sane.d/dll.conf |
| 144 |
|
173 |
|
|
|
174 |
if use plugins; then |
| 175 |
sed -i -e "s:SYSFS:ATTRS:g" "${WORKDIR}"/plugins/*.rules || die "sed failed" |
| 176 |
|
| 177 |
insinto /etc/udev/rules.d |
| 178 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1000.rules |
| 179 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1005_series.rules |
| 180 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1018.rules |
| 181 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1020.rules |
| 182 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1005.rules |
| 183 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1006.rules |
| 184 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1007.rules |
| 185 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1008.rules |
| 186 |
doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1505.rules |
| 187 |
|
| 188 |
# detect ARCH variable |
| 189 |
if [[ "${ARCH}" == "amd64" ]] ; then |
| 190 |
arch_var="64" |
| 191 |
else |
| 192 |
arch_var="32" |
| 193 |
fi |
| 194 |
cd "${D}"/usr/lib |
| 195 |
dodir /usr/share/hplip/scan/plugins |
| 196 |
dolib.so "${WORKDIR}"/plugins/bb_marvell-x86_"${arch_var}".so |
| 197 |
ln -s bb_marvell-x86_"${arch_var}".so bb_marvell.so |
| 198 |
dosym /usr/lib/bb_marvell-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_marvell.so |
| 199 |
dosym /usr/lib/bb_marvell-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_marvell-x86_"${arch_var}".so |
| 200 |
dolib.so "${WORKDIR}"/plugins/bb_soap-x86_"${arch_var}".so |
| 201 |
ln -s bb_soap-x86_"${arch_var}".so bb_soap.so |
| 202 |
dosym /usr/lib/bb_soap-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soap.so |
| 203 |
dosym /usr/lib/bb_soap-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soap-x86_"${arch_var}".so |
| 204 |
dolib.so "${WORKDIR}"/plugins/bb_soapht-x86_"${arch_var}".so |
| 205 |
ln -s bb_soapht-x86_"${arch_var}".so bb_soapht.so |
| 206 |
dosym /usr/lib/bb_soapht-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soapht.so |
| 207 |
dosym /usr/lib/bb_soapht-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soapht-x86_"${arch_var}".so |
| 208 |
dodir /usr/share/hplip/prnt/plugins |
| 209 |
dolib.so "${WORKDIR}"/plugins/lj-x86_"${arch_var}".so |
| 210 |
ln -s lj-x86_"${arch_var}".so lj.so |
| 211 |
dosym /usr/lib/lj-x86_"${arch_var}".so /usr/share/hplip/prnt/plugins/lj.so |
| 212 |
dosym /usr/lib/lj-x86_"${arch_var}".so /usr/share/hplip/prnt/plugins/lj-x86_"${arch_var}".so |
| 213 |
|
| 214 |
dodir /usr/share/hplip/data/plugins |
| 215 |
insinto /usr/share/hplip/data/plugins |
| 216 |
doins "${WORKDIR}"/plugins/license.txt |
| 217 |
|
| 218 |
dodir /usr/share/hplip/data/firmware |
| 219 |
insinto /usr/share/hplip/data/firmware |
| 220 |
doins "${WORKDIR}"/plugins/hp_laserjet_1000.fw.gz |
| 221 |
doins "${WORKDIR}"/plugins/hp_laserjet_1005_series.fw.gz |
| 222 |
doins "${WORKDIR}"/plugins/hp_laserjet_1018.fw.gz |
| 223 |
doins "${WORKDIR}"/plugins/hp_laserjet_1020.fw.gz |
| 224 |
doins "${WORKDIR}"/plugins/hp_laserjet_p1005.fw.gz |
| 225 |
doins "${WORKDIR}"/plugins/hp_laserjet_p1006.fw.gz |
| 226 |
doins "${WORKDIR}"/plugins/hp_laserjet_p1007.fw.gz |
| 227 |
doins "${WORKDIR}"/plugins/hp_laserjet_p1008.fw.gz |
| 228 |
doins "${WORKDIR}"/plugins/hp_laserjet_p1505.fw.gz |
| 229 |
sed -i -e "s:version\=\(.*\):version\=\1\nplugin\=1:" "${D}"/etc/hp/hplip.conf || die "sed failed" |
| 230 |
fi |
| 231 |
|
| 145 |
# bug 106035 |
232 |
# bug 106035 |
| 146 |
use qt3 || use qt4 || rm -Rf "${D}"/usr/share/applications |
233 |
use qt3 || use qt4 || rm -Rf "${D}"/usr/share/applications |
| 147 |
|
234 |
|
|
|
235 |
rm -f "${D}"/usr/share/ppd/HP/*.ppd |
| 236 |
|
| 148 |
use minimal && rm -rf "${D}"/usr/lib |
237 |
use minimal && rm -rf "${D}"/usr/lib |
|
|
238 |
|
| 149 |
} |
239 |
} |
| 150 |
|
240 |
|
| 151 |
pkg_preinst() { |
241 |
pkg_preinst() { |
|
Lines 157-162
Link Here
|
| 157 |
|
247 |
|
| 158 |
pkg_postinst() { |
248 |
pkg_postinst() { |
| 159 |
python_mod_optimize /usr/share/${PN} |
249 |
python_mod_optimize /usr/share/${PN} |
|
|
250 |
fdo-mime_desktop_database_update |
| 160 |
|
251 |
|
| 161 |
elog "You should run hp-setup as root if you are installing hplip for the first time, and may also" |
252 |
elog "You should run hp-setup as root if you are installing hplip for the first time, and may also" |
| 162 |
elog "need to run it if you are upgrading from an earlier version." |
253 |
elog "need to run it if you are upgrading from an earlier version." |
|
Lines 169-172
Link Here
|
| 169 |
|
260 |
|
| 170 |
pkg_postrm() { |
261 |
pkg_postrm() { |
| 171 |
python_mod_cleanup /usr/share/${PN} |
262 |
python_mod_cleanup /usr/share/${PN} |
|
|
263 |
fdo-mime_desktop_database_update |
| 172 |
} |
264 |
} |