diff options
author | Christopher Reimer | 2015-08-14 13:37:55 +0200 |
---|---|---|
committer | Christopher Reimer | 2015-08-14 13:37:55 +0200 |
commit | 6d1a4691b5c660ccb8196fe89e6c59c2209c6143 (patch) | |
tree | bee1b5d38f09f0a23f36b1fce2d187c446d2f53c | |
download | aur-6d1a4691b5c660ccb8196fe89e6c59c2209c6143.tar.gz |
Inital commit
-rw-r--r-- | .SRCINFO | 112 | ||||
-rw-r--r-- | PKGBUILD | 78 | ||||
-rw-r--r-- | network.patch | 42 | ||||
-rw-r--r-- | sane.xinetd | 11 | ||||
-rw-r--r-- | saned.service | 8 | ||||
-rw-r--r-- | saned.socket | 9 |
6 files changed, 260 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..a176ead2fe16 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,112 @@ +# Generated by makepkg 4.2.1 +# Fri Aug 14 11:36:34 UTC 2015 +pkgbase = sane-git + pkgdesc = Scanner Access Now Easy + pkgver = 1.0.24_334_g4a6e6c1 + pkgrel = 1 + url = http://www.sane-project.org/ + arch = i686 + arch = x86_64 + license = GPL + makedepends = texlive-latexextra + depends = libtiff>=4.0.0 + depends = libgphoto2 + depends = libjpeg>=8 + depends = libusbx + depends = libcups + depends = libieee1284 + depends = v4l-utils + depends = avahi + depends = bash + depends = net-snmp + backup = etc/sane.d/abaton.conf + backup = etc/sane.d/agfafocus.conf + backup = etc/sane.d/apple.conf + backup = etc/sane.d/artec.conf + backup = etc/sane.d/artec_eplus48u.conf + backup = etc/sane.d/avision.conf + backup = etc/sane.d/bh.conf + backup = etc/sane.d/canon.conf + backup = etc/sane.d/canon630u.conf + backup = etc/sane.d/canon_dr.conf + backup = etc/sane.d/canon_pp.conf + backup = etc/sane.d/cardscan.conf + backup = etc/sane.d/coolscan2.conf + backup = etc/sane.d/coolscan3.conf + backup = etc/sane.d/coolscan.conf + backup = etc/sane.d/dc25.conf + backup = etc/sane.d/dc210.conf + backup = etc/sane.d/dc240.conf + backup = etc/sane.d/dell1600n_net.conf + backup = etc/sane.d/dll.conf + backup = etc/sane.d/dmc.conf + backup = etc/sane.d/epjitsu.conf + backup = etc/sane.d/epson.conf + backup = etc/sane.d/epson2.conf + backup = etc/sane.d/fujitsu.conf + backup = etc/sane.d/genesys.conf + backup = etc/sane.d/gphoto2.conf + backup = etc/sane.d/gt68xx.conf + backup = etc/sane.d/hp.conf + backup = etc/sane.d/hp3900.conf + backup = etc/sane.d/hp4200.conf + backup = etc/sane.d/hp5400.conf + backup = etc/sane.d/hpsj5s.conf + backup = etc/sane.d/hs2p.conf + backup = etc/sane.d/ibm.conf + backup = etc/sane.d/kodak.conf + backup = etc/sane.d/kodakaio.conf + backup = etc/sane.d/leo.conf + backup = etc/sane.d/lexmark.conf + backup = etc/sane.d/ma1509.conf + backup = etc/sane.d/magicolor.conf + backup = etc/sane.d/matsushita.conf + backup = etc/sane.d/microtek.conf + backup = etc/sane.d/microtek2.conf + backup = etc/sane.d/mustek.conf + backup = etc/sane.d/mustek_pp.conf + backup = etc/sane.d/mustek_usb.conf + backup = etc/sane.d/nec.conf + backup = etc/sane.d/net.conf + backup = etc/sane.d/p5.conf + backup = etc/sane.d/pie.conf + backup = etc/sane.d/pixma.conf + backup = etc/sane.d/plustek.conf + backup = etc/sane.d/plustek_pp.conf + backup = etc/sane.d/qcam.conf + backup = etc/sane.d/ricoh.conf + backup = etc/sane.d/rts8891.conf + backup = etc/sane.d/s9036.conf + backup = etc/sane.d/saned.conf + backup = etc/sane.d/sceptre.conf + backup = etc/sane.d/sharp.conf + backup = etc/sane.d/sm3840.conf + backup = etc/sane.d/snapscan.conf + backup = etc/sane.d/sp15c.conf + backup = etc/sane.d/st400.conf + backup = etc/sane.d/stv680.conf + backup = etc/sane.d/tamarack.conf + backup = etc/sane.d/teco1.conf + backup = etc/sane.d/teco2.conf + backup = etc/sane.d/teco3.conf + backup = etc/sane.d/test.conf + backup = etc/sane.d/u12.conf + backup = etc/sane.d/umax.conf + backup = etc/sane.d/umax1220u.conf + backup = etc/sane.d/umax_pp.conf + backup = etc/sane.d/xerox_mfp.conf + backup = etc/sane.d/v4l.conf + backup = etc/xinetd.d/sane + source = git://anonscm.debian.org/sane/sane-backends.git + source = sane.xinetd + source = saned.socket + source = saned.service + source = network.patch + md5sums = SKIP + md5sums = bc2c8b4f7b3012c8936c7da21f60e2ac + md5sums = e57e9e15528f47f5f1b3f1411135ed5d + md5sums = 3f9fe36b0c4ff0b01b53b1cffa5d9700 + md5sums = 44e77692c52db15b0f530a1d9a8e1296 + +pkgname = sane-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d118da55e508 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,78 @@ +# Maintainer: Christopher Reimer <mail+aur[at]c-reimer[dot]de> +# Original Maintainer: Tobias Powalowski <tpowa@archlinux.org> +# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca> +# Contributor: Simo L. <neotuli@yahoo.com> +# Contributor: eric <eric@archlinux.org> + +_pkgname=sane +pkgname=$_pkgname-git +pkgver=1.0.24_334_g4a6e6c1 +pkgrel=1 +pkgdesc="Scanner Access Now Easy" +url="http://www.sane-project.org/" +arch=('i686' 'x86_64') +license=('GPL') +depends=('libtiff>=4.0.0' 'libgphoto2' 'libjpeg>=8' 'libusbx' 'libcups' 'libieee1284' 'v4l-utils' 'avahi' 'bash' 'net-snmp') +makedepends=('texlive-latexextra') +backup=(etc/sane.d/{abaton.conf,agfafocus.conf,apple.conf,artec.conf,artec_eplus48u.conf,avision.conf,bh.conf,canon.conf,canon630u.conf,canon_dr.conf,canon_pp.conf,cardscan.conf,coolscan2.conf,coolscan3.conf,coolscan.conf,dc25.conf,dc210.conf,dc240.conf,dell1600n_net.conf,dll.conf,dmc.conf,epjitsu.conf,epson.conf,epson2.conf,fujitsu.conf,genesys.conf,gphoto2.conf,gt68xx.conf,hp.conf,hp3900.conf,hp4200.conf,hp5400.conf,hpsj5s.conf,hs2p.conf,ibm.conf,kodak.conf,kodakaio.conf,leo.conf,lexmark.conf,ma1509.conf,magicolor.conf,matsushita.conf,microtek.conf,microtek2.conf,mustek.conf,mustek_pp.conf,mustek_usb.conf,nec.conf,net.conf,p5.conf,pie.conf,pixma.conf,plustek.conf,plustek_pp.conf,qcam.conf,ricoh.conf,rts8891.conf,s9036.conf,saned.conf,sceptre.conf,sharp.conf,sm3840.conf,snapscan.conf,sp15c.conf,st400.conf,stv680.conf,tamarack.conf,teco1.conf,teco2.conf,teco3.conf,test.conf,u12.conf,umax.conf,umax1220u.conf,umax_pp.conf,xerox_mfp.conf,v4l.conf} etc/xinetd.d/sane) +source=("git://anonscm.debian.org/sane/sane-backends.git" + 'sane.xinetd' + 'saned.socket' + 'saned.service' + 'network.patch') +md5sums=('SKIP' + 'bc2c8b4f7b3012c8936c7da21f60e2ac' + 'e57e9e15528f47f5f1b3f1411135ed5d' + '3f9fe36b0c4ff0b01b53b1cffa5d9700' + '44e77692c52db15b0f530a1d9a8e1296') + +pkgver() { + cd "${srcdir}/${_pkgname}-backends" + git describe --tags | sed 's/RELEASE_//;s/_/./g;s/-/_/g' +} + +prepare() { + cd "${srcdir}/${_pkgname}-backends" + # fix http://vasks.debian.org/tracker/?func=detail&atid=410366&aid=313760&group_id=30186 + patch -Np1 -i ${srcdir}/network.patch +} + +build() { + cd "${srcdir}/${_pkgname}-backends" + + ./configure --prefix=/usr --sbindir=/usr/bin \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-docdir=/usr/share/doc/sane \ + --enable-avahi \ + --enable-pthread \ + --disable-rpath \ + --enable-libusb_1_0 \ + --disable-locking + make +} + +package () { + cd "${srcdir}/${_pkgname}-backends" + make DESTDIR="${pkgdir}" install + # fix hp officejets + echo "#hpaio" >> "${pkgdir}/etc/sane.d/dll.conf" + # install udev files + install -D -m0644 tools/udev/libsane.rules \ + "${pkgdir}/usr/lib/udev/rules.d/49-sane.rules" + # fix udev rules + sed -i 's|NAME="%k", ||g' "${pkgdir}/usr/lib/udev/rules.d/49-sane.rules" + + # install xinetd file + install -D -m644 "${srcdir}/sane.xinetd" "${pkgdir}/etc/xinetd.d/sane" + + # Install the pkg-config file + install -D -m644 tools/sane-backends.pc \ + "${pkgdir}/usr/lib/pkgconfig/sane-backends.pc" + # install systemd files + install -D -m644 ${srcdir}/saned.socket \ + "${pkgdir}/usr/lib/systemd/system/saned.socket" + install -D -m644 ${srcdir}/saned.service \ + "${pkgdir}/usr/lib/systemd/system/saned@.service" +} + diff --git a/network.patch b/network.patch new file mode 100644 index 000000000000..2605ea83578d --- /dev/null +++ b/network.patch @@ -0,0 +1,42 @@ +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/sane.xinetd b/sane.xinetd new file mode 100644 index 000000000000..311ca6202c17 --- /dev/null +++ b/sane.xinetd @@ -0,0 +1,11 @@ +service sane-port +{ + port = 6566 + socket_type = stream + wait = no + user = nobody + group = scanner + server = /usr/bin/saned + # disabled by default! + disable = yes + } diff --git a/saned.service b/saned.service new file mode 100644 index 000000000000..6b2a3f7a7c01 --- /dev/null +++ b/saned.service @@ -0,0 +1,8 @@ +[Unit] +Description=Scanner Service + +[Service] +Group=scanner +ExecStart=/usr/bin/saned +StandardInput=socket +StandardError=syslog diff --git a/saned.socket b/saned.socket new file mode 100644 index 000000000000..66ef9c9c8009 --- /dev/null +++ b/saned.socket @@ -0,0 +1,9 @@ +[Unit] +Description=saned incoming socket + +[Socket] +ListenStream=6566 +Accept=yes + +[Install] +WantedBy=sockets.target |