Lines 2-8
Link Here
|
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.2 2009/03/14 19:04:39 armin76 Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-print/hplip/hplip-2.8.7.ebuild,v 1.2 2009/03/14 19:04:39 armin76 Exp $ |
4 |
|
4 |
|
5 |
inherit eutils linux-info python |
5 |
EAPI="2" |
|
|
6 |
|
7 |
inherit eutils fdo-mime linux-info python |
6 |
|
8 |
|
7 |
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 net-print/hpijs, scanner drivers and service tools." |
8 |
HOMEPAGE="http://hplip.sourceforge.net/" |
10 |
HOMEPAGE="http://hplip.sourceforge.net/" |
Lines 17-29
Link Here
|
17 |
DEPEND="!net-print/hpijs |
19 |
DEPEND="!net-print/hpijs |
18 |
!net-print/hpoj |
20 |
!net-print/hpoj |
19 |
virtual/ghostscript |
21 |
virtual/ghostscript |
20 |
>=media-libs/jpeg-6b |
22 |
media-libs/jpeg |
21 |
>=net-print/foomatic-filters-3.0.20080507 |
23 |
>=net-print/foomatic-filters-3.0.20080507[cups] |
22 |
!minimal? ( |
24 |
!minimal? ( |
23 |
>=net-print/cups-1.2 |
25 |
net-print/cups |
24 |
dev-libs/libusb |
26 |
dev-libs/libusb |
25 |
cupsddk? ( net-print/cupsddk ) |
27 |
cupsddk? ( net-print/cupsddk ) |
26 |
dbus? ( >=sys-apps/dbus-1.0.0 ) |
28 |
dbus? ( sys-apps/dbus ) |
27 |
scanner? ( >=media-gfx/sane-backends-1.0.19-r1 ) |
29 |
scanner? ( >=media-gfx/sane-backends-1.0.19-r1 ) |
28 |
snmp? ( |
30 |
snmp? ( |
29 |
net-analyzer/net-snmp |
31 |
net-analyzer/net-snmp |
Lines 36-53
Link Here
|
36 |
!<sys-fs/udev-114 |
38 |
!<sys-fs/udev-114 |
37 |
scanner? ( |
39 |
scanner? ( |
38 |
dev-python/imaging |
40 |
dev-python/imaging |
39 |
gtk? ( >=media-gfx/xsane-0.89 ) |
41 |
gtk? ( media-gfx/xsane ) |
40 |
!gtk? ( >=media-gfx/sane-frontends-1.0.9 ) |
42 |
!gtk? ( media-gfx/sane-frontends ) |
41 |
) |
43 |
) |
42 |
qt4? ( !qt3? ( |
44 |
qt4? ( !qt3? ( |
43 |
dev-python/PyQt4 |
45 |
dev-python/PyQt4 |
44 |
dbus? ( >=dev-python/dbus-python-0.80 ) |
46 |
dbus? ( dev-python/dbus-python ) |
45 |
fax? ( dev-python/reportlab ) |
47 |
fax? ( dev-python/reportlab ) |
46 |
) ) |
48 |
) ) |
47 |
qt3? ( |
49 |
qt3? ( |
48 |
>=dev-python/PyQt-3.14 |
50 |
dev-python/PyQt |
49 |
dev-python/ctypes |
51 |
dbus? ( dev-python/dbus-python ) |
50 |
dbus? ( >=dev-python/dbus-python-0.80 ) |
|
|
51 |
fax? ( dev-python/reportlab ) |
52 |
fax? ( dev-python/reportlab ) |
52 |
) |
53 |
) |
53 |
)" |
54 |
)" |
Lines 60-66
Link Here
|
60 |
|
61 |
|
61 |
use scanner && ! use gtk && ewarn "You need USE=gtk for the scanner GUI." |
62 |
use scanner && ! use gtk && ewarn "You need USE=gtk for the scanner GUI." |
62 |
|
63 |
|
63 |
if ! use ppds && ! use cupsddk; then |
64 |
if ! use ppds && ! use cupsddk ; then |
64 |
ewarn "Installing neither static (USE=-ppds) nor dynamic (USE=-cupsddk) PPD files," |
65 |
ewarn "Installing neither static (USE=-ppds) nor dynamic (USE=-cupsddk) PPD files," |
65 |
ewarn "which is probably not what you want. You will almost certainly not be able to " |
66 |
ewarn "which is probably not what you want. You will almost certainly not be able to " |
66 |
ewarn "print (recommended: USE=\"cupsddk -ppds\")." |
67 |
ewarn "print (recommended: USE=\"cupsddk -ppds\")." |
Lines 73-82
Link Here
|
73 |
fi |
74 |
fi |
74 |
} |
75 |
} |
75 |
|
76 |
|
76 |
src_unpack() { |
77 |
src_prepare() { |
77 |
unpack ${A} |
|
|
78 |
cd "${S}" |
79 |
|
80 |
sed -i -e "s:\$(doc_DATA)::" Makefile.in || die "Patching Makefile.in failed" |
78 |
sed -i -e "s:\$(doc_DATA)::" Makefile.in || die "Patching Makefile.in failed" |
81 |
sed -i -e "s/'skipstone']/'skipstone', 'epiphany']/" \ |
79 |
sed -i -e "s/'skipstone']/'skipstone', 'epiphany']/" \ |
82 |
-e "s/'skipstone': ''}/'skipstone': '', 'epiphany': '--new-window'}/" \ |
80 |
-e "s/'skipstone': ''}/'skipstone': '', 'epiphany': '--new-window'}/" \ |
Lines 95-122
Link Here
|
95 |
cp "${FILESDIR}"/70-hpmud.rules data/rules |
93 |
cp "${FILESDIR}"/70-hpmud.rules data/rules |
96 |
sed -i -e "s/55-hpmud.rules/70-hpmud.rules/g" Makefile.* */*.html || die "sed failed" |
94 |
sed -i -e "s/55-hpmud.rules/70-hpmud.rules/g" Makefile.* */*.html || die "sed failed" |
97 |
|
95 |
|
|
|
96 |
sed -i \ |
97 |
-e s:\/usr\/lib\/cups\/driver:$(cups-config --serverbin)\/driver:g \ |
98 |
installer/core_install.py || die "sed core_install.py" |
99 |
|
98 |
# Use system foomatic-rip instead of foomatic-rip-hplip |
100 |
# Use system foomatic-rip instead of foomatic-rip-hplip |
99 |
sed -i -e 's/foomatic-rip-hplip/foomatic-rip/' ppd/*.ppd || die "sed failed" |
101 |
local i |
|
|
102 |
for i in ppd/*.ppd.gz |
103 |
do |
104 |
rm -f ${i}.temp |
105 |
gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | gzip > ${i}.temp || die "*.ppd.gz sed failed" |
106 |
mv ${i}.temp ${i} |
107 |
done |
100 |
|
108 |
|
101 |
# Qt4 is still undocumented by upstream, so use with caution |
109 |
# Qt4 is still undocumented by upstream, so use with caution |
102 |
local QT_VER |
110 |
local qt_ver |
103 |
use qt4 && QT_VER="4" |
111 |
use qt3 && qt_ver="3" |
104 |
use qt3 && QT_VER="3" |
112 |
use qt4 && qt_ver="4" |
105 |
sed -i \ |
113 |
if use qt3 || use qt4 ; then |
106 |
-e "s/%s --force-startup/%s --force-startup --qt${QT_VER}/" \ |
114 |
sed -i \ |
107 |
-e "s/'--force-startup'/'--force-startup', '--qt${QT_VER}'/" \ |
115 |
-e "s/%s --force-startup/%s --force-startup --qt${qt_ver}/" \ |
108 |
base/device.py || die "sed failed" |
116 |
-e "s/'--force-startup'/'--force-startup', '--qt${qt_ver}'/" \ |
109 |
sed -i \ |
117 |
base/device.py || die "sed failed" |
110 |
-e "s/Exec=hp-systray/Exec=hp-systray --qt${QT_VER}/" \ |
118 |
sed -i \ |
111 |
hplip-systray.desktop.in || die "sed failed" |
119 |
-e "s/Exec=hp-systray/Exec=hp-systray --qt${qt_ver}/" \ |
|
|
120 |
hplip-systray.desktop.in || die "sed failed" |
121 |
fi |
112 |
} |
122 |
} |
113 |
|
123 |
|
114 |
src_compile() { |
124 |
src_configure() { |
115 |
if use qt3 || use qt4 ; then |
125 |
if use qt3 || use qt4 ; then |
116 |
local GUI_BUILD="--enable-gui-build" |
126 |
local gui_build="--enable-gui-build" |
117 |
else |
127 |
else |
118 |
local GUI_BUILD="--disable-gui-build" |
128 |
local gui_build="--disable-gui-build" |
119 |
fi |
129 |
fi |
|
|
130 |
use qt4 && gui_build="${gui_build} --enable-qt4 --disable-qt3" |
120 |
|
131 |
|
121 |
econf \ |
132 |
econf \ |
122 |
--disable-dependency-tracking \ |
133 |
--disable-dependency-tracking \ |
Lines 124-130
Link Here
|
124 |
--with-cupsbackenddir=$(cups-config --serverbin)/backend \ |
135 |
--with-cupsbackenddir=$(cups-config --serverbin)/backend \ |
125 |
--with-cupsfilterdir=$(cups-config --serverbin)/filter \ |
136 |
--with-cupsfilterdir=$(cups-config --serverbin)/filter \ |
126 |
--disable-foomatic-rip-hplip-install \ |
137 |
--disable-foomatic-rip-hplip-install \ |
127 |
${GUI_BUILD} \ |
138 |
${gui_build} \ |
128 |
$(use_enable doc doc-build) \ |
139 |
$(use_enable doc doc-build) \ |
129 |
$(use_enable cupsddk foomatic-drv-install) \ |
140 |
$(use_enable cupsddk foomatic-drv-install) \ |
130 |
$(use_enable dbus dbus-build) \ |
141 |
$(use_enable dbus dbus-build) \ |
Lines 133-162
Link Here
|
133 |
$(use_enable parport pp-build) \ |
144 |
$(use_enable parport pp-build) \ |
134 |
$(use_enable ppds foomatic-ppd-install) \ |
145 |
$(use_enable ppds foomatic-ppd-install) \ |
135 |
$(use_enable scanner scan-build) \ |
146 |
$(use_enable scanner scan-build) \ |
136 |
$(use_enable snmp network-build) \ |
147 |
$(use_enable snmp network-build) |
137 |
|| die "econf failed" |
|
|
138 |
emake || die "Compilation failed" |
139 |
} |
148 |
} |
140 |
|
149 |
|
141 |
src_install() { |
150 |
src_install() { |
142 |
emake -j1 DESTDIR="${D}" install || die "emake install failed" |
151 |
emake -j1 DESTDIR="${D}" install || die "emake install failed" |
143 |
rm -f "${D}"/etc/sane.d/dll.conf |
152 |
rm -f "${D}"/etc/sane.d/dll.conf |
144 |
|
153 |
|
145 |
# bug 106035 |
|
|
146 |
use qt3 || use qt4 || rm -Rf "${D}"/usr/share/applications |
147 |
|
148 |
use minimal && rm -rf "${D}"/usr/lib |
154 |
use minimal && rm -rf "${D}"/usr/lib |
|
|
155 |
|
156 |
# bug 237537 maybe it is safe to add this as this issue has been confirmed a few times |
157 |
use minimal || fperms 700 /usr/libexec/cups/backend/hp |
158 |
|
159 |
# bug 106035/259763 |
160 |
if use !qt3 && use !qt4 ; then |
161 |
rm -Rf "${D}"/usr/share/applications "${D}"/etc/xdg |
162 |
fi |
163 |
|
164 |
# kde3 autostart hack |
165 |
if [[ -d /usr/kde/3.5/share/autostart ]] && use !minimal ; then |
166 |
insinto /usr/kde/3.5/share/autostart |
167 |
doins hplip-systray.desktop |
168 |
fi |
169 |
|
170 |
# Do not install unzipped ppd files |
171 |
rm -f "${D}"/usr/share/ppd/HP/*.ppd |
149 |
} |
172 |
} |
150 |
|
173 |
|
151 |
pkg_preinst() { |
174 |
pkg_preinst() { |
152 |
# avoid collisions with cups-1.2 compat symlinks |
175 |
# avoid collisions with cups-1.2 compat symlinks |
153 |
if [ -e "${ROOT}"/usr/lib/cups/backend/hp ] && [ -e "${ROOT}"/usr/libexec/cups/backend/hp ]; then |
176 |
if [ -e "${ROOT}"/usr/lib/cups/backend/hp ] && [ -e "${ROOT}"/usr/libexec/cups/backend/hp ] ; then |
154 |
rm -f "${ROOT}"/usr/libexec/cups/backend/hp{,fax}; |
177 |
rm -f "${ROOT}"/usr/libexec/cups/backend/hp{,fax}; |
155 |
fi |
178 |
fi |
156 |
} |
179 |
} |
157 |
|
180 |
|
158 |
pkg_postinst() { |
181 |
pkg_postinst() { |
159 |
python_mod_optimize /usr/share/${PN} |
182 |
python_mod_optimize /usr/share/${PN} |
|
|
183 |
fdo-mime_desktop_database_update |
160 |
|
184 |
|
161 |
elog "You should run hp-setup as root if you are installing hplip for the first time, and may also" |
185 |
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." |
186 |
elog "need to run it if you are upgrading from an earlier version." |
Lines 169-172
Link Here
|
169 |
|
193 |
|
170 |
pkg_postrm() { |
194 |
pkg_postrm() { |
171 |
python_mod_cleanup /usr/share/${PN} |
195 |
python_mod_cleanup /usr/share/${PN} |
|
|
196 |
fdo-mime_desktop_database_update |
172 |
} |
197 |
} |