Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Evergreen:11.2:Test
sane-backends
sane-backends.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sane-backends.spec of Package sane-backends
# # spec file for package sane-backends (Version 1.0.20) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: sane-backends BuildRequires: libgphoto2-devel libieee1284 libjpeg-devel net-snmp-devel pkg-config texlive-latex License: GPL v2 only ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware Group: Hardware/Scanner AutoReqProv: on Summary: SANE (Scanner Access Now Easy) Scanner Drivers Version: 1.0.20 Release: 7 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 # Source100... is SUSE specific stuff: # Source100 is the evil-hack init-script "sane-dev" to grant scanner access permissions. # Source100 is no longer provided because sane-backends-1.0.19 has udev and HAL support. # Source101 is the xinetd file for the saned: Source101: sane-port # Source102 is the OpenSLP registration file for the saned: Source102: sane.reg # Since openSUSE 10.3 "Source103: hpoj.desc" is dropped because the package hp-officeJet is dropped. # Source104 was our hpaio.desc file which was derived from scan/sane/hpaio.desc from the hplip sources # but as scan/sane/hpaio.desc was completely messed up Source104 is now dropped and we # create our hpaio.desc file directly from the models.dat file of HPLIP via Source109 and Source110. # Original iscan descriptions-external file for the epkowa backend (provided by the package iscan). # This file is a copy of doc/epkowa.desc in the sources of the iscan package: Source105: epkowa.desc # Since openSUSE 10.3 "Source106: create_hal_global_fdi_for_scanners" is dropped because # it is replaced by "Source108: create_hal_global_fdi_from_libsane.rules". # Source107 are readymade udev rules for openSUSE 10.3 derived from sane-backends 1.0.18-cvs. # Source107 is obsolete since sane-backends-1.0.19 because it has udev and HAL support. # Source108 is a script which outputs a HAL fdi file. # Source108 is obsolete since sane-backends-1.0.19 because it has udev and HAL support. # We create our hpaio.desc file directly from the models.dat file of HPLIP: Source109: create_hpaio.desc_from_models.dat Source110: models.dat # Source200... is scanner autoconfiguration stuff: # Source200 and Source201 generate the 56-sane-backends-autoconfig.rules file # for automated scanner driver activation via udev ("scanner autoconfiguration"). # Source200 is a copy of /usr/lib/YaST2/bin/create_scanner_database # to avoid yast2-scanner in BuildRequires which would drag in almost the whole YaST: Source200: create_scanner_database # Source201 actually generates the 56-sane-backends-autoconfig.rules file # by reading scanner.database which was created before by create_scanner_database # to extract the needed info from which create_sane-backends-autoconfig.rules # generates the 56-sane-backends-autoconfig.rules file: Source201: create_sane-backends-autoconfig.rules # Patch1 does locale rename: no -> nb: # Patch1 is obsolete since sane-backends-1.0.19 because it uses 'nb'. # Patch2 fixes too small arrays in backend/niash.c: Patch2: fix-buffer-overflow.patch # Patch3 replaces fixed HZ compile-time value by sysconf(_SC_CLK_TCK) runtime value: # Patch3 is obsolete since sane-backends-1.0.19 because it is fixed in the source. # Patch4 disables hw_ink_remain which causes a buffer overflow in fujitsu.c: # Patch4 is obsolete since sane-backends-1.0.19 because it is fixed in the source. # Patch5 fixes uninitialized variables in avision.c: # Patch5 is obsolete since sane-backends-1.0.20 because it is fixed in the source. # Patch6 fixes an ambiguous post/pre increment in canon-sane.c: # Patch6 is obsolete since sane-backends-1.0.19 because it is fixed in the source. # Patch7 lets sanei_scsi_find_devices continue on to look at subsequent devices # if the attach callback returns anything other than SANE_STATUS_GOOD: # Patch7 is obsolete since sane-backends-1.0.20 because it is fixed in the source. # Patch8 re-adds SANE_CAP_ALWAYS_SETTABLE to sane.h which was erroneously # removed in sane-backends-1.0.20 so that sane-frontends and xsane can no longer build, # see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527675 Patch8: re-add-SANE_CAP_ALWAYS_SETTABLE.patch # Patch9 fixes a possible for loop overflow in hp3900_config.c # see https://bugzilla.novell.com/show_bug.cgi?id=517281 Patch9: fix-hp3900_config.c.patch # Patch10 fixes undefined 'foo = ++foo modulo bar' operations in mustek_pp_ccd300.c # see https://bugzilla.novell.com/show_bug.cgi?id=498435 Patch10: fix-mustek_pp_ccd300.c.patch # Patch11 adds missing call to closedir to sane-desc.c # see https://bugzilla.novell.com/show_bug.cgi?id=530313 Patch11: sane-desc_closedir.patch # Patch12 adds a missing call to free in backend/lexmark_low.c # in the sanei_lexmark_low_find_start_line function # see https://bugzilla.novell.com/show_bug.cgi?id=542341 Patch12: fix-lexmark_low-memory-leak.patch # Patch13 fixes option sizes in backend/hp3900_sane.c # because otherwise the frontend (e.g. xsane) may crash # see https://bugzilla.novell.com/show_bug.cgi?id=535752 Patch13: fix-hp3900_sane-string-option-sizes.diff # Patch100... is SUSE specific stuff: # Patch100 lets the "canon" backend do scanner auto-recognition: Patch100: canon-backend-autoprobing.patch # Patch101 disables the special resmgr support in SANE (resmgr works now via ACLs): Patch101: disable-resmgr-support.patch # Patch102 builds libsane-* modules as libtool modules: # SANE backends (i.e. driver modules) are regular shared libraries. # Nothing is linked directly with a /usr/lib/sane/libsane-<driver>.so module. # In particular scanning frontends (like scanimage, xscanimage, xsane, kooka) # are linked with libsane.so.1 which is the dll meta-backend which dlopen()s the # driver modules according to which drivers are activated in /etc/sane.d/dll.conf. # One could "cp /usr/lib/sane/libsane-<driver>.so /usr/lib/libsane.so" # and scanning would also work (but now one can use only this single driver). # 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 # Patch104 removes descriptions-external/hpoj.desc from doc/Makefile.am # because it is intentionally removed from the sources in the prep section: Patch104: no-descriptions-external-hpoj.patch # backport post 1.0.20 xerox_mfp changes. remove with next sane version Patch105: sane-backends-1.0.20-xerox_mfp.diff # Install into this non-root directory (required when norootforbuild is used): BuildRoot: %{_tmppath}/%{name}-%{version}-build # The postinstall script requires this: PreReq: coreutils, /bin/sed, /bin/grep # See https://bugzilla.novell.com/show_bug.cgi?id=437293 %ifarch ppc64 Obsoletes: sane-64bit %endif # # Suse Linux and openSUSE have the package name 'sane' for 'sane-backends'. # Therefore this RPM provides 'sane' and it also obsoletes it: Provides: sane Obsoletes: sane # Skip testing devel dependencies required by libtool .la files by the following comment: # skip-check-libtool-deps %description The software consists of SANE scanner drivers, "scanimage," and the "saned" daemon. A SANE scanner driver is used via a SANE front-end. This package contains the command line front-end "scanimage". There are various graphical front-ends like "xscanimage" (package sane-frontends), XSane (package xsane), and the KDE front-end Kooka (package kdegraphics3-scan). The "saned" daemon provides the service "sane-port" to access scanners that are connected to a server via network from client hosts that run the "net" meta driver. Authors: -------- Abel Deuring <a.deuring@satzbau-gmbh.de> Andras Major <andras@users.sourceforge.net> Andreas Beck <becka@uni-duesseldorf.de> Andreas Bolsch <ab@maths.nott.ac.uk> Andreas Czechanowski <m075@ins.uni-stuttgart.de> Andreas Nowack <nowack.andreas@gmx.de> Andreas Rick <andreas.rick@free.fr> Andrew Kuchling <amk@magnet.com> Bernd Schroeder <bernd@aquila.muc.de> Bertrik Sikken <bertrik@zonnet.nl> Brian J. Murrell <brian@interlinx.bc.ca> Chris Bagwell <cbagwell@users.sourceforge.net> Chris Pinkham <cpinkham@corp.infi.net> Christian Bucher <cbucher@vernetzt.at> David Etherton <etherton@netcom.com> David F. Skoll <dskoll@iname.com> David Huggins-Daines <bn711@freenet.carleton.ca> David Mosberger <David.Mosberger@acm.org> David Stevenson <david.stevenson@zoom.co.uk> Didier Carlier <didier@sema.be> Earle F. Philhower III <earle@ziplabel.com> Eddy De Greef <eddy_de_greef@scarlet.be> Eugene S. Weiss <yossarian@users.sourceforge.net> Feico W. Dillema <dillema@acm.org> Franck Schneider <schnefra@hol.fr> Frank Zago <sane@zago.net> Frederik Ramm <frederik@remote.org> Fred Odendaal <freshshelf@rogers.com> Gerard Klaver <gerard@gkall.hobby.nl> Gerhard Jaeger <gerhard@gjaeger.de> Giuseppe Sacco <eppesuig@debian.org> Glenn Ramsey <glenn@componic.com> Gordon Matzigkeit <gord@gnu.ai.mit.edu> Guido Muesch <odiug@faho.rwth-aachen.de> Helmut Koeberle <helmut.koeberle@bytec.de> Henning Geinitz <sane@geinitz.org> Henrik Johansson <henrikjo@post.urfors.se> Ilia Sotnikov <hostcc@gmail.com> Ingo Schneider <schneidi@informatik.tu-muenchen.de> Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de> James Perry <jamesp@epcc.ed.ac.uk> Jeff Freedman <jsf@hevanet.com> Jochen Eisinger <jochen.eisinger@gmx.net> Jonathan Bravo Lopez <jkdsoft@gmail.com> Jon Chambers <jon@jon.demon.co.uk> Juergen G. Schimmer <schimmi@nbgm.siemens.de> Julien Blache <jb@jblache.org> Karl Anders Oygard <karlo@opera.no> Karl Heinz Kremer <khk@khk.net> Karsten Festag <karsten.festag@gmx.de> Kazuhiro Sasayama <kaz@hypercore.co.jp> Kazuya Fukuda <kaafuu@mug.biglobe.ne.jp> Kevin Charter <charter@cs.rice.edu> M. Allan Noah <kitno455@gmail.com> Manuel Panea <Manuel.Panea@rzg.mpg.de> Marcio Teixeira <marciot@users.sourceforge.net> Marian Eichholz <eichholz@computer.org> Markus Mertinat <Markus.Mertinat@Physik.Uni-Augsburg.DE> Martijn van Oosterhout <kleptog@svana.org> Matthew Duggan <stauff1@users.sourceforge.net> Matthew Marjanovic <maddog@mir.com> Mattias Ellert <mattias.ellert@tsl.uu.se> Max Vorobiev <pcwizard@yandex.ru> Meino Christian Cramer <mccramer@s.netic.de> M.F. <massifr@tiscalinet.it> Michael Herder <crapmail@nurfuerspam.de> Michael K. Johnson <johnsonm@redhat.com> Michel Roelofs <michelr@stack.nl> Milon Firikis <milonf@ariadne-t.gr> Mitsuru Okaniwa <m-okaniwa@bea.hi-ho.ne.jp> Nathan Rutman <nathan@gordian.com> Oliver Rauch <Oliver.Rauch@Rauch-domain.de> Oliver Schirrmeister <oschirr@abm.de> Oliver Schwartz <oliverschwartz@users.sourceforge.net> Patrick Lessard <palessar@cgocable.ca> Patrick Reynolds <patrickr@virginia.edu> Peter Fales <peter@fales-lorenz.net> Peter Kirchgessner <peter@kirchgessner.net> Petter Reinholdtsen <pere@hungry.com> Pierre Willenbrock <pierre@pirsoft.dnsalias.org> Randolph Bentson <bentson@grieg.holmsjoen.com> Rene Rebe <rene@exactcode.de> Roger Wolff <R.E.Wolff@BitWizard.nl> Roy Zhou <Roy@mail.mustek-hz.com.cn> Sebastien Sable <Sebastien.Sable@snv.jussieu.fr> Sergey Vlasov <vsu@altlinux.ru> Simon Krix <kinsei@users.sourceforge.net> Simon Munton <simon@munton.demon.co.uk> Stephane Voltz <stef.dev@free.fr> Thomas Soumarmon <soumarmt@nerim.net> Tom Martone <tom@martoneconsulting.com> Tom Wang <tom.wang@mustek.com.tw> Tristan Tarrant <ttarrant@etnoteam.it> Troy Rollo <sane@troy.rollo.name> Ullrich Sigwanz <usigwanz@freesurf.ch> Ulrich Deiters <ukd@xenon.pc.Uni-Koeln.DE> Wittawat Yamwong <wittawat@web.de> %package autoconfig License: GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware Group: Hardware/Scanner Summary: USB Scanner Autoconfiguration Requires: sane-backends # When sane-backends is already installed, try to install also sane-backends-autoconfig if available: Supplements: sane-backends %description autoconfig USB scanner autoconfiguration happens via udev. The file /etc/udev/rules.d/56-sane-backends-autoconfig.rules contains entries for those USB scanners where the USB IDs are known, which are supported by a free driver, where the support status is "complete" or "good", and which do not require firmware upload. When a USB scanner is connected and its USB IDs match to an entry in the 56-sane-backends-autoconfig.rules file, the matching scanner driver is activated (i.e. the driver line in /etc/sane.d/dll.conf is activated). It enables scanner drivers but never disables them. The reason is that enabled drivers do not hurt so that an automated disable would make it only overcomplicated because when more than one scanner uses the same driver, a complicated check would be needed to avoid that the driver is accidentally disabled when only one scanner was disconnected. 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 triggers the resmgr to grant access permissions for the user who is currently locally logged in (i.e. who works directly at the computer where the USB scanner is). If you do not like automated driver activation, do not install this package or remove it when it is already installed. Authors: -------- Johannes Meixner <jsmeix@novell.com> %prep %setup -q # Patch2 fixes too small arrays in backend/niash.c: %patch2 # Patch8 re-adds SANE_CAP_ALWAYS_SETTABLE to sane.h which was erroneously removed: %patch8 # Patch9 fixes a possible for loop overflow in hp3900_config.c: %patch9 # Patch10 fixes undefined 'foo = ++foo modulo bar' operations in mustek_pp_ccd300.c: %patch10 # Patch11 adds missing call to closedir to sane-desc.c: %patch11 # Patch12 adds a missing call to free in backend/lexmark_low.c: %patch12 # Patch13 fixes option sizes in backend/hp3900_sane.c %patch13 -p1 # Patch100... is SUSE specific stuff: # Patch100 lets the "canon" backend do scanner auto-recognition: %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 # Patch104 removes descriptions-external/hpoj.desc from doc/Makefile.am # because it is intentionally removed from the sources in the prep section: %patch104 %patch105 -p1 # 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. rm doc/descriptions-external/hpoj.desc # Replace epkowa.desc descriptions-external file by the version from the iscan package. # For compliance with the other description files in the sane-backends sources # (epson2.desc, epson.desc, plustek.desc, snapscan.desc, umax.desc, unsupported.desc) # the manufacturer name is changed from "EPSON" to "Epson": sed -e '/^:mfg/s/EPSON/Epson/' %{SOURCE105} >doc/descriptions-external/epkowa.desc # For compliance with the other description files in the sane-backends sources # change the manufacturer name from "Hewlett Packard" to "Hewlett-Packard": for d in doc/descriptions-external/hp3770.desc doc/descriptions-external/hp8200.desc do sed -i -e '/^:mfg/s/Hewlett Packard/Hewlett-Packard/' $d done # Create our hpaio.desc descriptions-external file # (use it as bash input because sources may be installed without execute permissions): bash %{SOURCE109} <%{SOURCE110} >doc/descriptions-external/hpaio.desc # Copy the create_scanner_database script from the sources directory to the build directory # to avoid that the original source becomes modified later in the install section # and ends up in the source RPM, see https://bugzilla.novell.com/show_bug.cgi?id=463464#c11 cp %{SOURCE200} create_scanner_database chmod u+x create_scanner_database %build %{?suse_update_config:%{suse_update_config -f}} # 'autoreconf -fi' failed for sane-backends-1.0.19 with the message: # "aclocal: acinclude.m4:606: file m4/libtool.m4 does not exist". # The m4 dir from CVS was not included in the 1.0.18 tar, so it was # not included in 1.0.19 either, but it has new files since 1.0.18. # It is a bit strange because autoconf never complained before. # Because it is not clear whether or not 'autoreconf -fi' is best # and because it builds without it, it was simply disabled for sane-backends-1.0.19. # Now sane-backends-1.0.20 provides a new automake compatible build system # so that 'autoreconf -fi' works again: autoreconf -fi export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -DGIMP_ENABLE_COMPAT_CRUFT=1 -fno-strict-aliasing" export LDFLAGS="-L/%_lib $LDFLAGS" # Disable locking because /var/lock/sane/ would be a world-writable directory: ./configure --prefix=/usr \ --exec-prefix=/usr \ --sysconfdir=%{_sysconfdir} \ --libdir=%{_libdir} \ --sbindir=%{_sbindir} \ --mandir=%{_mandir} \ --datadir=%{_datadir} \ --with-gphoto2 \ --with-docdir=%{_defaultdocdir}/sane-backends \ --disable-locking # Enable locking for backends where "99" is the group of the lockfile path (LOCKPATH_GROUP) # because "99" is the group of the user who runs the build when norootforbuild is used # and set localstatedir to have the lock files in /var/lock/sane (see backend/Makefile.in). # Disabled because locking requires a world-writable /var/lock/sane/ directory: # --enable-locking \ # --with-group=99 \ # --localstatedir=/var make %install make install DESTDIR=%{buildroot} # The actual driver modules are installed as libsane-<driver>.so.%{version} # and two libsane-<driver>.so.1 and libsane-<driver>.so links point to them. # Additionally a libsane-<driver>.la libtool archive file is installed # which could be used to find the correct module file name to dlopen the module. # Only the dll meta-backend (/usr/lib/libsane.so.1.0.19) links with driver modules. # The dll meta-backend looks only for libsane-<driver>.so.1 and uses dlopen(3) directly. # The dll meta-backend needs neither libsane-<driver>.so nor libsane-<driver>.la. # RPMLINT complains about libsane-<driver>.so with "devel-file-in-non-devel-package". # Therefore the libsane-<driver>.so and libsane-<driver>.la files are simply removed. # Note that those files for the dll meta-backend /usr/lib/libsane.so and /usr/lib/libsane.la # are not removed because it is unknown how whatever third-party scanning frontend # may like to link with SANE (i.e. with the dll meta-backend). rm %{buildroot}%{_libdir}/sane/libsane-*.so rm %{buildroot}%{_libdir}/sane/libsane-*.la # Disable all backends in /etc/sane.d/dll.conf to avoid problems when backends are active by default: perl -pi -e 's/^([^#].*)$/#$1/' %{buildroot}%{_sysconfdir}/sane.d/dll.conf # Allow all users to write into /var/lock/sane/ so that the backends work for normal users # and set the sticky bit (i.e. others are not allowed to remove lock files). # Disabled because package-specific world-writable directories are not allowed: #chmod 1777 %{buildroot}/var/lock/sane/ # Install the descriptions and descriptions-external files. # These files are the sources to make %{_defaultdocdir}/sane/sane-backends/*.html # but these source files must also exist in the installed sane package # because YaST needs them to create its scanner database: for d in descriptions descriptions-external do install -d -m755 %{buildroot}%{_datadir}/sane/$d install -m644 doc/$d/*.desc %{buildroot}%{_datadir}/sane/$d done # Add ':firmware "required"' entries for the respective scanners to the descriptions files # so that YaST can show firmware upload related information to the user of such a scanner. # This must be done after build because those entries are a SUSE specific extension. # To determine scanners which require firmware upload, search the man pages # for backends which provide support for firmware upload. # Use a command like # for m in /usr/share/man/man5/sane-* # do man -E ascii -P cat -l $m 2>/dev/null | grep -q -i firmware && echo $m # done # to find backend man pages which mention "firmware". # In version 1.0.19 the following man pages mention "firmware": # sane-agfafocus: mentiones only "firmware revision" (no firmware upload) # sane-apple: mentiones only "firmware revision" (no firmware upload) # sane-artec: mentiones only "problems with firmware v1.92" (no firmware upload) # sane-artec_eplus48u: "you need a firmware file for your scanner" (unconditioned firmware upload) # sane-bh: mentiones only "requires RSC firmware level 1.5" (no firmware upload) # sane-epjitsu: "these scanners require a firmware file" (unconditioned firmware upload) # sane-gt68xx: "you need a firmware file for your scanner" (unconditioned firmware upload) # sane-hp: mentiones only "no firmware support for contrast" (no firmware upload) # sane-matsushita: mentiones only "scanner with proper firmware" (no firmware upload) # sane-microtek2: mentiones only "firmware of the scanner provides" (no firmware upload) # sane-sharp: mentiones only "bug in the firmware" (no firmware upload) # sane-snapscan: "USB scanners ... scanners that need a firmware upload" (conditioned firmware upload) # sane-st400: mentiones only "firmware revision" (no firmware upload) # sane-teco2: mentiones only "firmware 1.09" (no firmware upload) # As far as we know all scanners which use # the backend gt68xx and the related backend artec_eplus48u # or the backend epjitsu require a firmware upload, # see "man sane-gt68xx" and http://www.meier-geinitz.de/sane/gt68xx-backend/ # and see "man sane-artec_eplus48u" and "man sane-epjitsu": for b in gt68xx artec_eplus48u epjitsu do sed -i -e 's/^:model.*$/&\n:firmware "required"/' %{buildroot}%{_datadir}/sane/descriptions/$b.desc done # As far as we know (almost) all USB scanners (but not the SCSI scanners) # which use the backend snapscan require a firmware upload, # see "man sane-snapscan" and http://snapscan.sourceforge.net/: 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|' create_scanner_database # Create the scanner database and store it because it is also needed later # to disable "unsupported" model entries both in the udev rules file libsane.rules # and in the HAL fdi file 70-scanner.fdi. # The file name "scanner.database" is used hardcoded in create_sane-backends-autoconfig.rules. ./create_scanner_database >scanner.database # Run create_sane-backends-autoconfig.rules which reads scanner.database # (use it as bash input because sources may be installed without execute permissions): 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. # Also the evil-hack init-script "sane-dev" is no longer provided. # Regarding udev: # Modify the generated tools/udev/libsane.rules file as follows: # All GROUP="scanner" are replaced by GROUP="lp" and # SUBSYSTEM=="usb" is added before the SUBSYSTEM=="usb_device" test # but the latter is kept for backward compatibility. # The reasons are: # There is no group "scanner" in /etc/group for openSUSE. # For all-in-one devices (i.e. printer + scanner, e.g. "EPSON Stylus" devices) # the group must be "lp" so that the CUPS usb backend which runs # as user "lp" (who is member of the group "lp") can send printing data # to the printer unit (i.e. the printer interface of the USB device). # It is sufficiently secure and reasonable easy to use by default # the same group "lp" for printers and scanners because both kind of devices # usually require physical user access (to get the printed paper or # to place a paper on the scanner) so that both kind of devices # should usually require the same kind of security. # Regarding SUBSYSTEM=="usb" see the Novell/Suse Bugzilla bug # https://bugzilla.novell.com/show_bug.cgi?id=294161#c11 # Regarding SYSFS{} versus ATTR{} see the Novell/Suse Bugzilla bug # https://bugzilla.novell.com/show_bug.cgi?id=436085#c0 # Disable all ENV{DEVTYPE} lines because we (Suse/Novell) do not need them. 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 # Extract a list of USB IDs for "unsupported" scanners # and store it because it is also needed later to # disable "unsupported" model entries in the HAL fdi file 70-scanner.fdi # It can happen that there is a status "unsupported" entry for a backend # for a model which is actually supported by another backend, for example # the "Epson Perfection 1670" is "unsupported" by the "epkowa" backend # but works "good" with the "snapscan" backend # see https://bugzilla.novell.com/show_bug.cgi?id=439193#c6 cat /dev/null >unsupportedUSBIDs for USBID 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 ) do grep -o "|$USBID|.*|" scanner.database | egrep -q 'complete|good|basic|minimal|untested' || echo $USBID >>unsupportedUSBIDs done # Ignore case when using sed to avoid possible problems # with upper case letters in the USB IDs: for m in $( sed -e 's/0x/./ig' -e 's/:/.,.ATTR.idProduct.==/' unsupportedUSBIDs ) do sed -i -e "/^ATTR.idVendor.==$m/Is/^ATTR/# ATTR/" tools/udev/libsane.rules done # Install the udev rules file: 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: # Remove 'key="scanner.access_method"' lines. sed -i -e '/key="scanner.access_method"/d' tools/hal/libsane.fdi # There is a small number of USB scanners which are not talked to via libusb. # They talk an unusual protocol which is a derivative of usb storage. # User space should treat them as SCSI scanners. # Furthermore, granting access via libusb here could oops the kernel. # Therefore USB user access for those scanners must be disabled. # See the Novell/Suse Bugzilla bug # https://bugzilla.novell.com/show_bug.cgi?id=341565 # This is done by replacing the append of "scanner" to info.capabilities by "SCSIviaUSBscanner". # This way the YaST scanner module can inspect 70-scanner.fdi to learn which models # it must not add to 80-scanner.fdi (i.e. the explicitely marked as "SCSIviaUSBscanner" models). # Currently there are no hexadecimal numbers in libsane.fdi with uppercase letters # nevertheless to be safe the GNU sed extension to ignore case for pattern matching is used: sed -i -e '/usb.vendor_id.*0x04ce/I,/append key/{/usb.product_id.*0x0300/I,/append key/s/scanner/SCSIviaUSBscanner/g}' tools/hal/libsane.fdi for ID in 0094 0099 009a 00a0 00a3 80a3 80ac 00b6 do sed -i -e "/usb.vendor_id.*0x05da/I,/append key/{/usb.product_id.*0x$ID/I,/append key/s/scanner/SCSIviaUSBscanner/g}" tools/hal/libsane.fdi done # 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 the HAL fdi file is used to grant normal user access # for scanner devices which is needed 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 HAL fdi file because it seems not to make sense # to grant normal user access 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=444158 # Currently there are no hexadecimal numbers in libsane.fdi with uppercase letters # nevertheless to be safe the GNU sed extension to ignore case for pattern matching is used: for ID in $( cat unsupportedUSBIDs ) do V="$( echo $ID | cut -d : -s -f 1 )" P="$( echo $ID | cut -d : -s -f 2 )" sed -i -e "/usb.vendor_id.*$V/I,/info.capabilities/{/usb.product_id.*$P/I,/info.capabilities/{s/<append/<!-- <append/;s/append>/append> -->/}}" tools/hal/libsane.fdi done %if 0%{?suse_version} < 1110 # for hal-resmgr # Replace 'key="info.bus" string="usb"' by 'key="info.subsystem" string="usb_device"', # and replace 'key="usb.vendor_id"' by 'key="usb_device.vendor_id"', # and replace 'key="usb.product_id"' by 'key="usb_device.product_id"', # see the Novell/Suse Bugzilla bug # https://bugzilla.novell.com/show_bug.cgi?id=250659 sed -i -e 's/key="info.bus" string="usb"/key="info.subsystem" string="usb_device"/' tools/hal/libsane.fdi sed -i -e 's/key="usb.vendor_id"/key="usb_device.vendor_id"/' tools/hal/libsane.fdi sed -i -e 's/key="usb.product_id"/key="usb_device.product_id"/' tools/hal/libsane.fdi %else # for hal-acl-tool # https://bugzilla.novell.com/show_bug.cgi?id=438867 sed -i -e 's/key="info.bus" string="usb"/key="info.subsystem" string="usb"/' tools/hal/libsane.fdi %endif # Install the HAL fdi file: install -d %{buildroot}%{_datadir}/hal/fdi/information/20thirdparty install -m644 tools/hal/libsane.fdi %{buildroot}%{_datadir}/hal/fdi/information/20thirdparty/70-scanner.fdi # xinetd stuff: install -d -m755 %{buildroot}%{_sysconfdir}/xinetd.d/ 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 %find_lang sane-backends %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -f sane-backends.lang %defattr(-,root,root) %dir %{_sysconfdir}/sane.d %config(noreplace) %{_sysconfdir}/sane.d/*.conf %config(noreplace) %{_sysconfdir}/slp.reg.d %config(noreplace) %{_sysconfdir}/xinetd.d/sane-port %dir %{_sysconfdir}/udev %dir %{_sysconfdir}/udev/rules.d %{_sysconfdir}/udev/rules.d/55-libsane.rules %dir %{_datadir}/hal %dir %{_datadir}/hal/fdi %dir %{_datadir}/hal/fdi/information %dir %{_datadir}/hal/fdi/information/20thirdparty %{_datadir}/hal/fdi/information/20thirdparty/70-scanner.fdi %{_sbindir}/saned %{_bindir}/scanimage %{_bindir}/sane-config %{_bindir}/sane-find-scanner %{_bindir}/gamma4scanimage %{_bindir}/umax_pp %{_datadir}/sane/ %{_libdir}/libsane* %{_libdir}/sane/ %{_includedir}/sane/ #%dir /var/lock/sane %doc %{_defaultdocdir}/sane-backends/ %doc %{_mandir}/man1/scanimage.1.gz %doc %{_mandir}/man1/sane-config.1.gz %doc %{_mandir}/man1/sane-find-scanner.1.gz %doc %{_mandir}/man1/gamma4scanimage.1.gz %doc %{_mandir}/man5/sane-*.5.gz %doc %{_mandir}/man7/sane.7.gz %doc %{_mandir}/man8/saned.8.gz %files autoconfig %defattr(-,root,root) %dir %{_sysconfdir}/udev %dir %{_sysconfdir}/udev/rules.d %{_sysconfdir}/udev/rules.d/56-sane-backends-autoconfig.rules %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor