Browse Source

testing/sane: some improvements

Valery Kartel 2 years ago
parent
commit
e99df51425
2 changed files with 61 additions and 19 deletions
  1. 50
    19
      testing/sane/APKBUILD
  2. 11
    0
      testing/sane/check.patch

+ 50
- 19
testing/sane/APKBUILD View File

@@ -2,25 +2,26 @@
2 2
 # Contributor: Valery Kartel <valery.kartel@gmail.com>
3 3
 # Maintainer: Valery Kartel <valery.kartel@gmail.com>
4 4
 pkgname=sane
5
+_pkgname=sane-backends
5 6
 pkgver=1.0.27
6
-pkgrel=0
7
+pkgrel=1
7 8
 pkgdesc="Scanner Access Now Easy - an universal scanner interface"
8 9
 url="http://www.sane-project.org/"
9 10
 arch="all"
10
-license="GPL"
11
+license="GPLv2.0+ GPLv2.0+-with-sane-exception public-domain"
11 12
 depends=""
12 13
 depends_dev=""
13
-makedepends="libtool libusb-dev v4l-utils-dev net-snmp-dev avahi-dev libjpeg-turbo-dev tiff-dev libgphoto2-dev"
14
+makedepends="diffutils file libtool libusb-dev v4l-utils-dev net-snmp-dev avahi-dev libpng-dev
15
+	libjpeg-turbo-dev tiff-dev libgphoto2-dev libieee1284-dev linux-headers"
14 16
 install="$pkgname-saned.pre-install $pkgname.pre-install"
15 17
 pkgusers="saned"
16 18
 pkggroups="scanner"
17
-_backends="abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr cardscan
18
-	coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds
19
-	fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hs2p ibm kodak kodakaio
20
-	kvs1025 kvs20xx kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_usb
21
-	mustek_usb2 nec net niash pie pieusb pixma plustek plustek_pp ricoh rts8891 s9036 sceptre sharp sm3600
22
-	sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u xerox_mfp p5"
23
-
19
+_backends="abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_pp cardscan
20
+	coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds fujitsu genesys
21
+	gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx
22
+	kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2
23
+	nec net niash pie pieusb pixma plustek plustek_pp ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan
24
+	sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5"
24 25
 case "$CARCH" in
25 26
 x86*) _backends="$_backends qcam";;
26 27
 esac
@@ -29,15 +30,16 @@ _pkgdesc_dell1600n_net="SANE backend for Dell 1600n that supports colour and mon
29 30
 for _backend in $_backends; do
30 31
 	subpackages="$subpackages $pkgname-backend-$_backend:_backend"
31 32
 done
32
-subpackages="$pkgname-doc $pkgname-dev $subpackages $pkgname-utils $pkgname-saned"
33
-# https://alioth.debian.org/frs/?group_id=30186
34
-source="https://alioth.debian.org/frs/download.php/file/4224/sane-backends-$pkgver.tar.gz
33
+subpackages="$pkgname-doc $pkgname-dev $subpackages $pkgname-utils $pkgname-saned
34
+	$pkgname-udev::noarch $_pkgname::noarch"
35
+source="https://alioth.debian.org/frs/download.php/file/4224/$_pkgname-$pkgver.tar.gz
35 36
 	$pkgname-saned.initd
36 37
 	include.patch
37 38
 	network.patch
38 39
 	pidfile.patch
40
+	check.patch
39 41
 	"
40
-builddir="$srcdir"/$pkgname-backends-$pkgver
42
+builddir="$srcdir"/$_pkgname-$pkgver
41 43
 
