### this file is sourced not run
PKGVER=1.0.32
PKGBUILD=1
PKGARCH=i686

# source: BLFS 11.3
TARBALL=sane-backends-$PKGVER.tar.gz
MD5SUM=51ff581b911fc9b7b6b5ae6959f9089b
SRC_URL=https://anduin.linuxfromscratch.org/BLFS/sane/$TARBALL
BUNDLE=

SLACKREQ='cups32 libjpeg-turbo32 libtiff32 libusb32 avahi32'
SLACKDESC="sane-backend32: sane-backend32 $PKGVER (Generic Scanner Driver)  
sane-backend32:  
sane-backend32: SANE is short for Scanner Access Now Easy. Scanner access; 
sane-backend32: however, is far from easy, since every vendor has their own 
sane-backend32: protocols. The only known protocol that should bring some unity 
sane-backend32: into this chaos is the TWAIN interface, but this is too 
sane-backend32: imprecise to allow a stable scanning framework. Therefore, SANE 
sane-backend32: comes with its own protocol, and the vendor drivers can't be 
sane-backend32: used. This package contains drivers for the supported scanners 
sane-backend32: and cameras.  
sane-backend32: 
"

### default pkg_download
### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share etc var
	mkdir -p usr/bin &&
	mv -v tmp/*-32 usr/bin
}

### build
pkg_build() {
	echo "scanner::130:" >> /etc/group # make sure "scanner" group is defined

	CONFFLAGS="$CONFFLAGS    \
		--with-group=scanner \
		--enable-avahi       \
		--with-usb=yes       \
		--enable-libusb_1_0  \
		--docdir=/usr/share/doc/sane-backend-$PKGVER \
		--with-systemd=no    \
	" &&
			
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	
	install -m 644 -v tools/udev/libsane.rules           \
                  /etc/udev/rules.d/65-scanner.rules
    
    # multilib
	mv -v /usr/bin/sane-config /tmp/sane-config-32 &&

	# remove temporary group
	rm -f etc/group
}


