summaryrefslogtreecommitdiff
path: root/extra/sane
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-02-27 00:03:49 -0800
committerroot <root@rshg054.dnsready.net>2013-02-27 00:03:49 -0800
commit23018fec360e50c7cb4de4b2411650ce79532e54 (patch)
tree766004a81e02dd8a2ea0d5092ce2d19aed799bf6 /extra/sane
parent32e4cb82a73f6efc4254917e6324a2b61ecb5ddc (diff)
Wed Feb 27 00:03:48 PST 2013
Diffstat (limited to 'extra/sane')
-rw-r--r--extra/sane/PKGBUILD19
-rw-r--r--extra/sane/kodakaio.c.patch11
-rw-r--r--extra/sane/libv4l-0.8.3.patch64
-rw-r--r--extra/sane/network.patch42
-rw-r--r--extra/sane/sane.xinetd2
-rw-r--r--extra/sane/xerox_mfp_fix_usb_devices.patch67
6 files changed, 68 insertions, 137 deletions
diff --git a/extra/sane/PKGBUILD b/extra/sane/PKGBUILD
index 4abdfd248..d0aab1080 100644
--- a/extra/sane/PKGBUILD
+++ b/extra/sane/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 173127 2012-12-11 14:42:10Z jgc $
+# $Id: PKGBUILD 178746 2013-02-26 16:27:02Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>
# Contributor: Simo L. <neotuli@yahoo.com>
@@ -6,7 +6,7 @@
pkgname=sane
pkgver=1.0.23
-pkgrel=2
+pkgrel=3
pkgdesc="Scanner Access Now Easy"
url="http://www.sane-project.org/"
arch=('i686' 'x86_64')
@@ -18,12 +18,19 @@ backup=(etc/sane.d/{abaton.conf,agfafocus.conf,apple.conf,artec.conf,artec_eplus
source=(ftp://ftp.archlinux.org/other/sane/$pkgname-backends-$pkgver.tar.gz
'sane.xinetd'
'saned.socket'
- 'saned.service')
+ 'saned.service'
+ 'kodakaio.c.patch'
+ 'network.patch')
options=(!libtool)
build() {
cd "${srcdir}/${pkgname}-backends-${pkgver}"
+ # fix FS#33657
+ patch -Np0 -i ${srcdir}/kodakaio.c.patch
+ # fix http://vasks.debian.org/tracker/?func=detail&atid=410366&aid=313760&group_id=30186
+ patch -Np1 -i ${srcdir}/network.patch
+
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
@@ -59,6 +66,8 @@ package () {
"${pkgdir}/usr/lib/systemd/system/saned@.service"
}
md5sums=('e226a89c54173efea80e91e9a5eb6573'
- 'da946cc36fb83612162cf9505986d4b2'
+ '5f519030392d599e2ad348159ec4c96f'
'e57e9e15528f47f5f1b3f1411135ed5d'
- 'e44bd4c994a52d6f472463d1eb0a03be')
+ 'e44bd4c994a52d6f472463d1eb0a03be'
+ 'e65dbefb7c3d69955fb6eb3ace14aa12'
+ '44e77692c52db15b0f530a1d9a8e1296')
diff --git a/extra/sane/kodakaio.c.patch b/extra/sane/kodakaio.c.patch
new file mode 100644
index 000000000..95cb1ee9a
--- /dev/null
+++ b/extra/sane/kodakaio.c.patch
@@ -0,0 +1,11 @@
+--- backend/kodakaio.c.bad 2013-01-31 20:42:10.627296894 +0100
++++ backend/kodakaio.c 2013-01-31 20:42:46.040397213 +0100
+@@ -2197,7 +2197,7 @@
+
+ reply = cupsGetDevices(CUPS_HTTP_DEFAULT, CUPS_TIMEOUT_DEFAULT,
+ "dnssd", CUPS_EXCLUDE_NONE, ProcessDevice, Dummy);
+- if(reply != IPP_OK) printf("Failed cupsGetDevices\n");
++ if(reply != IPP_OK) DBG(1, "Failed cupsGetDevices\n");
+
+ return 0;
+ }
diff --git a/extra/sane/libv4l-0.8.3.patch b/extra/sane/libv4l-0.8.3.patch
deleted file mode 100644
index 4e240e0cf..000000000
--- a/extra/sane/libv4l-0.8.3.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 26c69b228b29f612faf4b0cc85db969ee7cc4ea6 Mon Sep 17 00:00:00 2001
-From: Nils Philippsen <nils@redhat.com>
-Date: Mon, 14 Mar 2011 13:35:05 +0100
-Subject: [PATCH] patch: v4l
-
-Squashed commit of the following:
-
-commit 23381932c76846191b42a48e505b37cd74711265
-Author: Julien BLACHE <jb@jblache.org>
-Date: Wed Feb 16 19:37:43 2011 +0100
-
- Fix v4l build with libv4l 0.8.3+
-
- (cherry picked from commit c5ca46c2d1be78c651afb843cc834cf2b5b24953)
-
- Conflicts:
-
- ChangeLog
-
- Signed-off-by: Nils Philippsen <nils@redhat.com>
----
- backend/v4l.c | 3 +--
- backend/v4l.h | 3 ++-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/backend/v4l.c b/backend/v4l.c
-index 6510ef0..38595ed 100644
---- a/backend/v4l.c
-+++ b/backend/v4l.c
-@@ -84,9 +84,8 @@
- #include "../include/sane/sanei_config.h"
- #define V4L_CONFIG_FILE "v4l.conf"
-
--#include "v4l.h"
--
- #include <libv4l1.h>
-+#include "v4l.h"
-
- static const SANE_Device **devlist = NULL;
- static int num_devices;
-diff --git a/backend/v4l.h b/backend/v4l.h
-index 588b96e..6aee586 100644
---- a/backend/v4l.h
-+++ b/backend/v4l.h
-@@ -29,6 +29,7 @@
- #ifndef v4l_h
- #define v4l_h
-
-+#ifndef __LINUX_VIDEODEV_H
- /* Kernel interface */
- /* Only the stuff we need. For more features, more defines are needed */
-
-@@ -165,7 +166,7 @@ struct video_channel
-
-
- /* end of kernel interface */
--
-+#endif /* !__LINUX_VIDEODEV_H */
-
- #include <../include/sane/sane.h>
-
---
-1.7.4
-
diff --git a/extra/sane/network.patch b/extra/sane/network.patch
new file mode 100644
index 000000000..2605ea835
--- /dev/null
+++ b/extra/sane/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/extra/sane/sane.xinetd b/extra/sane/sane.xinetd
index b035664b4..67f08a656 100644
--- a/extra/sane/sane.xinetd
+++ b/extra/sane/sane.xinetd
@@ -3,7 +3,7 @@ service sane-port
port = 6566
socket_type = stream
wait = no
- user = root
+ user = nobody
group = scanner
server = /usr/sbin/saned
# disabled by default!
diff --git a/extra/sane/xerox_mfp_fix_usb_devices.patch b/extra/sane/xerox_mfp_fix_usb_devices.patch
deleted file mode 100644
index 5ed29b974..000000000
--- a/extra/sane/xerox_mfp_fix_usb_devices.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-commit 5ea227caeacd504b64eef301e83fa63e0a25b3f7
-Author: Alex Belkin <abc@telekom.ru>
-Date: Tue Mar 8 17:57:19 2011 +0300
-
- keep usb device by default (correct for bug introduced by tcp sub-backend
-
-diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c
-index e08b50f..d4672a7 100644
---- a/backend/xerox_mfp.c
-+++ b/backend/xerox_mfp.c
-@@ -37,10 +37,10 @@
- static const SANE_Device **devlist = NULL; /* sane_get_devices array */
- static struct device *devices_head = NULL; /* sane_get_devices list */
-
--transport available_transports[] = {
-+enum { TRANSPORT_USB, TRANSPORT_TCP, TRANSPORTS_MAX };
-+transport available_transports[TRANSPORTS_MAX] = {
- { "usb", usb_dev_request, usb_dev_open, usb_dev_close, usb_configure_device },
- { "tcp", tcp_dev_request, tcp_dev_open, tcp_dev_close, tcp_configure_device },
-- { 0 }
- };
-
- static int resolv_state(int state)
-@@ -824,7 +824,13 @@ free_devices (void)
- devices_head = NULL;
- }
-
--/* SANE API ignores return code of this callback */
-+static transport *tr_from_devname(SANE_String_Const devname)
-+{
-+ if (strncmp("tcp", devname, 3) == 0)
-+ return &available_transports[TRANSPORT_TCP];
-+ return &available_transports[TRANSPORT_USB];
-+}
-+
- static SANE_Status
- list_one_device (SANE_String_Const devname)
- {
-@@ -839,12 +845,7 @@ list_one_device (SANE_String_Const devname)
- return SANE_STATUS_GOOD;
- }
-
-- for (tr = available_transports; tr->ttype; tr++) {
-- if (!strncmp (devname, tr->ttype, strlen(tr->ttype)))
-- break;
-- }
-- if (!tr->ttype)
-- return SANE_STATUS_INVAL;
-+ tr = tr_from_devname(devname);
-
- dev = calloc (1, sizeof (struct device));
- if (dev == NULL)
-@@ -878,13 +879,7 @@ list_one_device (SANE_String_Const devname)
- static SANE_Status
- list_conf_devices (UNUSED (SANEI_Config * config), const char *devname)
- {
-- transport *tr;
--
-- for (tr = available_transports; tr->ttype; tr++) {
-- if (!strncmp (devname, tr->ttype, strlen(tr->ttype)))
-- return tr->configure_device(devname, list_one_device);
-- }
-- return SANE_STATUS_INVAL;
-+ return tr_from_devname(devname)->configure_device(devname, list_one_device);
- }
-
- SANE_Status