42 44
 build() {
43 45
 	cd "$builddir"
@@ -50,7 +52,12 @@ build() {
50 52
 	--disable-rpath \
51 53
 	--disable-locking \
52 54
 	|| return 1
53
-	make || return 1
55
+	make
56
+}
57
+
58
+check() {
59
+	cd "$builddir"
60
+	make check
54 61
 }
55 62
 
56 63
 package() {
@@ -58,9 +65,13 @@ package() {
58 65
 	make DESTDIR="$pkgdir" install || return 1
59 66
 	echo -n "" > "$pkgdir"/etc/$pkgname.d/dll.conf
60 67
 	install -Dm644 backend/dll.aliases "$pkgdir"/etc/$pkgname.d/dll.aliases
61
-	install -Dm644 tools/udev/lib$pkgname.rules \
62
-		"$pkgdir"/usr/lib/udev/rules.d/49-$pkgname.rules
63
-	sed -i 's|NAME="%k", ||g' "$pkgdir"/usr/lib/udev/rules.d/49-$pkgname.rules
68
+}
69
+
70
+doc() {
71
+	default_doc || return 1
72
+	mkdir -p "$subpkgdir"/usr/share/licenses/$_pkgname || return 1
73
+	mv "$subpkgdir"/usr/share/doc/$_pkgname/LICENSE \
74
+		"$subpkgdir"/usr/share/licenses/$_pkgname
64 75
 }
65 76
 
66 77
 saned() {
@@ -79,6 +90,25 @@ utils() {
79 90
 	rm -fr "$pkgdir"/usr/share
80 91
 }
81 92
 
93
+udev() {
94
+	pkgdesc="$pkgdesc (udev rules)"
95
+	install_if="$pkgname=$pkgver-r$pkgrel udev"
96
+	install -Dm644 "$builddir"/tools/udev/lib$pkgname.rules \
97
+		"$subpkgdir"/usr/lib/udev/rules.d/49-$pkgname.rules || return 1
98
+	sed -i 's|NAME="%k", ||g' "$subpkgdir"/usr/lib/udev/rules.d/49-$pkgname.rules
99
+}
100
+
101
+backends() {
102
+	local _backend;
103
+	pkgdesc="$pkgdesc (metapackage)"
104
+	depends="$pkgname-utils $pkgname-saned"
105
+	for _backend in $_backends; do
106
+		[ "$_backend" = "test" ] && continue
107
+		depends="$depends $pkgname-backend-$_backend"
108
+	done
109
+	mkdir -p "$subpkgdir"
110
+}
111
+
82 112
 _backend() {
83 113
 	local name=${subpkgname#$pkgname-backend-}
84 114
 	depends="$pkgname"
@@ -108,4 +138,5 @@ sha512sums="c6552768bfc10216730fc11011c82f74ca0952182019ded3916072147ec09be5c975
108 138
 0a06eaa28b345202f2bdf8361e06f843bb7a010b7d8f80132f742672c94249c43f64031cefa161e415e2e2ab3a53b23070fb63854283f9e040f5ff79394ac7d1  sane-saned.initd
109 139
 1779ff8beb1ba5f9238c25d819a7f0045f7e257c19b511315feb85650e445ca86450a9e1d7ff8650499d3dae808589a6c2e358d5f3f39a3f40ce4999179b86d6  include.patch
110 140
 9cb595841f59b5105ecc85e4c0ad8781c52caa2354fb823c920ec467e88afbe47f2b3f4a7a3980bef5dbf22983c5786f051a9d10aea97b4bf7c4a05378592029  network.patch
111
-09505943f9441854a6c333f19e2535b4a646a8cc060fe82c6261e7d29c72773ebe98d43a91acc951f4336a3c8b4c84ab7c7b0763426136b4b59d9546bc2fa8c0  pidfile.patch"
141
+09505943f9441854a6c333f19e2535b4a646a8cc060fe82c6261e7d29c72773ebe98d43a91acc951f4336a3c8b4c84ab7c7b0763426136b4b59d9546bc2fa8c0  pidfile.patch
142
+cfa327209efd9a2a2db7cbcf571852959823aaa19b43d5f6415834cd5ae38b6324ecae16779f6f896aa0d7ac890fe23244100b7d6a68e5e9d52cd38ec82bfac8  check.patch"

+ 11
- 0
testing/sane/check.patch View File

@@ -0,0 +1,11 @@
1
+--- a/testsuite/sanei/Makefile.in
2
++++ b/testsuite/sanei/Makefile.in
3
+@@ -77,7 +77,7 @@
4
+ POST_UNINSTALL = :
5
+ build_triplet = @build@
6
+ host_triplet = @host@
7
+-check_PROGRAMS = sanei_usb_test$(EXEEXT) test_wire$(EXEEXT) \
8
++check_PROGRAMS = test_wire$(EXEEXT) \
9
+ 	sanei_check_test$(EXEEXT) sanei_config_test$(EXEEXT) \
10
+ 	sanei_constrain_test$(EXEEXT)
11
+ subdir = testsuite/sanei