This commit is contained in:
parent
a19a75ef54
commit
7242be0a61
@ -16,7 +16,7 @@ MY_NAME=${0##*/}
|
||||
# Create a temporary file:
|
||||
TMP_DATA=$(mktemp /tmp/$MY_NAME.XXXXXX) || { echo "Error: Failed to make a temporary file /tmp/$MY_NAME.XXXXXX" 1>&2 ; exit 1 ; }
|
||||
|
||||
# Extract only those USB scanners
|
||||
# Extract only those USB scanners from the scanner database
|
||||
# which are supported by the packages "sane-backends", "iscan-free", or "hplip"
|
||||
# (i.e. not by the proprietary 32-bit-only i386-only "iscan" package)
|
||||
# and which do not require firmware upload (i.e. FIRMWARE field is empty)
|
||||
@ -29,8 +29,8 @@ TMP_DATA=$(mktemp /tmp/$MY_NAME.XXXXXX) || { echo "Error: Failed to make a tempo
|
||||
# which is needed to choose only one driver which is automatically activated
|
||||
# because otherwise a scanner will show up multiple times in scanning frontends
|
||||
# (once for each activated driver which works for this model)
|
||||
# and finally set the usual input field separator ' ' (there are no blanks in BACKEND or USB-ID):
|
||||
bash create_scanner_database ASCII | egrep '^sane-backends|^iscan-free|^hplip' | grep '||[^|]*|0x[0-9A-Fa-f][0-9A-Fa-f]*:0x[0-9A-Fa-f][0-9A-Fa-f]*|' | cut -s -d '|' -f 2,7,8 | egrep 'complete$|good$' | cut -s -d '|' -f 1,2 | sort -u | sort -t '|' -k 2 | tr '|' ' ' >$TMP_DATA
|
||||
# and finally set the usual input field separator ' ' (there are no blanks in BACKEND or USB-ID).
|
||||
egrep '^sane-backends|^iscan-free|^hplip' scanner.database | grep '||[^|]*|0x[0-9A-Fa-f][0-9A-Fa-f]*:0x[0-9A-Fa-f][0-9A-Fa-f]*|' | cut -s -d '|' -f 2,7,8 | egrep 'complete$|good$' | cut -s -d '|' -f 1,2 | sort -u | sort -t '|' -k 2 | tr '|' ' ' >$TMP_DATA
|
||||
|
||||
# Output:
|
||||
|
||||
|
15
install-umax_pp-tool.patch
Normal file
15
install-umax_pp-tool.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- tools/Makefile.in.orig 2008-02-03 07:59:36.000000000 +0100
|
||||
+++ tools/Makefile.in 2008-10-28 12:24:59.000000000 +0100
|
||||
@@ -88,10 +88,11 @@ SUBDIRS = hotplug hotplug-ng udev hal
|
||||
|
||||
all: $(DESTINATIONS)
|
||||
|
||||
-install: sane-config sane-find-scanner gamma4scanimage
|
||||
+install: sane-config sane-find-scanner gamma4scanimage umax_pp
|
||||
$(INSTALL_SCRIPT) sane-config $(DESTDIR)$(bindir)/sane-config
|
||||
$(INSTALL_PROGRAM) sane-find-scanner $(DESTDIR)$(bindir)/sane-find-scanner
|
||||
$(INSTALL_PROGRAM) gamma4scanimage $(DESTDIR)$(bindir)/gamma4scanimage
|
||||
+ $(INSTALL_PROGRAM) umax_pp $(DESTDIR)$(bindir)/umax_pp
|
||||
|
||||
uninstall:
|
||||
rm -f $(bindir)/sane-config $(bindir)/sane-find-scanner $(bindir)/gamma4scanimage
|
@ -1,3 +1,37 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 29 11:34:31 CET 2008 - jsmeix@suse.de
|
||||
|
||||
- Having only models in /etc/udev/rules.d/55-libsane.rules which
|
||||
are in /etc/udev/rules.d/56-sane-backends-autoconfig.rules
|
||||
is too restrictive because libsane.rules disables
|
||||
USB autosuspend in the kernel which is needed as safe default
|
||||
for any scanner regardless of its support status.
|
||||
The only valid exception are unsupported models.
|
||||
Therefore the scanner database is now created directly
|
||||
in the spec file with the file name "scanner.database"
|
||||
so that the scanner database can also be used to determine
|
||||
the "unsupported" models to be disabled in libsane.rules
|
||||
(see Novell/Suse Bugzilla bnc#439193).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 28 12:35:52 CET 2008 - jsmeix@suse.de
|
||||
|
||||
- install-umax_pp-tool.patch installs tools/umax_pp as
|
||||
/usr/bin/umax_pp which is built but not installed
|
||||
but it is needed to recover from a failed scan
|
||||
with scanners which use the umax_pp backend
|
||||
(see the Debian report http://bugs.debian.org/496833).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 28 10:51:00 CET 2008 - jsmeix@suse.de
|
||||
|
||||
- Avoid false positives (e.g. unsupported) and problematic
|
||||
models in /etc/udev/rules.d/55-libsane.rules by having
|
||||
all model entries disabled where the support status is
|
||||
not "complete" or "good", i.e. when it is not listed
|
||||
in /etc/udev/rules.d/56-sane-backends-autoconfig.rules
|
||||
(see Novell/Suse Bugzilla bnc#439193).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 21 13:12:42 CEST 2008 - jsmeix@suse.de
|
||||
|
||||
|
@ -25,7 +25,7 @@ Group: Hardware/Scanner
|
||||
AutoReqProv: on
|
||||
Summary: SANE (Scanner Access Now Easy) Scanner Drivers
|
||||
Version: 1.0.19
|
||||
Release: 94
|
||||
Release: 95
|
||||
Url: http://www.sane-project.org/
|
||||
# URL for Source0: http://alioth.debian.org/frs/download.php/2318/sane-backends-1.0.19.tar.gz
|
||||
Source0: sane-backends-%{version}.tar.bz2
|
||||
@ -95,6 +95,10 @@ Patch101: disable-resmgr-support.patch
|
||||
# The libtool script used in sane-backends is slightly modified to support that.
|
||||
# Patch102 was dropped because there is no reason to build them as libtool modules
|
||||
# and it would make our package incompatible with the rest of the SANE world.
|
||||
# Patch103 installs tools/umax_pp as /usr/bin/umax_pp which is built
|
||||
# but not installed but it is needed to recover from a failed scan
|
||||
# with scanners which use the umax_pp backend, see http://bugs.debian.org/496833
|
||||
Patch103: install-umax_pp-tool.patch
|
||||
# Install into this non-root directory (required when norootforbuild is used):
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
# The postinstall script requires this:
|
||||
@ -280,6 +284,8 @@ Authors:
|
||||
%patch100
|
||||
# Patch101 disables the special resmgr support in SANE (resmgr works now via ACLs):
|
||||
%patch101
|
||||
# Patch103 installs tools/umax_pp as /usr/bin/umax_pp:
|
||||
%patch103
|
||||
# Source100... is SUSE specific stuff:
|
||||
# Remove hpoj.desc completely to avoid confusion with its successor hpaio.desc
|
||||
# because since openSUSE 10.3 the package hp-officeJet (for hpoj.desc) is dropped.
|
||||
@ -398,6 +404,35 @@ done
|
||||
sed -i -e 's/^:interface "USB".*$/&\n:firmware "required"/' %{buildroot}%{_datadir}/sane/descriptions/snapscan.desc
|
||||
# Only the "SnapScan 1236u" needs no firmware upload (see Suse/Novell bug #73960):
|
||||
sed -i -e '/:model "SnapScan 1236u"/,/:firmware "required"/s/required//' %{buildroot}%{_datadir}/sane/descriptions/snapscan.desc
|
||||
# Scanner autoconfiguration stuff (packaged in sane-backends-autoconfig):
|
||||
# It must be done before the udev libsane.rules stuff because the scanner database is needed there.
|
||||
# This requires the installed descriptions and descriptions-external files
|
||||
# because create_scanner_database reads the description files to extract the needed info
|
||||
# to create the scanner database from which create_sane-backends-autoconfig.rules
|
||||
# extracts the needed info to generate the 56-sane-backends-autoconfig.rules file
|
||||
# for automated scanner driver activation via udev.
|
||||
# Note that driver activation alone is not sufficient
|
||||
# to have a usable "scanner autoconfiguration" for the user.
|
||||
# What is also needed are appropriate USB device file permissions
|
||||
# so that the user's scanning software can access the device.
|
||||
# But this is already in place via the HAL 70-scanner.fdi file
|
||||
# which contains a superset of USB scanner IDs (all known USB scanner IDs)
|
||||
# compared to the USB scanner IDs in 56-sane-backends-autoconfig.rules,
|
||||
# see create_sane-backends-autoconfig.rules for which USB scanners
|
||||
# automated driver activation is done (basically only those scanners
|
||||
# which are supported by a free driver, which do not require firmware upload,
|
||||
# and where the support status is "complete" or "good").
|
||||
# Modify create_scanner_database to find the description files in the BuildRoot directory
|
||||
# (the usual delimiter '/' cannot be used because buildroot contains it too):
|
||||
sed -i -e 's|/usr/share/sane/descriptions|%{buildroot}/usr/share/sane/descriptions|' %{SOURCE200}
|
||||
# Create the scanner database (it is also needed later to disable "unsupported" model entries in libsane.rules).
|
||||
# The scanner database file name "scanner.database" is used hardcoded in create_sane-backends-autoconfig.rules.
|
||||
bash %{SOURCE200} >scanner.database
|
||||
# Run create_sane-backends-autoconfig.rules:
|
||||
bash %{SOURCE201} >autoconfig.rules
|
||||
# Install the scanner autoconfiguration udev rules file:
|
||||
install -d %{buildroot}%{_sysconfdir}/udev/rules.d
|
||||
install -m644 autoconfig.rules %{buildroot}%{_sysconfdir}/udev/rules.d/56-sane-backends-autoconfig.rules
|
||||
# Since version 1.0.19 there is udev and HAL support.
|
||||
# Therefore the old/outdated hotplug stuff is dropped (was never used by openSUSE).
|
||||
# Neither tools/hotplug/libsane.usermap nor tools/hotplug/libusbscanner is installed.
|
||||
@ -427,8 +462,25 @@ sed -i -e 's/GROUP="scanner"/GROUP="lp"/' tools/udev/libsane.rules
|
||||
sed -i -e '/^SUBSYSTEM/s/"usb_device"/"usb"/' tools/udev/libsane.rules
|
||||
sed -i -e 's/SYSFS/ATTR/g' tools/udev/libsane.rules
|
||||
sed -i -e 's/^ENV{DEVTYPE}/# ENV{DEVTYPE}/' tools/udev/libsane.rules
|
||||
# Disable entries for USB scanners which are "unsupported"
|
||||
# but keep the entries for models for which the support status
|
||||
# is "complete", "good", "basic", "minimal", "untested"
|
||||
# because libsane.rules disables USB autosuspend
|
||||
# which is needed as safe default for any scanner
|
||||
# (regardless to what extent it is actually supported).
|
||||
# The only exception are unsupported models
|
||||
# because it seems to be wrong to have "known but unsupported" devices
|
||||
# listed in the libsane.rules file because it seems not to make sense
|
||||
# to set owner, group, and permissions for devices which are not
|
||||
# supported by SANE which would even cause conflicts if such a
|
||||
# device is supported by whatever other software,
|
||||
# see https://bugzilla.novell.com/show_bug.cgi?id=439193
|
||||
# Ignore case when using sed to avoid possible problems
|
||||
# with upper case letters in the USB IDs:
|
||||
for m in $( grep '||[^|]*|0x[0-9A-Fa-f][0-9A-Fa-f]*:0x[0-9A-Fa-f][0-9A-Fa-f]*|unsupported' scanner.database | cut -s -d '|' -f 7 | sort -f -u | sed -e 's/0x/./ig' -e 's/:/.,.ATTR.idProduct.==/' )
|
||||
do sed -i -e "/^ATTR.idVendor.==$m/Is/^ATTR/# ATTR/" tools/udev/libsane.rules
|
||||
done
|
||||
# Install the udev rules file:
|
||||
install -d %{buildroot}%{_sysconfdir}/udev/rules.d
|
||||
install -m644 tools/udev/libsane.rules %{buildroot}%{_sysconfdir}/udev/rules.d/55-libsane.rules
|
||||
# Regarding HAL:
|
||||
# Modify the generated tools/hal/libsane.fdi file as follows:
|
||||
@ -469,33 +521,6 @@ install -m644 %{SOURCE101} %{buildroot}%{_sysconfdir}/xinetd.d/
|
||||
# OpenSLP registration stuff:
|
||||
install -d -m755 %{buildroot}%{_sysconfdir}/slp.reg.d
|
||||
install -m644 %{SOURCE102} %{buildroot}%{_sysconfdir}/slp.reg.d
|
||||
# Scanner autoconfiguration stuff (packaged in sane-backends-autoconfig):
|
||||
# This requires the installed descriptions and descriptions-external files
|
||||
# because create_sane-backends-autoconfig.rules calls create_scanner_database
|
||||
# which reads the description files to extract the needed info from which
|
||||
# it generates the 56-sane-backends-autoconfig.rules file
|
||||
# for automated scanner driver activation via udev.
|
||||
# Note that driver activation alone is not sufficient
|
||||
# to have a usable "scanner autoconfiguration" for the user.
|
||||
# What is also needed are appropriate USB device file permissions
|
||||
# so that the user's scanning software can access the device.
|
||||
# But this is already in place via the HAL 70-scanner.fdi file
|
||||
# which contains a superset of USB scanner IDs (all known USB scanner IDs)
|
||||
# compared to the USB scanner IDs in 56-sane-backends-autoconfig.rules,
|
||||
# see create_sane-backends-autoconfig.rules for which USB scanners
|
||||
# automated driver activation is done (basically only those scanners
|
||||
# which are supported by a free driver, which do not require firmware upload,
|
||||
# and where the support status is "complete" or "good").
|
||||
# Modify create_scanner_database to find the description files in the BuildRoot directory
|
||||
# (the usual delimiter '/' cannot be used because buildroot contains it too):
|
||||
sed -i -e 's|/usr/share/sane/descriptions|%{buildroot}/usr/share/sane/descriptions|' %{SOURCE200}
|
||||
# Modify create_sane-backends-autoconfig.rules to call create_scanner_database with the right path
|
||||
# (the usual delimiter '/' cannot be used because SOURCE200 contains it too):
|
||||
sed -i -e 's|^bash create_scanner_database|bash %{SOURCE200}|' %{SOURCE201}
|
||||
# Run it:
|
||||
bash %{SOURCE201} >autoconfig.rules
|
||||
# Install the scanner autoconfiguration udev rules file:
|
||||
install -m644 autoconfig.rules %{buildroot}%{_sysconfdir}/udev/rules.d/56-sane-backends-autoconfig.rules
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
@ -524,6 +549,7 @@ exit 0
|
||||
%{_bindir}/sane-config
|
||||
%{_bindir}/sane-find-scanner
|
||||
%{_bindir}/gamma4scanimage
|
||||
%{_bindir}/umax_pp
|
||||
%{_datadir}/locale/*/LC_MESSAGES/sane-backends.mo
|
||||
%{_datadir}/sane/
|
||||
%{_libdir}/libsane*
|
||||
@ -546,6 +572,31 @@ exit 0
|
||||
%{_sysconfdir}/udev/rules.d/56-sane-backends-autoconfig.rules
|
||||
|
||||
%changelog
|
||||
* Wed Oct 29 2008 jsmeix@suse.de
|
||||
- Having only models in /etc/udev/rules.d/55-libsane.rules which
|
||||
are in /etc/udev/rules.d/56-sane-backends-autoconfig.rules
|
||||
is too restrictive because libsane.rules disables
|
||||
USB autosuspend in the kernel which is needed as safe default
|
||||
for any scanner regardless of its support status.
|
||||
The only valid exception are unsupported models.
|
||||
Therefore the scanner database is now created directly
|
||||
in the spec file with the file name "scanner.database"
|
||||
so that the scanner database can also be used to determine
|
||||
the "unsupported" models to be disabled in libsane.rules
|
||||
(see Novell/Suse Bugzilla bnc#439193).
|
||||
* Tue Oct 28 2008 jsmeix@suse.de
|
||||
- install-umax_pp-tool.patch installs tools/umax_pp as
|
||||
/usr/bin/umax_pp which is built but not installed
|
||||
but it is needed to recover from a failed scan
|
||||
with scanners which use the umax_pp backend
|
||||
(see the Debian report http://bugs.debian.org/496833).
|
||||
* Tue Oct 28 2008 jsmeix@suse.de
|
||||
- Avoid false positives (e.g. unsupported) and problematic
|
||||
models in /etc/udev/rules.d/55-libsane.rules by having
|
||||
all model entries disabled where the support status is
|
||||
not "complete" or "good", i.e. when it is not listed
|
||||
in /etc/udev/rules.d/56-sane-backends-autoconfig.rules
|
||||
(see Novell/Suse Bugzilla bnc#439193).
|
||||
* Tue Oct 21 2008 jsmeix@suse.de
|
||||
- Changed /etc/udev/rules.d/55-libsane.rules to jump to the end
|
||||
if SUBSYSTEM!="usb" and replaced SYSFS by ATTR and did
|
||||
@ -915,7 +966,7 @@ exit 0
|
||||
- use $HOSTNAME instead of $LOCALHOST in slp reg file
|
||||
* Fri Nov 14 2003 adrian@suse.de
|
||||
- use correct keyword "X-UnitedLinux-Should-Start" in runlevel script
|
||||
* Fri Nov 14 2003 adrian@suse.de
|
||||
* Thu Nov 13 2003 adrian@suse.de
|
||||
- add xinetd file for sane daemon
|
||||
- let slpd check for running saned via (x)inetd
|
||||
- notify slpd, if using saned init script
|
||||
|
Loading…
Reference in New Issue
Block a user