1 |
commit: cf91e550fe6c0291c39179dc3eb044b2a81af183 |
2 |
Author: Austin English <wizardedit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 26 21:07:42 2016 +0000 |
4 |
Commit: Austin English <wizardedit <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 26 22:26:32 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf91e550 |
7 |
|
8 |
media-gfx/sane-backends: use #!/sbin/openrc-run instead of #!/sbin/runscript |
9 |
|
10 |
Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=573846 |
11 |
|
12 |
Package-Manager: portage-2.2.26 |
13 |
|
14 |
media-gfx/sane-backends/files/saned.initd | 4 +- |
15 |
.../sane-backends/sane-backends-1.0.24-r6.ebuild | 329 +++++++++++++++++++ |
16 |
.../sane-backends/sane-backends-1.0.25-r1.ebuild | 347 +++++++++++++++++++++ |
17 |
3 files changed, 678 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/media-gfx/sane-backends/files/saned.initd b/media-gfx/sane-backends/files/saned.initd |
20 |
index dd07f0a..3431cb5 100644 |
21 |
--- a/media-gfx/sane-backends/files/saned.initd |
22 |
+++ b/media-gfx/sane-backends/files/saned.initd |
23 |
@@ -1,5 +1,5 @@ |
24 |
-#!/sbin/runscript |
25 |
-# Copyright 1999-2013 Gentoo Foundation |
26 |
+#!/sbin/openrc-run |
27 |
+# Copyright 1999-2016 Gentoo Foundation |
28 |
# Distributed under the terms of the GNU General Public License v2 |
29 |
# $Id$ |
30 |
|
31 |
|
32 |
diff --git a/media-gfx/sane-backends/sane-backends-1.0.24-r6.ebuild b/media-gfx/sane-backends/sane-backends-1.0.24-r6.ebuild |
33 |
new file mode 100644 |
34 |
index 0000000..83a7cb4 |
35 |
--- /dev/null |
36 |
+++ b/media-gfx/sane-backends/sane-backends-1.0.24-r6.ebuild |
37 |
@@ -0,0 +1,329 @@ |
38 |
+# Copyright 1999-2016 Gentoo Foundation |
39 |
+# Distributed under the terms of the GNU General Public License v2 |
40 |
+# $Id$ |
41 |
+ |
42 |
+EAPI="5" |
43 |
+ |
44 |
+inherit autotools eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs |
45 |
+ |
46 |
+# gphoto and v4l are handled by their usual USE flags. |
47 |
+# The pint backend was disabled because I could not get it to compile. |
48 |
+IUSE_SANE_BACKENDS=" |
49 |
+ abaton |
50 |
+ agfafocus |
51 |
+ apple |
52 |
+ artec |
53 |
+ artec_eplus48u |
54 |
+ as6e |
55 |
+ avision |
56 |
+ bh |
57 |
+ canon |
58 |
+ canon630u |
59 |
+ canon_dr |
60 |
+ canon_pp |
61 |
+ cardscan |
62 |
+ coolscan |
63 |
+ coolscan2 |
64 |
+ coolscan3 |
65 |
+ dc210 |
66 |
+ dc240 |
67 |
+ dc25 |
68 |
+ dell1600n_net |
69 |
+ dmc |
70 |
+ epjitsu |
71 |
+ epson |
72 |
+ epson2 |
73 |
+ fujitsu |
74 |
+ genesys |
75 |
+ gt68xx |
76 |
+ hp |
77 |
+ hp3500 |
78 |
+ hp3900 |
79 |
+ hp4200 |
80 |
+ hp5400 |
81 |
+ hp5590 |
82 |
+ hpljm1005 |
83 |
+ hpsj5s |
84 |
+ hs2p |
85 |
+ ibm |
86 |
+ kodak |
87 |
+ kodakaio |
88 |
+ kvs1025 |
89 |
+ kvs20xx |
90 |
+ kvs40xx |
91 |
+ leo |
92 |
+ lexmark |
93 |
+ ma1509 |
94 |
+ magicolor |
95 |
+ matsushita |
96 |
+ microtek |
97 |
+ microtek2 |
98 |
+ mustek |
99 |
+ mustek_pp |
100 |
+ mustek_usb |
101 |
+ mustek_usb2 |
102 |
+ nec |
103 |
+ net |
104 |
+ niash |
105 |
+ p5 |
106 |
+ pie |
107 |
+ pixma |
108 |
+ plustek |
109 |
+ plustek_pp |
110 |
+ pnm |
111 |
+ qcam |
112 |
+ ricoh |
113 |
+ rts8891 |
114 |
+ s9036 |
115 |
+ sceptre |
116 |
+ sharp |
117 |
+ sm3600 |
118 |
+ sm3840 |
119 |
+ snapscan |
120 |
+ sp15c |
121 |
+ st400 |
122 |
+ stv680 |
123 |
+ tamarack |
124 |
+ teco1 |
125 |
+ teco2 |
126 |
+ teco3 |
127 |
+ test |
128 |
+ u12 |
129 |
+ umax |
130 |
+ umax1220u |
131 |
+ umax_pp |
132 |
+ xerox_mfp" |
133 |
+ |
134 |
+IUSE="avahi doc gphoto2 ipv6 threads usb v4l xinetd snmp systemd" |
135 |
+ |
136 |
+for backend in ${IUSE_SANE_BACKENDS}; do |
137 |
+ case ${backend} in |
138 |
+ # Disable backends that require parallel ports as no one has those anymore. |
139 |
+ canon_pp|hpsj5s|mustek_pp|\ |
140 |
+ pnm) |
141 |
+ IUSE+=" -sane_backends_${backend}" |
142 |
+ ;; |
143 |
+ mustek_usb2|kvs40xx) |
144 |
+ IUSE+=" sane_backends_${backend}" |
145 |
+ ;; |
146 |
+ *) |
147 |
+ IUSE+=" +sane_backends_${backend}" |
148 |
+ esac |
149 |
+done |
150 |
+ |
151 |
+REQUIRED_USE=" |
152 |
+ sane_backends_mustek_usb2? ( threads ) |
153 |
+ sane_backends_kvs40xx? ( threads ) |
154 |
+" |
155 |
+ |
156 |
+DESCRIPTION="Scanner Access Now Easy - Backends" |
157 |
+HOMEPAGE="http://www.sane-project.org/" |
158 |
+SRC_URI="https://alioth.debian.org/frs/download.php/file/3958/${P}.tar.gz" |
159 |
+ |
160 |
+LICENSE="GPL-2 public-domain" |
161 |
+SLOT="0" |
162 |
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux" |
163 |
+ |
164 |
+RDEPEND=" |
165 |
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] ) |
166 |
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] ) |
167 |
+ sane_backends_dell1600n_net? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] |
168 |
+ >=media-libs/tiff-3.9.7-r1[${MULTILIB_USEDEP}] ) |
169 |
+ avahi? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] ) |
170 |
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
171 |
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
172 |
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
173 |
+ usb? ( >=virtual/libusb-1-r1:1[${MULTILIB_USEDEP}] ) |
174 |
+ gphoto2? ( |
175 |
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}] |
176 |
+ >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] |
177 |
+ ) |
178 |
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] ) |
179 |
+ xinetd? ( sys-apps/xinetd ) |
180 |
+ snmp? ( net-analyzer/net-snmp ) |
181 |
+ systemd? ( sys-apps/systemd:0= ) |
182 |
+" |
183 |
+ |
184 |
+DEPEND="${RDEPEND} |
185 |
+ v4l? ( sys-kernel/linux-headers ) |
186 |
+ doc? ( |
187 |
+ virtual/latex-base |
188 |
+ dev-texlive/texlive-latexextra |
189 |
+ ) |
190 |
+ >=sys-apps/sed-4 |
191 |
+ |
192 |
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]" |
193 |
+ |
194 |
+# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device) |
195 |
+RDEPEND="${RDEPEND} |
196 |
+ !<sys-fs/udev-114 |
197 |
+ abi_x86_32? ( |
198 |
+ !<=app-emulation/emul-linux-x86-medialibs-20140508 |
199 |
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] |
200 |
+ )" |
201 |
+ |
202 |
+MULTILIB_CHOST_TOOLS=( |
203 |
+ /usr/bin/sane-config |
204 |
+) |
205 |
+ |
206 |
+pkg_setup() { |
207 |
+ enewgroup scanner |
208 |
+ enewuser saned -1 -1 -1 scanner |
209 |
+} |
210 |
+ |
211 |
+src_prepare() { |
212 |
+ cat >> backend/dll.conf.in <<-EOF |
213 |
+ # Add support for the HP-specific backend. Needs net-print/hplip installed. |
214 |
+ hpaio |
215 |
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed. |
216 |
+ epkowa |
217 |
+ EOF |
218 |
+ epatch "${FILESDIR}"/niash_array_index.patch \ |
219 |
+ "${FILESDIR}"/${P}-unused-cups.patch \ |
220 |
+ "${FILESDIR}"/${P}-automagic_systemd.patch \ |
221 |
+ "${FILESDIR}"/${P}-systemd_pkgconfig.patch \ |
222 |
+ "${FILESDIR}"/${P}-kodakaio_avahi.patch \ |
223 |
+ "${FILESDIR}"/${P}-saned_pidfile_location.patch \ |
224 |
+ "${FILESDIR}"/${P}-cross-compile.patch |
225 |
+ # Fix for "make check". |
226 |
+ sed -i -e 's/sane-backends 1.0.24git/sane-backends 1.0.24/' testsuite/tools/data/html* |
227 |
+ AT_NOELIBTOOLIZE=yes eautoreconf |
228 |
+} |
229 |
+ |
230 |
+src_configure() { |
231 |
+ append-flags -fno-strict-aliasing |
232 |
+ |
233 |
+ multilib-minimal_src_configure |
234 |
+} |
235 |
+ |
236 |
+multilib_src_configure() { |
237 |
+ # the blank is intended - an empty string would result in building ALL backends. |
238 |
+ local BACKENDS=" " |
239 |
+ |
240 |
+ use gphoto2 && BACKENDS="gphoto2" |
241 |
+ use v4l && BACKENDS="${BACKENDS} v4l" |
242 |
+ for backend in ${IUSE_SANE_BACKENDS}; do |
243 |
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then |
244 |
+ BACKENDS="${BACKENDS} ${backend}" |
245 |
+ fi |
246 |
+ done |
247 |
+ |
248 |
+ local myconf=( |
249 |
+ $(use_enable usb libusb_1_0) |
250 |
+ $(multilib_native_use_with snmp) |
251 |
+ ) |
252 |
+ |
253 |
+ # you can only enable this backend, not disable it... |
254 |
+ if use sane_backends_pnm; then |
255 |
+ myconf+=( --enable-pnm-backend ) |
256 |
+ fi |
257 |
+ if ! use doc; then |
258 |
+ myconf+=( --disable-latex ) |
259 |
+ fi |
260 |
+ if use sane_backends_mustek_pp; then |
261 |
+ myconf+=( --enable-parport-directio ) |
262 |
+ fi |
263 |
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then |
264 |
+ myconf+=( sane_cv_use_libieee1284=no ) |
265 |
+ fi |
266 |
+ # if LINGUAS is set, just use the listed and supported localizations. |
267 |
+ if [ "${LINGUAS-NoLocalesSet}" != NoLocalesSet ]; then |
268 |
+ mkdir -p po || die |
269 |
+ echo > po/LINGUAS |
270 |
+ for lang in ${LINGUAS}; do |
271 |
+ if [ -a "${S}"/po/${lang}.po ]; then |
272 |
+ echo ${lang} >> po/LINGUAS |
273 |
+ fi |
274 |
+ done |
275 |
+ fi |
276 |
+ |
277 |
+ # relative path must be used for tests to work properly |
278 |
+ ECONF_SOURCE=../${P} \ |
279 |
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \ |
280 |
+ BACKENDS="${BACKENDS}" \ |
281 |
+ econf \ |
282 |
+ $(use_with gphoto2) \ |
283 |
+ $(multilib_native_use_with systemd) \ |
284 |
+ $(use_with v4l) \ |
285 |
+ $(use_enable avahi) \ |
286 |
+ $(use_enable ipv6) \ |
287 |
+ $(use_enable threads pthread) \ |
288 |
+ "${myconf[@]}" |
289 |
+} |
290 |
+ |
291 |
+multilib_src_compile() { |
292 |
+ emake VARTEXFONTS="${T}/fonts" |
293 |
+ |
294 |
+ if use usb; then |
295 |
+ cd tools/hotplug || die |
296 |
+ sed -i -e '/^$/d' libsane.usermap || die |
297 |
+ fi |
298 |
+ |
299 |
+ if tc-is-cross-compiler; then |
300 |
+ # The build system sucks and doesn't handle this properly. |
301 |
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366 |
302 |
+ tc-export_build_env BUILD_CC |
303 |
+ cd "${BUILD_DIR}"/tools || die |
304 |
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} -I. -I../include -I"${S}"/include \ |
305 |
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \ |
306 |
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die |
307 |
+ local dirs=( hal hotplug hotplug-ng udev ) |
308 |
+ local targets=( |
309 |
+ hal/libsane.fdi |
310 |
+ hotplug/libsane.usermap |
311 |
+ hotplug-ng/libsane.db |
312 |
+ udev/libsane.rules |
313 |
+ ) |
314 |
+ mkdir -p "${dirs[@]}" || die |
315 |
+ emake "${targets[@]}" |
316 |
+ fi |
317 |
+} |
318 |
+ |
319 |
+multilib_src_install() { |
320 |
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \ |
321 |
+ docdir="${EPREFIX}"/usr/share/doc/${PF} |
322 |
+ |
323 |
+ if multilib_is_native_abi; then |
324 |
+ if use usb; then |
325 |
+ insinto /etc/hotplug/usb |
326 |
+ doins tools/hotplug/libsane.usermap |
327 |
+ fi |
328 |
+ |
329 |
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules |
330 |
+ insinto "/usr/share/pkgconfig" |
331 |
+ doins tools/sane-backends.pc |
332 |
+ fi |
333 |
+} |
334 |
+ |
335 |
+multilib_src_install_all() { |
336 |
+ keepdir /var/lib/lock/sane |
337 |
+ fowners root:scanner /var/lib/lock/sane |
338 |
+ fperms g+w /var/lib/lock/sane |
339 |
+ dodir /etc/env.d |
340 |
+ |
341 |
+ if use usb; then |
342 |
+ exeinto /etc/hotplug/usb |
343 |
+ doexe tools/hotplug/libusbscanner |
344 |
+ newdoc tools/hotplug/README README.hotplug |
345 |
+ fi |
346 |
+ |
347 |
+ dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux |
348 |
+ prune_libtool_files --all |
349 |
+ if use xinetd; then |
350 |
+ insinto /etc/xinetd.d |
351 |
+ doins "${FILESDIR}"/saned |
352 |
+ fi |
353 |
+ |
354 |
+ newinitd "${FILESDIR}"/saned.initd saned |
355 |
+ newconfd "${FILESDIR}"/saned.confd saned |
356 |
+} |
357 |
+ |
358 |
+pkg_postinst() { |
359 |
+ if use xinetd; then |
360 |
+ elog "If you want remote clients to connect, edit" |
361 |
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow" |
362 |
+ fi |
363 |
+ |
364 |
+ elog "If you are using a USB scanner, add all users who want" |
365 |
+ elog "to access your scanner to the \"scanner\" group." |
366 |
+} |
367 |
|
368 |
diff --git a/media-gfx/sane-backends/sane-backends-1.0.25-r1.ebuild b/media-gfx/sane-backends/sane-backends-1.0.25-r1.ebuild |
369 |
new file mode 100644 |
370 |
index 0000000..0fa014d |
371 |
--- /dev/null |
372 |
+++ b/media-gfx/sane-backends/sane-backends-1.0.25-r1.ebuild |
373 |
@@ -0,0 +1,347 @@ |
374 |
+# Copyright 1999-2016 Gentoo Foundation |
375 |
+# Distributed under the terms of the GNU General Public License v2 |
376 |
+# $Id$ |
377 |
+ |
378 |
+EAPI="5" |
379 |
+ |
380 |
+inherit eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs |
381 |
+ |
382 |
+# gphoto and v4l are handled by their usual USE flags. |
383 |
+# The pint backend was disabled because I could not get it to compile. |
384 |
+IUSE_SANE_BACKENDS=" |
385 |
+ abaton |
386 |
+ agfafocus |
387 |
+ apple |
388 |
+ artec |
389 |
+ artec_eplus48u |
390 |
+ as6e |
391 |
+ avision |
392 |
+ bh |
393 |
+ canon |
394 |
+ canon630u |
395 |
+ canon_dr |
396 |
+ canon_pp |
397 |
+ cardscan |
398 |
+ coolscan |
399 |
+ coolscan2 |
400 |
+ coolscan3 |
401 |
+ dc210 |
402 |
+ dc240 |
403 |
+ dc25 |
404 |
+ dell1600n_net |
405 |
+ dmc |
406 |
+ epjitsu |
407 |
+ epson |
408 |
+ epson2 |
409 |
+ fujitsu |
410 |
+ genesys |
411 |
+ gt68xx |
412 |
+ hp |
413 |
+ hp3500 |
414 |
+ hp3900 |
415 |
+ hp4200 |
416 |
+ hp5400 |
417 |
+ hp5590 |
418 |
+ hpljm1005 |
419 |
+ hpsj5s |
420 |
+ hs2p |
421 |
+ ibm |
422 |
+ kodak |
423 |
+ kodakaio |
424 |
+ kvs1025 |
425 |
+ kvs20xx |
426 |
+ kvs40xx |
427 |
+ leo |
428 |
+ lexmark |
429 |
+ ma1509 |
430 |
+ magicolor |
431 |
+ matsushita |
432 |
+ microtek |
433 |
+ microtek2 |
434 |
+ mustek |
435 |
+ mustek_pp |
436 |
+ mustek_usb |
437 |
+ mustek_usb2 |
438 |
+ nec |
439 |
+ net |
440 |
+ niash |
441 |
+ p5 |
442 |
+ pie |
443 |
+ pixma |
444 |
+ plustek |
445 |
+ plustek_pp |
446 |
+ pnm |
447 |
+ qcam |
448 |
+ ricoh |
449 |
+ rts8891 |
450 |
+ s9036 |
451 |
+ sceptre |
452 |
+ sharp |
453 |
+ sm3600 |
454 |
+ sm3840 |
455 |
+ snapscan |
456 |
+ sp15c |
457 |
+ st400 |
458 |
+ stv680 |
459 |
+ tamarack |
460 |
+ teco1 |
461 |
+ teco2 |
462 |
+ teco3 |
463 |
+ test |
464 |
+ u12 |
465 |
+ umax |
466 |
+ umax1220u |
467 |
+ umax_pp |
468 |
+ xerox_mfp" |
469 |
+ |
470 |
+IUSE="avahi doc gphoto2 ipv6 nls snmp systemd threads usb v4l xinetd" |
471 |
+ |
472 |
+for backend in ${IUSE_SANE_BACKENDS}; do |
473 |
+ case ${backend} in |
474 |
+ # Disable backends that require parallel ports as no one has those anymore. |
475 |
+ canon_pp|hpsj5s|mustek_pp|\ |
476 |
+ pnm) |
477 |
+ IUSE+=" -sane_backends_${backend}" |
478 |
+ ;; |
479 |
+ mustek_usb2|kvs40xx) |
480 |
+ IUSE+=" sane_backends_${backend}" |
481 |
+ ;; |
482 |
+ *) |
483 |
+ IUSE+=" +sane_backends_${backend}" |
484 |
+ esac |
485 |
+done |
486 |
+ |
487 |
+REQUIRED_USE=" |
488 |
+ sane_backends_mustek_usb2? ( threads ) |
489 |
+ sane_backends_kvs40xx? ( threads ) |
490 |
+" |
491 |
+ |
492 |
+DESCRIPTION="Scanner Access Now Easy - Backends" |
493 |
+HOMEPAGE="http://www.sane-project.org/" |
494 |
+case ${PV} in |
495 |
+9999) |
496 |
+ EGIT_REPO_URI="git://anonscm.debian.org/sane/sane-backends.git" |
497 |
+ inherit git-r3 autotools |
498 |
+ ;; |
499 |
+*_pre*) |
500 |
+ MY_P="${PN}-git${PV#*_pre}" |
501 |
+ SRC_URI="http://www.sane-project.org/snapshots/${MY_P}.tar.gz |
502 |
+ mirror://gentoo/${MY_P}.tar.gz" |
503 |
+ S=${WORKDIR}/${MY_P} |
504 |
+ ;; |
505 |
+*) |
506 |
+ MY_P=${P} |
507 |
+ FRS_ID="4146" |
508 |
+ SRC_URI="https://alioth.debian.org/frs/download.php/file/${FRS_ID}/${P}.tar.gz" |
509 |
+ ;; |
510 |
+esac |
511 |
+ |
512 |
+LICENSE="GPL-2 public-domain" |
513 |
+SLOT="0" |
514 |
+if [[ ${PV} != "9999" ]] ; then |
515 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" |
516 |
+fi |
517 |
+ |
518 |
+RDEPEND=" |
519 |
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] ) |
520 |
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] ) |
521 |
+ sane_backends_dell1600n_net? ( |
522 |
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] |
523 |
+ >=media-libs/tiff-3.9.7-r1:0=[${MULTILIB_USEDEP}] |
524 |
+ ) |
525 |
+ avahi? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] ) |
526 |
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
527 |
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
528 |
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
529 |
+ usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] ) |
530 |
+ gphoto2? ( |
531 |
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}] |
532 |
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] |
533 |
+ ) |
534 |
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] ) |
535 |
+ xinetd? ( sys-apps/xinetd ) |
536 |
+ snmp? ( net-analyzer/net-snmp ) |
537 |
+ systemd? ( sys-apps/systemd:0= ) |
538 |
+" |
539 |
+ |
540 |
+DEPEND="${RDEPEND} |
541 |
+ v4l? ( sys-kernel/linux-headers ) |
542 |
+ doc? ( |
543 |
+ virtual/latex-base |
544 |
+ dev-texlive/texlive-latexextra |
545 |
+ ) |
546 |
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]" |
547 |
+ |
548 |
+# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device) |
549 |
+RDEPEND="${RDEPEND} |
550 |
+ !<sys-fs/udev-114" |
551 |
+ |
552 |
+MULTILIB_CHOST_TOOLS=( |
553 |
+ /usr/bin/sane-config |
554 |
+) |
555 |
+ |
556 |
+pkg_setup() { |
557 |
+ enewgroup scanner |
558 |
+ enewuser saned -1 -1 -1 scanner |
559 |
+} |
560 |
+ |
561 |
+src_prepare() { |
562 |
+ cat >> backend/dll.conf.in <<-EOF |
563 |
+ # Add support for the HP-specific backend. Needs net-print/hplip installed. |
564 |
+ hpaio |
565 |
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed. |
566 |
+ epkowa |
567 |
+ EOF |
568 |
+ epatch "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch |
569 |
+ epatch "${FILESDIR}"/${PN}-1.0.25-disable-usb-tests.patch |
570 |
+ if [[ ${PV} == "9999" ]] ; then |
571 |
+ mv configure.{in,ac} || die |
572 |
+ AT_NOELIBTOOLIZE=yes eautoreconf |
573 |
+ fi |
574 |
+ |
575 |
+ # Fix for "make check". Upstream sometimes forgets to update this. |
576 |
+ local ver=$(./configure --version | awk '{print $NF; exit 0}') |
577 |
+ sed -i \ |
578 |
+ -e "/by sane-desc 3.5 from sane-backends/s:sane-backends .*:sane-backends ${ver}:" \ |
579 |
+ testsuite/tools/data/html* || die |
580 |
+} |
581 |
+ |
582 |
+src_configure() { |
583 |
+ append-flags -fno-strict-aliasing |
584 |
+ |
585 |
+ # if LINGUAS is set, just use the listed and supported localizations. |
586 |
+ if [[ ${LINGUAS+set} == "set" ]]; then |
587 |
+ mkdir -p po || die |
588 |
+ strip-linguas -u po |
589 |
+ printf '%s\n' ${LINGUAS} > po/LINGUAS |
590 |
+ fi |
591 |
+ |
592 |
+ multilib-minimal_src_configure |
593 |
+} |
594 |
+ |
595 |
+multilib_src_configure() { |
596 |
+ # the blank is intended - an empty string would result in building ALL backends. |
597 |
+ local BACKENDS=" " |
598 |
+ |
599 |
+ use gphoto2 && BACKENDS="gphoto2" |
600 |
+ use v4l && BACKENDS="${BACKENDS} v4l" |
601 |
+ for backend in ${IUSE_SANE_BACKENDS}; do |
602 |
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then |
603 |
+ BACKENDS="${BACKENDS} ${backend}" |
604 |
+ fi |
605 |
+ done |
606 |
+ |
607 |
+ local myconf=( |
608 |
+ $(use_enable usb libusb_1_0) |
609 |
+ $(multilib_native_use_with snmp) |
610 |
+ ) |
611 |
+ |
612 |
+ # you can only enable this backend, not disable it... |
613 |
+ if use sane_backends_pnm; then |
614 |
+ myconf+=( --enable-pnm-backend ) |
615 |
+ fi |
616 |
+ if ! use doc; then |
617 |
+ myconf+=( --disable-latex ) |
618 |
+ fi |
619 |
+ if use sane_backends_mustek_pp; then |
620 |
+ myconf+=( --enable-parport-directio ) |
621 |
+ fi |
622 |
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then |
623 |
+ myconf+=( sane_cv_use_libieee1284=no ) |
624 |
+ fi |
625 |
+ |
626 |
+ # relative path must be used for tests to work properly |
627 |
+ ECONF_SOURCE=${S} \ |
628 |
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \ |
629 |
+ BACKENDS="${BACKENDS}" \ |
630 |
+ econf \ |
631 |
+ $(use_with gphoto2) \ |
632 |
+ $(multilib_native_use_with systemd) \ |
633 |
+ $(use_with v4l) \ |
634 |
+ $(use_enable avahi) \ |
635 |
+ $(use_enable ipv6) \ |
636 |
+ $(use_enable nls translations) \ |
637 |
+ $(use_enable threads pthread) \ |
638 |
+ "${myconf[@]}" |
639 |
+} |
640 |
+ |
641 |
+multilib_src_compile() { |
642 |
+ emake VARTEXFONTS="${T}/fonts" |
643 |
+ |
644 |
+ if tc-is-cross-compiler; then |
645 |
+ pushd "${BUILD_DIR}"/tools >/dev/null || die |
646 |
+ |
647 |
+ # The build system sucks and doesn't handle this properly. |
648 |
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366 |
649 |
+ tc-export_build_env BUILD_CC |
650 |
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \ |
651 |
+ -I. -I../include -I"${S}"/include \ |
652 |
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \ |
653 |
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die |
654 |
+ local dirs=( hal hotplug hotplug-ng udev ) |
655 |
+ local targets=( |
656 |
+ hal/libsane.fdi |
657 |
+ hotplug/libsane.usermap |
658 |
+ hotplug-ng/libsane.db |
659 |
+ udev/libsane.rules |
660 |
+ ) |
661 |
+ mkdir -p "${dirs[@]}" || die |
662 |
+ emake "${targets[@]}" |
663 |
+ |
664 |
+ popd >/dev/null |
665 |
+ fi |
666 |
+ |
667 |
+ if use usb; then |
668 |
+ sed -i -e '/^$/d' \ |
669 |
+ tools/hotplug/libsane.usermap || die |
670 |
+ fi |
671 |
+} |
672 |
+ |
673 |
+multilib_src_install() { |
674 |
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \ |
675 |
+ docdir="${EPREFIX}"/usr/share/doc/${PF} |
676 |
+ |
677 |
+ if multilib_is_native_abi; then |
678 |
+ if use usb; then |
679 |
+ insinto /etc/hotplug/usb |
680 |
+ doins tools/hotplug/libsane.usermap |
681 |
+ fi |
682 |
+ |
683 |
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules |
684 |
+ insinto "/usr/share/pkgconfig" |
685 |
+ doins tools/sane-backends.pc |
686 |
+ fi |
687 |
+} |
688 |
+ |
689 |
+multilib_src_install_all() { |
690 |
+ keepdir /var/lib/lock/sane |
691 |
+ fowners root:scanner /var/lib/lock/sane |
692 |
+ fperms g+w /var/lib/lock/sane |
693 |
+ dodir /etc/env.d |
694 |
+ |
695 |
+ if use usb; then |
696 |
+ exeinto /etc/hotplug/usb |
697 |
+ doexe tools/hotplug/libusbscanner |
698 |
+ newdoc tools/hotplug/README README.hotplug |
699 |
+ fi |
700 |
+ |
701 |
+ dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux |
702 |
+ prune_libtool_files --all |
703 |
+ if use xinetd; then |
704 |
+ insinto /etc/xinetd.d |
705 |
+ doins "${FILESDIR}"/saned |
706 |
+ fi |
707 |
+ |
708 |
+ newinitd "${FILESDIR}"/saned.initd saned |
709 |
+ newconfd "${FILESDIR}"/saned.confd saned |
710 |
+} |
711 |
+ |
712 |
+pkg_postinst() { |
713 |
+ if use xinetd; then |
714 |
+ elog "If you want remote clients to connect, edit" |
715 |
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow" |
716 |
+ fi |
717 |
+ |
718 |
+ elog "If you are using a USB scanner, add all users who want" |
719 |
+ elog "to access your scanner to the \"scanner\" group." |
720 |
+} |