### this file is sourced not run
PKGVER=2015.05
PKGBUILD=1
PKGARCH=x86_64

# Note: this is sane-frontends, but only contains xscanimage.
# It is build in the same way as a normal sane-frontend, except that:
# - only the xscanimage is retained (and renamed to xscanimage-peasy).
# - it is build from specially patched source
#
# It is useful only "peasyscan" package is installed.

# BLFS 7.5 updated to latest git
TARBALL=sane-frontends-2015.05.tar.bz2
MD5SUM=f58f45ac8ad195780ae8265b527ca004
SRC_URL=http://distro.ibiblio.org/fatdog/source/700/$TARBALL
BUNDLE=

SLACKREQ='gtk2'
SLACKDESC='xscanimage-peasy: xscanimage-peasy 2015.05 (xscanimage for peasyscan)  
xscanimage-peasy:  
xscanimage-peasy: This package contains a special-built of xscanimage (from 
xscanimage-peasy: sane-frontend) which has been patched to support peasyscan.  
xscanimage-peasy: 
xscanimage-peasy: 
xscanimage-peasy: 
xscanimage-peasy: 
xscanimage-peasy: 
xscanimage-peasy: 
xscanimage-peasy:  
'
SLACKSUG='gimp'

### default pkg_download
### prepare
pkg_prepare() {
	# peasyscan patch
	pkg_prepare_default &&
	cd tmp/sane* &&
	patch -Np1 -i $CHROOT_DIR/tmp/pkg/sane-frontends-1.0.14-peasyscan.patch
}

### package
pkg_package() {
	# delete everything except xscanimage
	rm -r usr/bin usr/share &&
	mkdir -p usr/bin &&
	mv xscanimage-peasy usr/bin
}

### build
pkg_build() {
	cd /tmp/sane*
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	mv /usr/bin/xscanimage /xscanimage-peasy
}


