#
# Copyright (C) 2006-2016 OpenWrt.org
-# Copyright (C) 2017-2019 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+# Copyright (C) 2017-2020 Luiz Angelo Daros de Luca <luizluca@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=sane-backends
-PKG_VERSION:=1.0.28
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.29
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://gitlab.com/sane-project/backends/uploads/9e718daff347826f4cfe21126c8d5091/
-PKG_HASH:=31260f3f72d82ac1661c62c5a4468410b89fb2b4a811dabbfcc0350c1346de03
+PKG_SOURCE_URL:=https://gitlab.com/sane-project/backends/uploads/54f858b20a364fc35d820df935a86478
+PKG_HASH:=aa027b4e5f59849cd41b8c26d54584cf31fffd986049019be6ad4140e11ea8ed
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
PKG_LICENSE:=GPL-2.0 GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING LICENSE
# Run hotplug to grant access to existing scanners
define Package/sane-daemon/postinst
#!/bin/sh
-udevtrigger
+# We only need udevtrigger to have the magic work without
+# rebooting on a real system. In ImageBuilder or
+# the like, the boot process will call udevtrigger.
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ udevtrigger
+fi
endef
define Package/libsane
$(call Package/sane-backends/Default)
SECTION:=libs
CATEGORY:=Libraries
+ DEPENDS+=+libusb-1.0
TITLE+= (libraries)
endef
--without-snmp \
--disable-avahi \
--disable-locking \
+ --without-usb-record-replay \
# ./configure does not even try to detect mmap if crosscompiling
CONFIGURE_VARS+= \
$(eval $(call SaneBackend,epson,EPSON scanners,+libusb-1.0))
$(eval $(call SaneBackend,epsonds,EPSON scanners,+libjpeg +libusb-1.0)) ####
$(eval $(call SaneBackend,epson2,EPSON scanners,+libusb-1.0))
+#$(eval $(call SaneBackend,escl,AirScan/eSCL devices,+libcurl +libxml2 +libnetsnmp +libavahi))
$(eval $(call SaneBackend,fujitsu,Fujitsu flatbed and ADF scanners,+libusb-1.0))
$(eval $(call SaneBackend,genesys,GL646 GL841 GL843 GL847 and GL124 based USB flatbed scanners,+libstdcpp +libusb-1.0))
$(eval $(call SaneBackend,gphoto2,digital cameras supported by gphoto2,+libjpeg +libgphoto2))
$(eval $(call SaneBackend,kodakaio,Kodak aio printer / scanners,+libusb-1.0))
$(eval $(call SaneBackend,kvs1025,Panasonic KV-S102xC USB ADF scanners,+libusb-1.0))
$(eval $(call SaneBackend,kvs20xx,Panasonic KV-S20xxC USB/SCSI ADF scanners,+libusb-1.0))
-# https://gitlab.com/sane-project/backends/issues/153
-#$(eval $(call SaneBackend,kvs40xx,Panasonic KV-S40xxC USB/SCSI ADF scanners,+libpthread +libusb-1.0))
+$(eval $(call SaneBackend,kvs40xx,Panasonic KV-S40xxC USB/SCSI ADF scanners,+libpthread +libusb-1.0))
$(eval $(call SaneBackend,leo,LEO Technologies scanners))
$(eval $(call SaneBackend,lexmark,Lexmark X1100/X1200 Series scanners,+libusb-1.0))
$(eval $(call SaneBackend,ma1509,Mustek BearPaw 1200F USB scanner,+libusb-1.0))
# Depends on libieee1284
#$(eval $(call SaneBackend,mustek_pp,Mustek parallel port flatbed scanners,+libieee1284))
$(eval $(call SaneBackend,mustek_usb,Mustek USB flatbed scanners,+libusb-1.0))
-# https://gitlab.com/sane-project/backends/issues/153
-#$(eval $(call SaneBackend,mustek_usb2,SQ113 based USB flatbed scanners,+libpthread +libusb-1.0))
+$(eval $(call SaneBackend,mustek_usb2,SQ113 based USB flatbed scanners,+libpthread +libusb-1.0))
$(eval $(call SaneBackend,nec,NEC scanners))
$(eval $(call SaneBackend,net,network backend))
$(eval $(call SaneBackend,niash,scanners based on the NIASH chipset,+libusb-1.0))
#!/bin/sh
-[ "$ACTION" = "add" ] || exit 0
-[ "$DEVTYPE" = "usb_device" ] || exit 0
+[ "$ACTION" != "remove" ] || exit 0
SANE_GROUP=scanner
grep -q -E "^$SANE_GROUP:" /etc/group || exit 0
-# Filter SANE known devices
-vendor_product="${PRODUCT%/*}"
-vendorid="$(printf '%04x' "0x0${vendor_product%/*}")"
-productid="$(printf '%04x' "0x0${vendor_product#*/}")"
-grep -s -x -F -q "$productid" "/usr/share/sane/$vendorid"-*.usbid || exit 0
-
grant() {
- logger -t "hotplug(usb/20-saned)" "Granting $1 to '$2' for group '$SANE_GROUP'"
+ echo "hotplug(usb/20-saned): Granting $1 to '$2' for group '$SANE_GROUP'" >/dev/kmsg
chgrp "$SANE_GROUP" "$2"
chmod "$1" "$2"
}
-# Needed by script /usr/bin/saned to rebind USB devices back to usblp after use
usblp_bind="/sys/bus/usb/drivers/usblp/bind"
-if [ -e "$usblp_bind" ]; then
- grant g+w "$usblp_bind"
+if [ "$DEVTYPE" = "usb_device" ]; then
+ # Filter SANE known devices
+ vendor_product="${PRODUCT%/*}"
+ vendorid="$(printf '%04x' "0x0${vendor_product%/*}")"
+ productid="$(printf '%04x' "0x0${vendor_product#*/}")"
+ grep -s -x -F -q "$productid" "/usr/share/sane/$vendorid"-*.usbid || exit 0
+ grant g+rw "/dev/$DEVNAME"
+elif [ "$DEVTYPE" = "usb_interface" ] && [ "$DRIVER" = 'usblp' ]; then
+ # Needed by script /usr/bin/saned to rebind USB devices back to usblp after use
+ if [ -e "$usblp_bind" ]; then
+ grant g+w "$usblp_bind"
+ fi
fi
-grant g+rw "/dev/$DEVNAME"