Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 245136 | Differences between
and this patch

Collapse All | Expand All

(-)hplip-2.8.7.ebuild (-14 / +103 lines)
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-103 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
99
	sed -i -e 's/foomatic-rip-hplip/foomatic-rip/' ppd/*.ppd || die "sed failed"
100
101
	# Qt4 is still undocumented by upstream, so use with caution
117
	# Qt4 is still undocumented by upstream, so use with caution
102
	local QT_VER
118
	local QT_VER
103
	use qt4 && QT_VER="4"
119
	use qt4 && QT_VER="4"
Lines 118-125 Link Here
118
		local GUI_BUILD="--disable-gui-build"
134
		local GUI_BUILD="--disable-gui-build"
119
	fi
135
	fi
120
136
137
	use qt4 && GUI_BUILD="$GUI_BUILD --enable-qt4 --disable-qt3"
138
121
	econf \
139
	econf \
122
		--disable-dependency-tracking \
140
		--enable-dependency-tracking \
123
		--disable-cups11-build \
141
		--disable-cups11-build \
124
		--with-cupsbackenddir=$(cups-config --serverbin)/backend \
142
		--with-cupsbackenddir=$(cups-config --serverbin)/backend \
125
		--with-cupsfilterdir=$(cups-config --serverbin)/filter \
143
		--with-cupsfilterdir=$(cups-config --serverbin)/filter \
Lines 134-151 Link Here
134
		$(use_enable ppds foomatic-ppd-install) \
152
		$(use_enable ppds foomatic-ppd-install) \
135
		$(use_enable scanner scan-build) \
153
		$(use_enable scanner scan-build) \
136
		$(use_enable snmp network-build) \
154
		$(use_enable snmp network-build) \
155
		--with-systraydir=/usr/share/autostart \
137
		|| die "econf failed"
156
		|| die "econf failed"
138
	emake || die "Compilation failed"
157
	emake || die "Compilation failed"
139
}
158
}
140
159
141
src_install() {
160
src_install() {
142
	emake -j1 DESTDIR="${D}" install || die "emake install failed"
161
	replace-flags "-j?" "-j1"
162
	emake DESTDIR="${D}" install || die "emake install failed"
143
	rm -f "${D}"/etc/sane.d/dll.conf
163
	rm -f "${D}"/etc/sane.d/dll.conf
144
164
165
	# Use system foomatic-rip instead of foomatic-rip-hplip
166
	local i
167
	for i in "${D}"usr/share/ppd/HP/*.ppd
168
	do
169
	    sed -i -e "s/foomatic-rip-hplip/foomatic-rip/g" $i || die "*.ppd sed failed"
170
	    rm -f $i.gz
171
	done
172
173
	if use plugins; then
174
	    sed -i -e "s:SYSFS:ATTRS:g" "${WORKDIR}"/plugins/*.rules || die "sed failed"
175
176
	    insinto /etc/udev/rules.d
177
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1000.rules
178
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1005_series.rules
179
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1018.rules
180
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_1020.rules
181
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1005.rules
182
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1006.rules
183
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1007.rules
184
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1008.rules
185
	    doins "${WORKDIR}"/plugins/86-hpmud-hp_laserjet_p1505.rules
186
187
	    # detect ARCH variable
188
	    if [[ "${ARCH}" == "amd64" ]] ; then
189
		arch_var="64"
190
	    else
191
		arch_var="32"
192
	    fi
193
	    cd "${D}"/usr/lib
194
	    dodir /usr/share/hplip/scan/plugins
195
	    dolib.so "${WORKDIR}"/plugins/bb_marvell-x86_"${arch_var}".so
196
	    ln -s bb_marvell-x86_"${arch_var}".so bb_marvell.so
197
	    dosym /usr/lib/bb_marvell-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_marvell.so
198
	    dosym /usr/lib/bb_marvell-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_marvell-x86_"${arch_var}".so
199
	    dolib.so "${WORKDIR}"/plugins/bb_soap-x86_"${arch_var}".so
200
	    ln -s bb_soap-x86_"${arch_var}".so bb_soap.so
201
	    dosym /usr/lib/bb_soap-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soap.so
202
	    dosym /usr/lib/bb_soap-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soap-x86_"${arch_var}".so
203
	    dolib.so "${WORKDIR}"/plugins/bb_soapht-x86_"${arch_var}".so
204
	    ln -s bb_soapht-x86_"${arch_var}".so bb_soapht.so
205
	    dosym /usr/lib/bb_soapht-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soapht.so
206
	    dosym /usr/lib/bb_soapht-x86_"${arch_var}".so /usr/share/hplip/scan/plugins/bb_soapht-x86_"${arch_var}".so
207
	    dodir /usr/share/hplip/prnt/plugins
208
	    dolib.so "${WORKDIR}"/plugins/lj-x86_"${arch_var}".so
209
	    ln -s lj-x86_"${arch_var}".so lj.so
210
	    dosym /usr/lib/lj-x86_"${arch_var}".so /usr/share/hplip/prnt/plugins/lj.so
211
	    dosym /usr/lib/lj-x86_"${arch_var}".so /usr/share/hplip/prnt/plugins/lj-x86_"${arch_var}".so
212
213
	    dodir /usr/share/hplip/data/plugins
214
	    insinto /usr/share/hplip/data/plugins
215
	    doins "${WORKDIR}"/plugins/license.txt
216
217
	    dodir /usr/share/hplip/data/firmware
218
	    insinto /usr/share/hplip/data/firmware
219
	    doins "${WORKDIR}"/plugins/hp_laserjet_1000.fw.gz
220
	    doins "${WORKDIR}"/plugins/hp_laserjet_1005_series.fw.gz
221
	    doins "${WORKDIR}"/plugins/hp_laserjet_1018.fw.gz
222
	    doins "${WORKDIR}"/plugins/hp_laserjet_1020.fw.gz
223
	    doins "${WORKDIR}"/plugins/hp_laserjet_p1005.fw.gz
224
	    doins "${WORKDIR}"/plugins/hp_laserjet_p1006.fw.gz
225
	    doins "${WORKDIR}"/plugins/hp_laserjet_p1007.fw.gz
226
	    doins "${WORKDIR}"/plugins/hp_laserjet_p1008.fw.gz
227
	    doins "${WORKDIR}"/plugins/hp_laserjet_p1505.fw.gz
228
	    sed -i -e "s:version\=\(.*\):version\=\1\nplugin\=1:" "${D}"/etc/hp/hplip.conf || die "sed failed"
229
	fi
230
145
	# bug 106035
231
	# bug 106035
146
	use qt3 || use qt4 || rm -Rf "${D}"/usr/share/applications
232
	use qt3 || use qt4 || rm -Rf "${D}"/usr/share/applications
147
233
148
	use minimal && rm -rf "${D}"/usr/lib
234
	use minimal && rm -rf "${D}"/usr/lib
235
149
}
236
}
150
237
151
pkg_preinst() {
238
pkg_preinst() {
Lines 157-162 Link Here
157
244
158
pkg_postinst() {
245
pkg_postinst() {
159
	python_mod_optimize /usr/share/${PN}
246
	python_mod_optimize /usr/share/${PN}
247
	fdo-mime_desktop_database_update
160
248
161
	elog "You should run hp-setup as root if you are installing hplip for the first time, and may also"
249
	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."
250
	elog "need to run it if you are upgrading from an earlier version."
Lines 169-172 Link Here
169
257
170
pkg_postrm() {
258
pkg_postrm() {
171
	python_mod_cleanup /usr/share/${PN}
259
	python_mod_cleanup /usr/share/${PN}
260
	fdo-mime_desktop_database_update
172
}
261
}

Return to bug 245136