1 |
commit: 2359950077b026cc6bbe861b1126f5d34b6eac45 |
2 |
Author: Sam James (sam_c) <sam <AT> cmpct <DOT> info> |
3 |
AuthorDate: Mon Jun 22 21:42:47 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 26 22:34:03 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23599500 |
7 |
|
8 |
media-gfx/sane-backends: security bump to 1.0.30 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/691204 |
11 |
Bug: https://bugs.gentoo.org/729312 |
12 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
13 |
Signed-off-by: Sam James (sam_c) <sam <AT> cmpct.info> |
14 |
Closes: https://github.com/gentoo/gentoo/pull/16384 |
15 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
16 |
|
17 |
media-gfx/sane-backends/Manifest | 1 + |
18 |
...ne-backends-1.0.30-missing-stdint-include.patch | 14 + |
19 |
.../sane-backends/sane-backends-1.0.30.ebuild | 344 +++++++++++++++++++++ |
20 |
3 files changed, 359 insertions(+) |
21 |
|
22 |
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest |
23 |
index 44566ad3544..1e5f15e24b2 100644 |
24 |
--- a/media-gfx/sane-backends/Manifest |
25 |
+++ b/media-gfx/sane-backends/Manifest |
26 |
@@ -1 +1,2 @@ |
27 |
+DIST backends-1.0.30.tar.gz 5721262 BLAKE2B 139d3ca908d54b94d14ef4145d44a89b939807c15870be03c3c028cf95351bf9a4abd3ea115b84396366bb054f37ade883f429467dceb0663c2855b92e0a4fa5 SHA512 19127c8109c1587d60d8cba713f73b1a24242df44fa49c3e59320f48022783f05d26d3242a3f87478e583a807d88b446ef7a51afb33b674be29656496c435d7b |
28 |
DIST sane-backends-1.0.27.tar.gz 6430188 BLAKE2B 90f910311e31a436eaa0ca0fedd998aac3331f89a346f31613776ebc860a10cc37055fd15db8de8d743498914ea0c16e4153dbaa101380eb6e36857d730c3456 SHA512 c6552768bfc10216730fc11011c82f74ca0952182019ded3916072147ec09be5c975ce1d37dc3ccea050c488dbdf983c2ca17dcd702644060ba796ae2591f9c5 |
29 |
|
30 |
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.30-missing-stdint-include.patch b/media-gfx/sane-backends/files/sane-backends-1.0.30-missing-stdint-include.patch |
31 |
new file mode 100644 |
32 |
index 00000000000..14c97ae95bf |
33 |
--- /dev/null |
34 |
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.30-missing-stdint-include.patch |
35 |
@@ -0,0 +1,14 @@ |
36 |
+https://gitlab.com/sane-project/backends/-/issues/314 |
37 |
+https://gitlab.com/sane-project/backends/-/commit/6bb87fdf1f3dc190cfc4b7d64b0c8c8c3d10151b.diff |
38 |
+--- a/sanei/sanei_usb.c |
39 |
++++ b/sanei/sanei_usb.c |
40 |
+@@ -48,6 +48,9 @@ |
41 |
+ |
42 |
+ #include "../include/sane/config.h" |
43 |
+ |
44 |
++#ifdef HAVE_STDINT_H |
45 |
++# include <stdint.h> |
46 |
++#endif |
47 |
+ #include <stdlib.h> |
48 |
+ #include <ctype.h> |
49 |
+ #include <sys/types.h> |
50 |
|
51 |
diff --git a/media-gfx/sane-backends/sane-backends-1.0.30.ebuild b/media-gfx/sane-backends/sane-backends-1.0.30.ebuild |
52 |
new file mode 100644 |
53 |
index 00000000000..19095de1445 |
54 |
--- /dev/null |
55 |
+++ b/media-gfx/sane-backends/sane-backends-1.0.30.ebuild |
56 |
@@ -0,0 +1,344 @@ |
57 |
+# Copyright 1999-2020 Gentoo Authors |
58 |
+# Distributed under the terms of the GNU General Public License v2 |
59 |
+ |
60 |
+EAPI=7 |
61 |
+ |
62 |
+inherit autotools eutils flag-o-matic multilib-minimal systemd toolchain-funcs udev user |
63 |
+ |
64 |
+# gphoto and v4l are handled by their usual USE flags. |
65 |
+# The pint backend was disabled because I could not get it to compile. |
66 |
+IUSE_SANE_BACKENDS=" |
67 |
+ abaton |
68 |
+ agfafocus |
69 |
+ apple |
70 |
+ artec |
71 |
+ artec_eplus48u |
72 |
+ as6e |
73 |
+ avision |
74 |
+ bh |
75 |
+ canon |
76 |
+ canon630u |
77 |
+ canon_dr |
78 |
+ canon_pp |
79 |
+ cardscan |
80 |
+ coolscan |
81 |
+ coolscan2 |
82 |
+ coolscan3 |
83 |
+ dc210 |
84 |
+ dc240 |
85 |
+ dc25 |
86 |
+ dell1600n_net |
87 |
+ dmc |
88 |
+ epjitsu |
89 |
+ epson |
90 |
+ epson2 |
91 |
+ fujitsu |
92 |
+ genesys |
93 |
+ gt68xx |
94 |
+ hp |
95 |
+ hp3500 |
96 |
+ hp3900 |
97 |
+ hp4200 |
98 |
+ hp5400 |
99 |
+ hp5590 |
100 |
+ hpljm1005 |
101 |
+ hpsj5s |
102 |
+ hs2p |
103 |
+ ibm |
104 |
+ kodak |
105 |
+ kodakaio |
106 |
+ kvs1025 |
107 |
+ kvs20xx |
108 |
+ kvs40xx |
109 |
+ leo |
110 |
+ lexmark |
111 |
+ ma1509 |
112 |
+ magicolor |
113 |
+ matsushita |
114 |
+ microtek |
115 |
+ microtek2 |
116 |
+ mustek |
117 |
+ mustek_pp |
118 |
+ mustek_usb |
119 |
+ mustek_usb2 |
120 |
+ nec |
121 |
+ net |
122 |
+ niash |
123 |
+ p5 |
124 |
+ pie |
125 |
+ pixma |
126 |
+ plustek |
127 |
+ plustek_pp |
128 |
+ pnm |
129 |
+ qcam |
130 |
+ ricoh |
131 |
+ rts8891 |
132 |
+ s9036 |
133 |
+ sceptre |
134 |
+ sharp |
135 |
+ sm3600 |
136 |
+ sm3840 |
137 |
+ snapscan |
138 |
+ sp15c |
139 |
+ st400 |
140 |
+ stv680 |
141 |
+ tamarack |
142 |
+ teco1 |
143 |
+ teco2 |
144 |
+ teco3 |
145 |
+ test |
146 |
+ u12 |
147 |
+ umax |
148 |
+ umax1220u |
149 |
+ umax_pp |
150 |
+ xerox_mfp" |
151 |
+ |
152 |
+IUSE="gphoto2 ipv6 snmp systemd threads usb v4l xinetd zeroconf" |
153 |
+ |
154 |
+for backend in ${IUSE_SANE_BACKENDS}; do |
155 |
+ case ${backend} in |
156 |
+ # Disable backends that require parallel ports as no one has those anymore. |
157 |
+ canon_pp|hpsj5s|mustek_pp|\ |
158 |
+ pnm) |
159 |
+ IUSE+=" -sane_backends_${backend}" |
160 |
+ ;; |
161 |
+ mustek_usb2|kvs40xx) |
162 |
+ IUSE+=" sane_backends_${backend}" |
163 |
+ ;; |
164 |
+ *) |
165 |
+ IUSE+=" +sane_backends_${backend}" |
166 |
+ esac |
167 |
+done |
168 |
+ |
169 |
+REQUIRED_USE=" |
170 |
+ sane_backends_mustek_usb2? ( threads ) |
171 |
+ sane_backends_kvs40xx? ( threads ) |
172 |
+" |
173 |
+ |
174 |
+MY_PN=${PN//sane-/} |
175 |
+MY_P="${MY_PN}-${PV}" |
176 |
+ |
177 |
+DESCRIPTION="Scanner Access Now Easy - Backends" |
178 |
+HOMEPAGE="http://www.sane-project.org/" |
179 |
+SRC_URI="https://gitlab.com/sane-project/${MY_PN}/-/archive/${PV}/${MY_P}.tar.gz" |
180 |
+ |
181 |
+LICENSE="GPL-2 public-domain" |
182 |
+SLOT="0" |
183 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" |
184 |
+ |
185 |
+RDEPEND=" |
186 |
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] ) |
187 |
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] ) |
188 |
+ sane_backends_dell1600n_net? ( |
189 |
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] |
190 |
+ >=media-libs/tiff-3.9.7-r1:0=[${MULTILIB_USEDEP}] |
191 |
+ ) |
192 |
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
193 |
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
194 |
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] ) |
195 |
+ usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] ) |
196 |
+ gphoto2? ( |
197 |
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}] |
198 |
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] |
199 |
+ ) |
200 |
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] ) |
201 |
+ xinetd? ( sys-apps/xinetd ) |
202 |
+ snmp? ( net-analyzer/net-snmp:0= ) |
203 |
+ systemd? ( sys-apps/systemd:0= ) |
204 |
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] ) |
205 |
+" |
206 |
+ |
207 |
+DEPEND="${RDEPEND} |
208 |
+ v4l? ( sys-kernel/linux-headers ) |
209 |
+ >=sys-devel/gettext-0.18.1 |
210 |
+ virtual/pkgconfig |
211 |
+" |
212 |
+ |
213 |
+PATCHES=( |
214 |
+ "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch |
215 |
+ "${FILESDIR}"/${PN}-1.0.27-disable-usb-tests.patch |
216 |
+ "${FILESDIR}"/${P}-missing-stdint-include.patch |
217 |
+) |
218 |
+ |
219 |
+S="${WORKDIR}/${MY_P}" |
220 |
+ |
221 |
+MULTILIB_CHOST_TOOLS=( |
222 |
+ /usr/bin/sane-config |
223 |
+) |
224 |
+ |
225 |
+pkg_setup() { |
226 |
+ enewgroup scanner |
227 |
+ enewuser saned -1 -1 -1 scanner |
228 |
+} |
229 |
+ |
230 |
+src_prepare() { |
231 |
+ default |
232 |
+ |
233 |
+ cat >> backend/dll.conf.in <<-EOF |
234 |
+ # Add support for the HP-specific backend. Needs net-print/hplip installed. |
235 |
+ hpaio |
236 |
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed. |
237 |
+ epkowa |
238 |
+ EOF |
239 |
+ |
240 |
+ # Patch out the git reference so we can run eautoreconf |
241 |
+ sed -i -e "s/m4_esyscmd_s(\[git describe --dirty\])/${PV}/" configure.ac || die |
242 |
+ eautoreconf |
243 |
+ |
244 |
+ # Fix for "make check". Upstream sometimes forgets to update this. |
245 |
+ local ver=$(./configure --version | awk '{print $NF; exit 0}') |
246 |
+ sed -i \ |
247 |
+ -e "/by sane-desc 3.5 from sane-backends/s:sane-backends .*:sane-backends ${ver}:" \ |
248 |
+ testsuite/tools/data/html* || die |
249 |
+ |
250 |
+} |
251 |
+ |
252 |
+src_configure() { |
253 |
+ append-flags -fno-strict-aliasing # From Fedora |
254 |
+ |
255 |
+ # if LINGUAS is set, just use the listed and supported localizations. |
256 |
+ if [[ ${LINGUAS+set} == "set" ]]; then |
257 |
+ mkdir -p po || die |
258 |
+ strip-linguas -u po |
259 |
+ printf '%s\n' ${LINGUAS} > po/LINGUAS |
260 |
+ fi |
261 |
+ |
262 |
+ multilib-minimal_src_configure |
263 |
+} |
264 |
+ |
265 |
+multilib_src_configure() { |
266 |
+ # the blank is intended - an empty string would result in building ALL backends. |
267 |
+ local BACKENDS=" " |
268 |
+ |
269 |
+ use gphoto2 && BACKENDS="gphoto2" |
270 |
+ use v4l && BACKENDS="${BACKENDS} v4l" |
271 |
+ for backend in ${IUSE_SANE_BACKENDS}; do |
272 |
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then |
273 |
+ BACKENDS="${BACKENDS} ${backend}" |
274 |
+ fi |
275 |
+ done |
276 |
+ |
277 |
+ local myconf=( |
278 |
+ $(use_with usb) |
279 |
+ $(multilib_native_use_with snmp) |
280 |
+ ) |
281 |
+ |
282 |
+ # you can only enable this backend, not disable it... |
283 |
+ if use sane_backends_pnm; then |
284 |
+ myconf+=( --enable-pnm-backend ) |
285 |
+ fi |
286 |
+ if use sane_backends_mustek_pp; then |
287 |
+ myconf+=( --enable-parport-directio ) |
288 |
+ fi |
289 |
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then |
290 |
+ myconf+=( sane_cv_use_libieee1284=no ) |
291 |
+ fi |
292 |
+ |
293 |
+ # relative path must be used for tests to work properly |
294 |
+ # All distributions pass --disable-locking because /var/lock/sane/ would be a world-writable directory |
295 |
+ # --without-api-spec to not automagically depend on tons of stuff |
296 |
+ # that break in many ways, bug #636202, #668232, #668350 |
297 |
+ # People can refer to the "Programmer's Documentation" at http://www.sane-project.org/docs.html |
298 |
+ ECONF_SOURCE=${S} \ |
299 |
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \ |
300 |
+ BACKENDS="${BACKENDS}" \ |
301 |
+ econf \ |
302 |
+ --disable-locking \ |
303 |
+ --without-api-spec \ |
304 |
+ $(use_with gphoto2) \ |
305 |
+ $(multilib_native_use_with systemd) \ |
306 |
+ $(use_with v4l) \ |
307 |
+ $(use_enable ipv6) \ |
308 |
+ $(use_enable threads pthread) \ |
309 |
+ $(use_enable zeroconf avahi) \ |
310 |
+ "${myconf[@]}" |
311 |
+} |
312 |
+ |
313 |
+multilib_src_compile() { |
314 |
+ emake VARTEXFONTS="${T}/fonts" |
315 |
+ |
316 |
+ if tc-is-cross-compiler; then |
317 |
+ pushd "${BUILD_DIR}"/tools >/dev/null || die |
318 |
+ |
319 |
+ # The build system sucks and doesn't handle this properly. |
320 |
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366 |
321 |
+ tc-export_build_env BUILD_CC |
322 |
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \ |
323 |
+ -I. -I../include -I"${S}"/include \ |
324 |
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \ |
325 |
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die |
326 |
+ local dirs=( hal hotplug hotplug-ng udev ) |
327 |
+ local targets=( |
328 |
+ hal/libsane.fdi |
329 |
+ hotplug/libsane.usermap |
330 |
+ hotplug-ng/libsane.db |
331 |
+ udev/libsane.rules |
332 |
+ ) |
333 |
+ mkdir -p "${dirs[@]}" || die |
334 |
+ emake "${targets[@]}" |
335 |
+ |
336 |
+ popd >/dev/null |
337 |
+ fi |
338 |
+ |
339 |
+ if use usb; then |
340 |
+ sed -i -e '/^$/d' \ |
341 |
+ tools/hotplug/libsane.usermap || die |
342 |
+ fi |
343 |
+} |
344 |
+ |
345 |
+multilib_src_install() { |
346 |
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \ |
347 |
+ docdir="${EPREFIX}"/usr/share/doc/${PF} |
348 |
+ |
349 |
+ if multilib_is_native_abi; then |
350 |
+ if use usb; then |
351 |
+ insinto /etc/hotplug/usb |
352 |
+ doins tools/hotplug/libsane.usermap |
353 |
+ fi |
354 |
+ |
355 |
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules |
356 |
+ insinto "/usr/share/pkgconfig" |
357 |
+ doins tools/sane-backends.pc |
358 |
+ fi |
359 |
+} |
360 |
+ |
361 |
+multilib_src_install_all() { |
362 |
+ keepdir /var/lib/lock/sane |
363 |
+ fowners root:scanner /var/lib/lock/sane |
364 |
+ fperms g+w /var/lib/lock/sane |
365 |
+ dodir /etc/env.d |
366 |
+ |
367 |
+ if use systemd; then |
368 |
+ systemd_newunit "${FILESDIR}"/saned_at.service "saned@.service" |
369 |
+ systemd_newunit "${FILESDIR}"/saned.socket saned.socket |
370 |
+ fi |
371 |
+ |
372 |
+ if use usb; then |
373 |
+ exeinto /etc/hotplug/usb |
374 |
+ doexe tools/hotplug/libusbscanner |
375 |
+ newdoc tools/hotplug/README README.hotplug |
376 |
+ fi |
377 |
+ |
378 |
+ dodoc NEWS AUTHORS PROBLEMS README README.linux |
379 |
+ find "${D}" -name '*.la' -delete || die |
380 |
+ |
381 |
+ if use xinetd; then |
382 |
+ insinto /etc/xinetd.d |
383 |
+ doins "${FILESDIR}"/saned |
384 |
+ fi |
385 |
+ |
386 |
+ newinitd "${FILESDIR}"/saned.initd saned |
387 |
+ newconfd "${FILESDIR}"/saned.confd saned |
388 |
+} |
389 |
+ |
390 |
+pkg_postinst() { |
391 |
+ if use xinetd; then |
392 |
+ elog "If you want remote clients to connect, edit" |
393 |
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow" |
394 |
+ fi |
395 |
+ |
396 |
+ if ! use systemd; then |
397 |
+ elog "If you are using a USB scanner, add all users who want" |
398 |
+ elog "to access your scanner to the \"scanner\" group." |
399 |
+ fi |
400 |
+} |