#---------------------------------------------------------------------------- # build_sane.txt - how to build the sane binaries and create folder and packages # # Creation : 2012-05-22 holbru # Last update: $Id$ # # !!! this is not a script but an step-by-step howto !!! #---------------------------------------------------------------------------- exit 1 ### download the source code from the internet, e.g. # http://www.sane-project.org/ # 2016 # sane-1.0.21.tar.bz2 ### extract file in a temporary location tar -xjvf sane-1.0.21.tar.bz2 cd sane-1.0.21 # 2012-06-01 sane-1.0.22 ### build # patches from openSUSE patch -Np0 -i ../fix-buffer-overflow.patch patch -Np0 -i ../re-add-SANE_CAP_ALWAYS_SETTABLE.patch patch -Np0 -i ../fix-mustek_pp_ccd300.c.patch patch -Np0 -i ../install-umax_pp-tool.patch patch -Np0 -i ../no-descriptions-external-hpoj.patch patch -Np1 -i ../sane-backends-1.0.21-SCX4500W.patch patch -Np1 -i ../sane-backends-1.0.22-xerox_mfp-fix-usb-devices.patch sed -e '/^:mfg/s/EPSON/Epson/' ../epkowa.desc >doc/descriptions-external/epkowa.desc 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 sh ../create_hpaio.desc_from_models.dat doc/descriptions-external/hpaio.desc cp ../create_scanner_database create_scanner_database chmod u+x create_scanner_database autoreconf -fi export CFLAGS='-O2 -march=i486 -D_GNU_SOURCE -fno-strict-aliasing' export CXXFLAGS="${CFLAGS}" ./configure \ --prefix=/usr \ --enable-libusb_1_0 \ --enable-static \ --sysconfdir=/etc \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --disable-locking \ --localstatedir=/var \ --with-gphoto2 \ --with-docdir=/usr/share/doc/sane-backends \ --enable-pthread *** pint backend requires sys/scanio.h - disabling *** v4l backend requires v4l libraries - disabling *** pnm backend not manually selected - disabling -> Variables used for compilation/linking: CPPFLAGS=" -D_REENTRANT -DPATH_SANE_CONFIG_DIR=$(configdir) -DPATH_SANE_DATA_DIR=$(datadir) -DPATH_SANE_LOCK_DIR=$(locksanedir) -DV_MAJOR=1 -DV_MINOR=0" CFLAGS="-O2 -march=i486 -W -Wall -I/usr/include/libusb-1.0 " LDFLAGS="" LIBS="" -> Installation directories: Configuration: /etc Libraries: /usr/lib Binaries: /usr/bin and /usr/sbin Manpages: /usr/share/man Documentation: /usr/share/doc/sane-backends Lockfiles: Feature is disabled! -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: no SNMP support: no -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kvs1025 kvs20xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pixma plustek plustek_pp qcam ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u xerox_mfp p5 # 2012-09-02 sane-1.0.23 patch -Np0 -i ../re-add-SANE_CAP_ALWAYS_SETTABLE.patch patch -Np0 -i ../install-umax_pp-tool.patch patch -Np0 -i ../fix-mustek_pp_ccd300.c.patch patch -Np0 -i ../fix-buffer-overflow.patch sed -e '/^:mfg/s/EPSON/Epson/' ../epkowa.desc >doc/descriptions-external/epkowa.desc 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 sh ../create_hpaio.desc_from_models.dat <../models.dat >doc/descriptions-external/hpaio.desc cp ../create_scanner_database create_scanner_database chmod u+x create_scanner_database autoreconf -fi export CFLAGS='-O2 -march=i486' -D_GNU_SOURCE -fno-strict-aliasing' export CXXFLAGS="${CFLAGS}" ./configure \ --prefix=/usr \ --enable-libusb_1_0 \ --enable-static \ --sysconfdir=/etc \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --disable-locking \ --localstatedir=/var \ --with-gphoto2 \ --with-docdir=/usr/share/doc/sane-backends \ --enable-pthread *** pint backend requires sys/scanio.h - disabling *** v4l backend requires v4l libraries - disabling *** pnm backend not manually selected - disabling Installation directories: Configuration: /etc Libraries: /usr/lib Binaries: /usr/bin and /usr/sbin Manpages: /usr/share/man Documentation: /usr/share/doc/sane-backends Lockfiles: Feature is disabled! -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: no SNMP support: no CUPS support: no -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pixma plustek plustek_pp qcam ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u xerox_mfp p5 # 2014-01-01 -> sanae-backend1-1.0.24 # build wirth rpm suse Factory # sane-backends-1.0.24-1.2.src.rpm *** pint backend requires sys/scanio.h - disabling *** pnm backend not manually selected - disabling abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pixma plustek plustek_pp qcam ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5 # 2016-04-16 -> sane-backends-1.0.25 # build with rpm Suse # sane-backends-1.0.25-2.1.src.rpm -> Installation directories: Configuration: /etc Libraries: /usr/lib Binaries: /usr/bin and /usr/sbin Manpages: /usr/share/man Documentation: /usr/share/doc/sane-backends Lockfiles: Feature is disabled! -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: no SNMP support: no -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pieusb pixma plustek plustek_pp qcam ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5 # 2016-05-01 -> scanbuttond-0.2.3 # build with rpm Suse, patches from Debian # scanbuttond-0.2.3-12.110.src.rpm # hbfl # 2018-12-12 -> sane-backends-1.0.27 # build with rpm Suse # sane-backends-1.0.27-5.4.src.rpm # with pp backends # hbfl # 2020-05-26 -> sane-backends-1.0.29 # build with rpm Suse # sane-backends-1.0.29-1.1.src.rpm # with pp backends -> libieee1284 # scanner.database aus dem BUILD holen # hbfl # 2020-05-26 -> scanbuttond-0.2.3 # rebuild with rpm Suse, patches from Debian # scanbuttond-0.2.3-12.130.src.rpm # do not work with libusb-1.0.23 # hbfl # 2020-05-27 -> scanbuttond-0.2.3 # rebuild with rpm Suse, patches from Debian # scanbuttond-0.2.3-16.130.src.rpm # svn co https://github.com/jdam6431/scanbuttond.git # worked with libusb-1.0.23 # hbfl # 2021-01-27 -> sane-backends-1.0.31 # build with rpm Suse # sane-backends-1.0.31-1.1.src.rpm # with pp backends -> libieee1284 # scanner.database aus dem BUILD holen # hbfl # 2021-09-17 -> sane-backends-1.0.32 # build with rpm Suse # sane-backends-1.0.32-1.5.src.rpm # with pp backends -> libieee1284 # scanner.database aus dem BUILD holen # hbfl # 2022-02-07 -> sane-backends-1.1.1 # build with rpm Suse # sane-backends-1.1.1-1.1.src.rpm # with pp backends -> libieee1284 # scanner.database aus dem BUILD holen -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: no cURL support: yes POPPLER_GLIB support: no SNMP support: no -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_lide70 canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds fujitsu genesys gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pieusb pixma plustek plustek_pp qcam ricoh ricoh2 rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5 # hbfl # 2023-07-30 -> sane-backends-1.2.1 # build with rpm Suse _> gcc-12 -> glibc-2.37 # sane-backends-1.2.1-1.2.src.rpm # with pp backends -> libieee1284 # with gphoto backends -> libgphoto2 # scanner.database aus dem BUILD holen -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: no cURL support: yes POPPLER_GLIB support: no SNMP support: no -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_lide70 canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pieusb pixma plustek plustek_pp qcam ricoh ricoh2 rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5 # hbfl # 2023-11-05 -> sane-backends-1.2.1 # rebuild with rpm Suse # sane-backends-1.2.1-1.3.src.rpm # with avahi too # with pp backends -> libieee1284 # with gphoto backends -> libgphoto2 # scanner.database aus dem BUILD holen -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: yes cURL support: yes POPPLER_GLIB support: yes SNMP support: no -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_lide70 canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds escl fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pieusb pixma plustek plustek_pp qcam ricoh ricoh2 rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5 # hbfl # 2024-10-16 -> sane-backends-1.3.1 # build with rpm Suse # sane-backends-1.3.1-2.2.src.rpm # with pp backends -> libieee1284 # with gphoto backends -> libgphoto2 # scanner.database aus dem BUILD holen -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: yes cURL support: yes POPPLER_GLIB support: yes SNMP support: no -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_lide70 canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds escl fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark lexmark_x2600 ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pieusb pixma plustek plustek_pp qcam ricoh ricoh2 rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5 # hbfl # 2025-02-16 -> sane-backends-1.3.1 # rebuild with rpm Suse # sane-backends-1.3.1-2.3.src.rpm # with net-snmp too # with pp backends -> libieee1284 # with gphoto backends -> libgphoto2 # scanner.database aus dem BUILD holen -> Network parameters: Build saned: yes IPv6 support: yes Avahi support: yes cURL support: yes POPPLER_GLIB support: yes SNMP support: yes -> The following backends will be built: abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr canon_lide70 canon_pp cardscan coolscan coolscan2 coolscan3 dc25 dc210 dc240 dell1600n_net dmc epjitsu epson epson2 epsonds escl fujitsu genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx kvs40xx leo lexmark lexmark_x2600 ma1509 magicolor matsushita microtek microtek2 mustek mustek_pp mustek_usb mustek_usb2 nec net niash pie pieusb pixma plustek plustek_pp qcam ricoh ricoh2 rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5 # hbfl # 2025-04-24 -> sane-backends-1.3.1 # rebuild with rpm Suse # sane-backends-1.3.1-2.5.src.rpm # with net-snmp too # with pp backends -> libieee1284 # with gphoto backends -> libgphoto2 # scanner.database aus dem BUILD holen make make check make DESTDIR=/public/utils/sane/1.0.23 install # strip files/binarys for filename in `find /public/utils/sane/1.0.23/usr/{sbin/*,bin/*,lib/{*.so.*,sane/*.so.*}} -type f` do echo $filename strip -R .note -R .comment "$filename" done perl -pi -e 's/^([^#].*)$/#$1/' /public/utils/sane/1.0.23/etc/sane.d/dll.conf for d in descriptions descriptions-external do install -d -m755 /public/utils/sane/1.0.23/usr/share/sane/$d install -m644 doc/$d/*.desc /public/utils/sane/1.0.23/usr/share/sane/$d done for b in gt68xx artec_eplus48u epjitsu do sed -i -e 's/^:model.*$/&\n:firmware "required"/' /public/utils/sane/1.0.23/usr/share/sane/descriptions/$b.desc done sed -i -e 's/^:interface "USB".*$/&\n:firmware "required"/' /public/utils/sane/1.0.23/usr/share/sane/descriptions/snapscan.desc sed -i -e '/:model "SnapScan 1236u"/,/:firmware "required"/s/required//' /public/utils/sane/1.0.23/usr/share/sane/descriptions/snapscan.desc sed -i -e 's|/usr/share/sane/descriptions|/public/utils/sane/1.0.23/usr/share/sane/descriptions|' create_scanner_database ./create_scanner_database >scanner.database 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 | grep -E -q 'complete|good|basic|minimal|untested' || echo $USBID >>unsupportedUSBIDs done # copy files cp *** /lib/sane/bin_**_sane_1_0_21/*** find bin_sane_1_0_23/usr/lib/sane -name "*.la" -exec rm -f {} \; find bin_sane_1_0_23/usr/lib/sane -name "*.a" -exec rm -f {} \; find bin_sane_1_0_23/usr/lib/sane -name "*.so" -exec rm -f {} \; find bin_sane_1_0_23/usr/lib/sane -name "*.so.1" -exec rm -f {} \; find bin_dev_sane_1_0_23/usr/lib/sane -name "*.so" -exec rm -f {} \; find bin_dev_sane_1_0_23/usr/lib/sane -name "*.so.*" -exec rm -f {} \; cd bin_sane_1_0_23/etc/sane for i in * ; do echo $i ; mv $i ${i}.sample ; done ... der Root kann aber scannen. Das Problem tritt bei USB-Scannern auf, die mit SANE angesteuert werden. Die Lösung ist relativ simpel, wenn man sie kennt. Die USB-Scanner verwenden kein Device mehr unterhalb von /dev, sondern sie nutzen das virtuelle Dateisystem /proc/bus/usb, das der Kernel beim Booten erzeugt. Hier müssen die Rechte angepaßt werden. In der Regel macht das Hotplug mittels einem Script von sane: /etc/hotplug.d/usb/libsane.hotplug Über die /etc/fstab lässt sich das realisieren: usbfs /proc/bus/usb usbfs noauto,devmode=0666 0 0 Dann muß der Benutzer zur Gruppe "scanner" hinzugefügt werden usermod -G scanner user und usbfs ungemountet und erneut gemountet werden. Jetzt alle User scannen können, die in der Grupper "scanner" Mitglied sind. #---------------------------------------------------------------------------- create folder Um die Folder im Hauptverszeichnis zu erstellen gibt es das Script 'sane-folder.sh' unter sane/_ADMIN/ mit sane-folder.sh -v 1.0.21 -w create wird die folder Struktur fuer die lib Version 1.0.21 erstellt nun koennen die files aus dem compilat eingefuegt werden. mit sane-folder.sh -v 1.0.21 -w add wird ein svn add auf die erzeugten Folder durchgefuehrt. mit sane-folder.sh -v 1.0.21 -w list wird fuer jeden Folder die files-list.txt erzeugt, add muss zwingend vorher ausgefuehrt worden sein mit sane-folder.sh -v 1.0.21 -w ci erfolgt der commit der erzeugten Folder In den eis und eis_dev Foldern muessen keine Anpassungen vorgenommen werden. Diese Anpassungen erfolgen beim packen der packages durch mktarball.sh mit den _do_ Scripten unter _ADMIN automatisch. In den Pack-Scripten unter _ADMIN muss dann noch die Pfadangabe geaendert werden, auf den soeben erzeugten Pfad und ein commit ausgefuehrt werden. Nach dem checkout auf eisler koennen nun die packages erzeugt werden. die wichtigsten Parameter fuer mktarball.sh sind dann -setdate now -setversion ${version} mktarball.sh - home -setdate now -setversion [version angeben] sane sane-dev duch die Angabe von -home werden die packages in die Folder Struktur /home/user/public_html/packages/ kopiert und koennen von da direkt auf Pack-Eis geladen werden. wichtig ist noch, dass unbedingt die 'lib' Version zuerst gebaut werden muss, da fuer die 'dev' Version Informationen aus der 'lib' Info Datei gelesen werden.