diff options
author | Rasmus Thomsen <oss@cogitri.dev> | 2019-05-08 07:11:59 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-06-05 17:48:01 +0000 |
commit | 815d46044815e090806f9f0c729ede697013584b (patch) | |
tree | c5910b29c70f24c33008c74ebb4d61a0507d6291 /testing/sane | |
parent | 1b1801a0870bae9e2b35b661cc09c183477ef920 (diff) | |
download | aports-815d46044815e090806f9f0c729ede697013584b.tar.bz2 aports-815d46044815e090806f9f0c729ede697013584b.tar.xz |
community/sane: move from testing
It's required for simple-scanner. Modernize the APKBUILD while I'm at it.
Diffstat (limited to 'testing/sane')
-rw-r--r-- | testing/sane/APKBUILD | 143 | ||||
-rw-r--r-- | testing/sane/check.patch | 11 | ||||
-rw-r--r-- | testing/sane/include.patch | 11 | ||||
-rw-r--r-- | testing/sane/network.patch | 42 | ||||
-rw-r--r-- | testing/sane/pidfile.patch | 11 | ||||
-rw-r--r-- | testing/sane/sane-saned.initd | 14 | ||||
-rw-r--r-- | testing/sane/sane-saned.pre-install | 5 | ||||
-rw-r--r-- | testing/sane/sane.pre-install | 5 |
8 files changed, 0 insertions, 242 deletions
diff --git a/testing/sane/APKBUILD b/testing/sane/APKBUILD deleted file mode 100644 index 4a77e35ffe..0000000000 --- a/testing/sane/APKBUILD +++ /dev/null @@ -1,143 +0,0 @@ -# Contributor: Fabio Riga <rifabio@dpersonam.me> -# Contributor: Valery Kartel <valery.kartel@gmail.com> -# Maintainer: Valery Kartel <valery.kartel@gmail.com> -pkgname=sane -_pkgname=sane-backends -pkgver=1.0.27 -pkgrel=2 -pkgdesc="Scanner Access Now Easy - universal scanner interface" -url="http://www.sane-project.org/" -arch="x86 x86_64 aarch64 armv7 armhf" -license="GPL-2.0-or-later GPL-2.0-or-later-with-sane-exception Public-Domain" -depends="" -depends_dev="" -makedepends="diffutils file libtool libusb-dev v4l-utils-dev net-snmp-dev avahi-dev libpng-dev - libjpeg-turbo-dev tiff-dev libgphoto2-dev linux-headers" -install="$pkgname-saned.pre-install $pkgname.pre-install" -pkgusers="saned" -pkggroups="scanner" -_backends="abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr cardscan - coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds fujitsu genesys - gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx - kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_usb mustek_usb2 - nec net niash pie pieusb pixma plustek ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan - sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax1220u v4l xerox_mfp p5" -case "$CARCH" in -x86*) _backends="$_backends qcam hpsj5s canon_pp plustek_pp mustek_pp umax_pp" - makedepends="$makedepends libieee1284-dev";; -esac - -_pkgdesc_dell1600n_net="SANE backend for Dell 1600n that supports colour and monochrome scans over ethernet, usb not supported" -for _backend in $_backends; do - subpackages="$subpackages $pkgname-backend-$_backend:_backend" -done -subpackages="$pkgname-doc $pkgname-dev $subpackages $pkgname-utils $pkgname-saned - $pkgname-udev::noarch $_pkgname::noarch" -source="https://alioth-archive.debian.org/releases/$pkgname/$_pkgname/$pkgver/$_pkgname-$pkgver.tar.gz - $pkgname-saned.initd - include.patch - network.patch - pidfile.patch - check.patch - " -builddir="$srcdir"/$_pkgname-$pkgver - -build() { - cd "$builddir" - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --with-docdir=/usr/share/doc/$pkgname \ - --with-usb \ - --enable-avahi \ - --disable-rpath \ - --disable-locking \ - || return 1 - make -} - -check() { - cd "$builddir" - make check -} - -package() { - cd "$builddir" - make DESTDIR="$pkgdir" install || return 1 - echo -n "" > "$pkgdir"/etc/$pkgname.d/dll.conf - install -Dm644 backend/dll.aliases "$pkgdir"/etc/$pkgname.d/dll.aliases -} - -doc() { - default_doc || return 1 - mkdir -p "$subpkgdir"/usr/share/licenses/$_pkgname || return 1 - mv "$subpkgdir"/usr/share/doc/$_pkgname/LICENSE \ - "$subpkgdir"/usr/share/licenses/$_pkgname -} - -saned() { - local name=${subpkgname#$pkgname-} - pkgdesc="$pkgdesc (network scanner server)" - mkdir -p "$subpkgdir"/etc/$pkgname.d "$subpkgdir"/usr - mv "$pkgdir"/etc/$pkgname.d/$name.conf "$subpkgdir"/etc/$pkgname.d - mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/ - install -Dm755 "$srcdir"/$pkgname-$name.initd "$subpkgdir"/etc/init.d/$name -} - -utils() { - pkgdesc="$pkgdesc (utilities)" - mkdir -p "$subpkgdir"/usr - mv "$pkgdir"/usr/bin "$subpkgdir"/usr - rm -fr "$pkgdir"/usr/share -} - -udev() { - pkgdesc="$pkgdesc (udev rules)" - install_if="$pkgname=$pkgver-r$pkgrel udev" - install -Dm644 "$builddir"/tools/udev/lib$pkgname.rules \ - "$subpkgdir"/usr/lib/udev/rules.d/49-$pkgname.rules || return 1 - sed -i 's|NAME="%k", ||g' "$subpkgdir"/usr/lib/udev/rules.d/49-$pkgname.rules -} - -backends() { - local _backend; - pkgdesc="$pkgdesc (metapackage)" - depends="$pkgname-utils $pkgname-saned" - for _backend in $_backends; do - [ "$_backend" = "test" ] && continue - depends="$depends $pkgname-backend-$_backend" - done - mkdir -p "$subpkgdir" -} - -_backend() { - local name=${subpkgname#$pkgname-backend-} - depends="$pkgname" - pkgdesc=$(eval echo \$_pkgdesc_$name) - if [ ! "$pkgdesc" ]; then - # cut description from man-page - pkgdesc=$(tr '\n' ' ' < "$builddir"/doc/$pkgname-$name.man) - pkgdesc=${pkgdesc#*\- } - pkgdesc=${pkgdesc%% .SH *}; - fi - mkdir -p "$subpkgdir"/usr/lib/$pkgname \ - "$subpkgdir"/etc/$pkgname.d/dll.d - mv "$pkgdir"/usr/lib/$pkgname/lib$pkgname-$name.* \ - "$subpkgdir"/usr/lib/$pkgname || return 1 - echo "$name" > "$subpkgdir"/etc/$pkgname.d/dll.d/$name - if [ -f "$pkgdir"/etc/$pkgname.d/$name.conf ]; then - mv "$pkgdir"/etc/$pkgname.d/$name.conf \ - "$subpkgdir"/etc/$pkgname.d - fi - if [ -f "$pkgdir"/usr/bin/$name ]; then - mkdir -p "$subpkgdir"/usr/bin - mv "$pkgdir"/usr/bin/$name "$subpkgdir"/usr/bin - fi -} - -sha512sums="c6552768bfc10216730fc11011c82f74ca0952182019ded3916072147ec09be5c975ce1d37dc3ccea050c488dbdf983c2ca17dcd702644060ba796ae2591f9c5 sane-backends-1.0.27.tar.gz -0a06eaa28b345202f2bdf8361e06f843bb7a010b7d8f80132f742672c94249c43f64031cefa161e415e2e2ab3a53b23070fb63854283f9e040f5ff79394ac7d1 sane-saned.initd -1779ff8beb1ba5f9238c25d819a7f0045f7e257c19b511315feb85650e445ca86450a9e1d7ff8650499d3dae808589a6c2e358d5f3f39a3f40ce4999179b86d6 include.patch -9cb595841f59b5105ecc85e4c0ad8781c52caa2354fb823c920ec467e88afbe47f2b3f4a7a3980bef5dbf22983c5786f051a9d10aea97b4bf7c4a05378592029 network.patch -09505943f9441854a6c333f19e2535b4a646a8cc060fe82c6261e7d29c72773ebe98d43a91acc951f4336a3c8b4c84ab7c7b0763426136b4b59d9546bc2fa8c0 pidfile.patch -cfa327209efd9a2a2db7cbcf571852959823aaa19b43d5f6415834cd5ae38b6324ecae16779f6f896aa0d7ac890fe23244100b7d6a68e5e9d52cd38ec82bfac8 check.patch" diff --git a/testing/sane/check.patch b/testing/sane/check.patch deleted file mode 100644 index afbc7ef4ce..0000000000 --- a/testing/sane/check.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/testsuite/sanei/Makefile.in -+++ b/testsuite/sanei/Makefile.in -@@ -77,7 +77,7 @@ - POST_UNINSTALL = : - build_triplet = @build@ - host_triplet = @host@ --check_PROGRAMS = sanei_usb_test$(EXEEXT) test_wire$(EXEEXT) \ -+check_PROGRAMS = test_wire$(EXEEXT) \ - sanei_check_test$(EXEEXT) sanei_config_test$(EXEEXT) \ - sanei_constrain_test$(EXEEXT) - subdir = testsuite/sanei diff --git a/testing/sane/include.patch b/testing/sane/include.patch deleted file mode 100644 index 518d3b4d5c..0000000000 --- a/testing/sane/include.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/include/sane/sane.h -+++ b/include/sane/sane.h -@@ -16,6 +16,8 @@ - #ifndef sane_h - #define sane_h - -+#include <sys/types.h> -+ - #ifdef __cplusplus - extern "C" { - #endif diff --git a/testing/sane/network.patch b/testing/sane/network.patch deleted file mode 100644 index 4e422e28d2..0000000000 --- a/testing/sane/network.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/sanei/sanei_tcp.c b/sanei/sanei_tcp.c -index a57d7c7..d0a1e92 100644 ---- a/sanei/sanei_tcp.c -+++ b/sanei/sanei_tcp.c -@@ -45,6 +45,7 @@ - #include <unistd.h> - #include <stdlib.h> - #include <string.h> -+#include <time.h> - - #ifdef HAVE_WINSOCK2_H - #include <winsock2.h> -@@ -123,14 +124,27 @@ sanei_tcp_write(int fd, const u_char * buf, int count) - ssize_t - sanei_tcp_read(int fd, u_char * buf, int count) - { -- ssize_t bytes_recv = 0, rc = 1; -+ ssize_t bytes_recv = 0, rc = 1; -+ int retry = 5; - - while (bytes_recv < count && rc > 0) - { - rc = recv(fd, buf+bytes_recv, count-bytes_recv, 0); -+ DBG(1, "%s: bytes received %d\n", __FUNCTION__, rc); - if (rc > 0) - bytes_recv += rc; -- -+ else { -+ if ( errno == EAGAIN && retry-- ) { -+ DBG(1, "%s: waiting %d\n", __FUNCTION__, retry); -+ /* wait for max 1s */ -+ struct timespec req; -+ struct timespec rem; -+ req.tv_sec = 0; -+ req.tv_nsec= 100000000; -+ nanosleep(&req, &rem); -+ rc = 1; -+ } -+ } - } - return bytes_recv; - } diff --git a/testing/sane/pidfile.patch b/testing/sane/pidfile.patch deleted file mode 100644 index 457755bdb8..0000000000 --- a/testing/sane/pidfile.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/frontend/saned.c -+++ b/frontend/saned.c -@@ -224,7 +224,7 @@ - int numchildren; - - #define SANED_CONFIG_FILE "saned.conf" --#define SANED_PID_FILE "/var/run/saned.pid" -+#define SANED_PID_FILE "/run/saned/saned.pid" - - #define SANED_SERVICE_NAME "sane-port" - #define SANED_SERVICE_PORT 6566 diff --git a/testing/sane/sane-saned.initd b/testing/sane/sane-saned.initd deleted file mode 100644 index 6482073ef4..0000000000 --- a/testing/sane/sane-saned.initd +++ /dev/null @@ -1,14 +0,0 @@ -#!/sbin/openrc-run - -description="SANE network scanner server" - -owner=saned -pidfile=/run/saned/saned.pid -cfgfile=/etc/sane.d/saned.conf -command=/usr/sbin/saned -command_args="-a $owner" -required_files="$cfgfile" - -start_pre() { - checkpath -dm755 -o $owner ${pidfile%/*} -} diff --git a/testing/sane/sane-saned.pre-install b/testing/sane/sane-saned.pre-install deleted file mode 100644 index caad990d96..0000000000 --- a/testing/sane/sane-saned.pre-install +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -adduser -SDH -h /run/saned -s /sbin/nologin -G scanner -g saned saned 2>/dev/null - -exit 0 diff --git a/testing/sane/sane.pre-install b/testing/sane/sane.pre-install deleted file mode 100644 index b75c867de9..0000000000 --- a/testing/sane/sane.pre-install +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -addgroup -S scanner 2>/dev/null - -exit 0 |