# xsane
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf
URL=http://www.xsane.org/download
#URL=http://distro.ibiblio.org/puppylinux/sources/x
PKG=xsane
VER=0.999
COMP=tar.gz
DESC="Xsane is the graphical scanner frontend to sane"
DEPS=+sane-backends
CAT=graphic
DESKTOP=xsane.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

patch_me() {
	cd ${PKG}-${VER}
	for i in `ls ${CWD}/patches`;do
		echo applying $i
		sleep 1
		patch -p1 < ${CWD}/patches/$i
	done
	cd -
}

package_ext() {
	# EXTRAS
	install -d -m 0755 ${PKG}-install/usr/share/pixmaps
	install -m 0755 xsaneshell ${PKG}-install/usr/bin
	install -m 0644 xsane.xpm ${PKG}-install/usr/share/pixmaps
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
patch_me
build_configure $PKG $VER $LIBDIR
package_ext
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT	
