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 (-38 / +66 lines)
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
122
123
	# Upstream patch https://sourceforge.net/forum/forum.php?forum_id=928083
124
	epatch "${FILESDIR}"/${P}-high_cpu_utilization_logout.patch
112
}
125
}
113
126
114
src_compile() {
127
src_configure() {
115
	if use qt3 || use qt4 ; then
128
	if use qt3 || use qt4 ; then
116
		local GUI_BUILD="--enable-gui-build"
129
		local gui_build="--enable-gui-build"
117
	else
130
	else
118
		local GUI_BUILD="--disable-gui-build"
131
		local gui_build="--disable-gui-build"
119
	fi
132
	fi
133
	use qt4 && gui_build="${gui_build} --enable-qt4 --disable-qt3"
120
134
121
	econf \
135
	econf \
122
		--disable-dependency-tracking \
136
		--disable-dependency-tracking \
Lines 124-130 Link Here
124
		--with-cupsbackenddir=$(cups-config --serverbin)/backend \
138
		--with-cupsbackenddir=$(cups-config --serverbin)/backend \
125
		--with-cupsfilterdir=$(cups-config --serverbin)/filter \
139
		--with-cupsfilterdir=$(cups-config --serverbin)/filter \
126
		--disable-foomatic-rip-hplip-install \
140
		--disable-foomatic-rip-hplip-install \
127
		${GUI_BUILD} \
141
		${gui_build} \
128
		$(use_enable doc doc-build) \
142
		$(use_enable doc doc-build) \
129
		$(use_enable cupsddk foomatic-drv-install) \
143
		$(use_enable cupsddk foomatic-drv-install) \
130
		$(use_enable dbus dbus-build) \
144
		$(use_enable dbus dbus-build) \
Lines 133-162 Link Here
133
		$(use_enable parport pp-build) \
147
		$(use_enable parport pp-build) \
134
		$(use_enable ppds foomatic-ppd-install) \
148
		$(use_enable ppds foomatic-ppd-install) \
135
		$(use_enable scanner scan-build) \
149
		$(use_enable scanner scan-build) \
136
		$(use_enable snmp network-build) \
150
		$(use_enable snmp network-build)
137
		|| die "econf failed"
138
	emake || die "Compilation failed"
139
}
151
}
140
152
141
src_install() {
153
src_install() {
142
	emake -j1 DESTDIR="${D}" install || die "emake install failed"
154
	emake -j1 DESTDIR="${D}" install || die "emake install failed"
143
	rm -f "${D}"/etc/sane.d/dll.conf
155
	rm -f "${D}"/etc/sane.d/dll.conf
144
156
145
	# bug 106035
146
	use qt3 || use qt4 || rm -Rf "${D}"/usr/share/applications
147
148
	use minimal && rm -rf "${D}"/usr/lib
157
	use minimal && rm -rf "${D}"/usr/lib
158
159
	# bug 237537 maybe it is safe to add this as this issue has been confirmed a few times
160
	use minimal || fperms 700 /usr/libexec/cups/backend/hp
161
162
	# bug 106035/259763
163
	if use !qt3 && use !qt4 ; then
164
		rm -Rf "${D}"/usr/share/applications "${D}"/etc/xdg
165
	fi
166
167
	# kde3 autostart hack
168
	if [[ -d /usr/kde/3.5/share/autostart ]] && use !minimal ; then
169
		insinto /usr/kde/3.5/share/autostart
170
		doins hplip-systray.desktop
171
	fi
172
173
	# Do not install unzipped ppd files
174
	rm -f "${D}"/usr/share/ppd/HP/*.ppd
149
}
175
}
150
176
151
pkg_preinst() {
177
pkg_preinst() {
152
	# avoid collisions with cups-1.2 compat symlinks
178
	# 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
179
	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};
180
		rm -f "${ROOT}"/usr/libexec/cups/backend/hp{,fax};
155
	fi
181
	fi
156
}
182
}
157
183
158
pkg_postinst() {
184
pkg_postinst() {
159
	python_mod_optimize /usr/share/${PN}
185
	python_mod_optimize /usr/share/${PN}
186
	fdo-mime_desktop_database_update
160
187
161
	elog "You should run hp-setup as root if you are installing hplip for the first time, and may also"
188
	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."
189
	elog "need to run it if you are upgrading from an earlier version."
Lines 169-172 Link Here
169
196
170
pkg_postrm() {
197
pkg_postrm() {
171
	python_mod_cleanup /usr/share/${PN}
198
	python_mod_cleanup /usr/share/${PN}
199
	fdo-mime_desktop_database_update
172
}
200
}

Return to bug 245136