Gentoo Archives: gentoo-commits

From: Daniel Pielmeier <billie@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-print/hplip/
Date: Tue, 26 Sep 2017 18:35:10
Message-Id: 1506450729.aee9c29610403a1ab193b92be36a4153ea01e7ee.billie@gentoo
1 commit: aee9c29610403a1ab193b92be36a4153ea01e7ee
2 Author: Daniel Pielmeier <billie <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 26 18:32:09 2017 +0000
4 Commit: Daniel Pielmeier <billie <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 26 18:32:09 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aee9c296
7
8 net-print/hplip: Handle return value from gzip.GzipReadFile() properly.
9
10 This fixes bug 624458. Thanks to i <AT> jsteward.moe for the report and
11 nvinson234 <AT> gmail.com for the patch.
12
13 Package-Manager: Portage-2.3.8, Repoman-2.3.1
14
15 net-print/hplip/Manifest | 1 +
16 net-print/hplip/hplip-3.17.9-r1.ebuild | 254 +++++++++++++++++++++++++++++++++
17 2 files changed, 255 insertions(+)
18
19 diff --git a/net-print/hplip/Manifest b/net-print/hplip/Manifest
20 index fdf23434184..a78e0ffdbf8 100644
21 --- a/net-print/hplip/Manifest
22 +++ b/net-print/hplip/Manifest
23 @@ -3,4 +3,5 @@ DIST hplip-3.16.3.tar.gz 22408596 SHA256 42d2302ee38bda41caa0f2f9524a91f531e3aa4
24 DIST hplip-3.16.5-patches-1.tar.xz 8200 SHA256 98866e57a247e7a30d9cd584ed9411aa79a6185294a73b4cc5961efe9a5e5fa6 SHA512 36d33da5fc4105183cbc5137845ddccd8ab2b6abbff053a3a51f3da61c26c2d9d48dcb735345fb453abd67b6a0797aa337102c366cce037bc7006599b20b1646 WHIRLPOOL 8ac91bdefeb177c092b1d6de16474e8e1da57ad046dbc579f14fd40a27d1837d9bf142573137ef8d91c37dc7b03ca908fd5bfad23a9815af2015b521091c2700
25 DIST hplip-3.17.6.tar.gz 23620156 SHA256 80287834aad7e3fa30f2e252ff281d351e3f2eb15267ac541531353dc7b5107e SHA512 370fa0e07f4f5b4dc4a6f52b02271102894da98bc902912ff1770a9e5029d486227f4170ff90a063c686d23e8bd075961073ecc59961419a226a850db9e71738 WHIRLPOOL d938d36cba1c9d34e02709e75209a9c4e0bc7db0f7fbbb875bab41e57009a9522f12cf5bcfc03530d5ad46c2b2bb3575e68898e8071116a03240cd7042e4b2b0
26 DIST hplip-3.17.7.tar.gz 23644395 SHA256 3577bd5afd40b73fd754664ad69f0187dde2e64879e7446309f2ed9fd7dc400d SHA512 f88c16d5b6e1986df5b7c1081802ed4832849de8d8b01961231965b115731eb9bd5c18fa52d5bf2eb412927b9de0057bf8025a1579b053c4d8441f0ad4e7ce3f WHIRLPOOL 2e0f0743ffce6d66970815d621a55618a00c360f2f4aa31a1742fcd17ad246a2717f5507b1b4910a93ea5fc06b5d7e87dfb2f08c50993c85bb6a654d13faf527
27 +DIST hplip-3.17.9-patches-1.tar.xz 8484 SHA256 2ec368039a59e375bebf565bd679dd3bedb1e0c1ecfc103c5dcf9bb2701ba9d7 SHA512 125f9cfd1c3cad662ce33954b8ab9ab1898368b449c4ad78dfe99f29de8025183773272b9865cd22b976a30c502e38254ce0ac59d685299dff7f9314927d546a WHIRLPOOL 2354bd3b158733b668c731ea3fd605170dd4cc0df5ffebc327a69ad33995ec02166d34897567ed69d608a62e97b33bd12fc0066acb6c302677cc68830a2661cf
28 DIST hplip-3.17.9.tar.gz 23862533 SHA256 b2aad842f51dae7da2dd08d09ce2c27bc5f73c82a560b9494dd33589b0948678 SHA512 25508b91723be9564b9a7e8093159507a1a01a9e50e9e801f452f71c28cce0bddee2f5bf796214fa5752de8d1799fc6fe102779dabae0dbcba1f4de6b207c095 WHIRLPOOL df3bd0a8c4af9e7bf2a4ee534b317e84d89707587f770ab0c6ae98ccd5bea50d8be704ed2f855c9f67af8cdd34afc2ab0b07bd150f8861fc4900aa471a85b6ee
29
30 diff --git a/net-print/hplip/hplip-3.17.9-r1.ebuild b/net-print/hplip/hplip-3.17.9-r1.ebuild
31 new file mode 100644
32 index 00000000000..12247e7fa67
33 --- /dev/null
34 +++ b/net-print/hplip/hplip-3.17.9-r1.ebuild
35 @@ -0,0 +1,254 @@
36 +# Copyright 1999-2017 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
42 +PYTHON_REQ_USE="threads,xml"
43 +
44 +inherit autotools linux-info python-single-r1 readme.gentoo-r1 udev
45 +
46 +DESCRIPTION="HP Linux Imaging and Printing - Print, scan, fax drivers and service tools"
47 +HOMEPAGE="http://hplipopensource.com/hplip-web/index.html"
48 +SRC_URI="mirror://sourceforge/hplip/${P}.tar.gz
49 + https://dev.gentoo.org/~billie/distfiles/${PN}-3.17.9-patches-1.tar.xz"
50 +
51 +LICENSE="GPL-2"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
54 +
55 +IUSE="doc fax +hpcups hpijs kde libressl -libusb0 minimal parport policykit qt5 scanner +snmp static-ppds X"
56 +
57 +# dependency on dev-python/notify-python dropped due to python 3 incompatibility
58 +# possible replacement notify2 (https://pypi.python.org/pypi/notify2/0.3) not in tree
59 +
60 +COMMON_DEPEND="
61 + net-print/cups
62 + virtual/jpeg:0
63 + hpijs? ( net-print/cups-filters[foomatic] )
64 + !minimal? (
65 + ${PYTHON_DEPS}
66 + sys-apps/dbus
67 + !libusb0? ( virtual/libusb:1 )
68 + libusb0? ( virtual/libusb:0 )
69 + scanner? ( media-gfx/sane-backends )
70 + snmp? (
71 + !libressl? ( dev-libs/openssl:0= )
72 + libressl? ( dev-libs/libressl:= )
73 + net-analyzer/net-snmp
74 + )
75 + )
76 +"
77 +DEPEND="${COMMON_DEPEND}
78 + virtual/pkgconfig
79 +"
80 +RDEPEND="${COMMON_DEPEND}
81 + app-text/ghostscript-gpl
82 + !minimal? (
83 + >=dev-python/dbus-python-1.2.0-r1[${PYTHON_USEDEP}]
84 + $(python_gen_cond_dep 'dev-python/pygobject:2[${PYTHON_USEDEP}]' 'python2*')
85 + $(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]' 'python3*')
86 + fax? ( dev-python/reportlab[${PYTHON_USEDEP}] )
87 + kernel_linux? ( virtual/udev )
88 + qt5? ( >=dev-python/PyQt5-5.5.1[dbus,gui,widgets,${PYTHON_USEDEP}] )
89 + scanner? (
90 + >=dev-python/reportlab-3.2[${PYTHON_USEDEP}]
91 + >=dev-python/pillow-3.1.1[${PYTHON_USEDEP}]
92 + X? ( || (
93 + kde? ( kde-misc/skanlite )
94 + media-gfx/xsane
95 + media-gfx/sane-frontends
96 + ) )
97 + )
98 + )
99 + policykit? ( sys-auth/polkit )
100 +"
101 +
102 +REQUIRED_USE="!minimal? ( ${PYTHON_REQUIRED_USE} )"
103 +
104 +PATCHES=(
105 + "${WORKDIR}/patches"
106 +)
107 +
108 +CONFIG_CHECK="~PARPORT ~PPDEV"
109 +ERROR_PARPORT="Please make sure kernel parallel port support is enabled (PARPORT and PPDEV)."
110 +
111 +#DISABLE_AUTOFORMATTING="yes"
112 +DOC_CONTENTS="
113 +For more information on setting up your printer please take
114 +a look at the hplip section of the gentoo printing guide:
115 +https://wiki.gentoo.org/wiki/Printing
116 +
117 +Any user who wants to print must be in the lp group.
118 +"
119 +
120 +pkg_setup() {
121 + use !minimal && python-single-r1_pkg_setup
122 +
123 + use scanner && ! use X && ewarn "You need USE=X for the scanner GUI."
124 +
125 + if ! use hpcups && ! use hpijs ; then
126 + ewarn "Installing neither hpcups (USE=-hpcups) nor hpijs (USE=-hpijs) driver,"
127 + ewarn "which is probably not what you want."
128 + ewarn "You will almost certainly not be able to print."
129 + fi
130 +
131 + if use minimal ; then
132 + ewarn "Installing driver portions only, make sure you know what you are doing."
133 + ewarn "Depending on the USE flags set for hpcups or hpijs the appropiate driver"
134 + ewarn "is installed. If both USE flags are set hpijs overrides hpcups."
135 + else
136 + use parport && linux-info_pkg_setup
137 + fi
138 +}
139 +
140 +src_prepare() {
141 + default
142 +
143 + if use !minimal ; then
144 + python_export EPYTHON PYTHON
145 + python_fix_shebang .
146 + fi
147 +
148 + # Make desktop files follow the specification
149 + # Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=443680
150 + # Upstream bug: https://bugs.launchpad.net/hplip/+bug/1080324
151 + sed -i -e '/^Categories=/s/Application;//' \
152 + -e '/^Encoding=.*/d' hplip.desktop.in || die
153 + sed -i -e '/^Categories=/s/Application;//' \
154 + -e '/^Version=.*/d' \
155 + -e '/^Comment=.*/d' hplip-systray.desktop.in || die
156 +
157 + # Fix for Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=345725
158 + # Upstream bug: https://bugs.launchpad.net/hplip/+bug/880847,
159 + # https://bugs.launchpad.net/hplip/+bug/500086
160 + local udevdir=$(get_udevdir)
161 + sed -i -e "s|/etc/udev|${udevdir}|g" \
162 + $(find . -type f -exec grep -l /etc/udev {} +) || die
163 +
164 + # Force recognition of Gentoo distro by hp-check
165 + sed -i \
166 + -e "s:file('/etc/issue', 'r').read():'Gentoo':" \
167 + installer/core_install.py || die
168 +
169 + # Use system foomatic-rip for hpijs driver instead of foomatic-rip-hplip
170 + # The hpcups driver does not use foomatic-rip
171 + local i
172 + for i in ppd/hpijs/*.ppd.gz ; do
173 + rm -f ${i}.temp || die
174 + gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | \
175 + gzip > ${i}.temp || die
176 + mv ${i}.temp ${i} || die
177 + done
178 +
179 + eautoreconf
180 +}
181 +
182 +src_configure() {
183 + local myconf drv_build minimal_build
184 +
185 + if use libusb0 ; then
186 + myconf="${myconf} --enable-libusb01_build"
187 + else
188 + myconf="${myconf} --disable-libusb01_build"
189 + fi
190 +
191 + if use hpcups ; then
192 + drv_build="$(use_enable hpcups hpcups-install)"
193 + if use static-ppds ; then
194 + drv_build="${drv_build} --enable-cups-ppd-install"
195 + drv_build="${drv_build} --disable-cups-drv-install"
196 + else
197 + drv_build="${drv_build} --enable-cups-drv-install"
198 + drv_build="${drv_build} --disable-cups-ppd-install"
199 + fi
200 + else
201 + drv_build="--disable-hpcups-install"
202 + drv_build="${drv_build} --disable-cups-drv-install"
203 + drv_build="${drv_build} --disable-cups-ppd-install"
204 + fi
205 +
206 + if use hpijs ; then
207 + drv_build="${drv_build} $(use_enable hpijs hpijs-install)"
208 + if use static-ppds ; then
209 + drv_build="${drv_build} --enable-foomatic-ppd-install"
210 + drv_build="${drv_build} --disable-foomatic-drv-install"
211 + else
212 + drv_build="${drv_build} --enable-foomatic-drv-install"
213 + drv_build="${drv_build} --disable-foomatic-ppd-install"
214 + fi
215 + else
216 + drv_build="${drv_build} --disable-hpijs-install"
217 + drv_build="${drv_build} --disable-foomatic-drv-install"
218 + drv_build="${drv_build} --disable-foomatic-ppd-install"
219 + fi
220 +
221 + if use minimal ; then
222 + if use hpijs ; then
223 + minimal_build="--enable-hpijs-only-build"
224 + else
225 + minimal_build="--disable-hpijs-only-build"
226 + fi
227 + if use hpcups ; then
228 + minimal_build="${minimal_build} --enable-hpcups-only-build"
229 + else
230 + minimal_build="${minimal_build} --disable-hpcups-only-build"
231 + fi
232 + fi
233 +
234 + econf \
235 + --disable-cups11-build \
236 + --disable-lite-build \
237 + --disable-foomatic-rip-hplip-install \
238 + --disable-shadow-build \
239 + --disable-qt3 \
240 + --disable-qt4 \
241 + --disable-udev_sysfs_rules \
242 + --with-cupsbackenddir=$(cups-config --serverbin)/backend \
243 + --with-cupsfilterdir=$(cups-config --serverbin)/filter \
244 + --with-docdir=/usr/share/doc/${PF} \
245 + --with-htmldir=/usr/share/doc/${PF}/html \
246 + ${myconf} \
247 + ${drv_build} \
248 + ${minimal_build} \
249 + $(use_enable doc doc-build) \
250 + $(use_enable fax fax-build) \
251 + $(use_enable !minimal gui-build) \
252 + $(use_enable !minimal dbus-build) \
253 + $(use_enable parport pp-build) \
254 + $(use_enable policykit) \
255 + $(use_enable qt5) \
256 + $(use_enable scanner scan-build) \
257 + $(use_enable snmp network-build)
258 +}
259 +
260 +src_install() {
261 + # disable parallel install
262 + # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=578018
263 + emake -j1 DESTDIR="${D}" install
264 + einstalldocs
265 + # default
266 +
267 + # Installed by sane-backends
268 + # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=201023
269 + rm -f "${ED%/}"/etc/sane.d/dll.conf || die
270 +
271 + rm -f "${ED%/}"/usr/share/doc/${PF}/{copyright,README_LIBJPG,COPYING} || die
272 + rmdir --ignore-fail-on-non-empty "${ED%/}"/usr/share/doc/${PF}/ || die
273 +
274 + # Remove hal fdi files
275 + rm -rf "${ED%/}"/usr/share/hal || die
276 +
277 + find "${D}" -name '*.la' -delete || die
278 +
279 + if use !minimal ; then
280 + python_export EPYTHON PYTHON
281 + python_optimize "${ED%/}"/usr/share/hplip
282 + fi
283 +
284 + readme.gentoo_create_doc
285 +}
286 +
287 +pkg_postinst() {
288 + readme.gentoo_print_elog
289 +}