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

# source: james
TARBALL=epson-201204w-1.1.1.tar.bz2
MD5SUM=56faba65fcf8b9caea67c53e98e9bcc3
SRC_URL=http://distro.ibiblio.org/fatdog/source/700/$TARBALL
BUNDLE=

SLACKREQ='cups' # 
SLACKDESC="epson-xp-200: epson-xp-200 $PKGVER (Epson XP-200 driver for CUPS)
epson-xp-200: 
epson-xp-200: This is a cups filter for Epson XP-200, XP-100 and the like.
epson-xp-200: 
epson-xp-200: Actual driver name is epson-201204w, and installs in /opt
epson-xp-200: 
epson-xp-200: 
epson-xp-200: 
epson-xp-200: 
epson-xp-200: 
epson-xp-200: 
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/epson*
	patch -Np1 -i $CHROOT_DIR/tmp/pkg/epson-201204w.patch
	
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/epson*
	
	# filter
	EPSON_ROOT=/opt/epson-inkjet-printer-201204w
	cd *filter* &&
	sed -i -e '/DEBUG/ s/0/1/' src/debuglog.h && # enable debug
	rm -f configure &&
	autoreconf -fi &&
	./configure --prefix=$EPSON_ROOT
	make $MAKEFLAGS &&
	make install &&

	# ppds and extra libs and stuff
	cd ../*201204w* &&
	install -m0644 Manual.txt $EPSON_ROOT/doc &&
	for p in $LIBDIR ppds resource watermark; do
		install -d -m0755 $EPSON_ROOT/$p || return 1
		install -m0644 $p/* $EPSON_ROOT/$p || return 1
	done

	pkg_build_slackdesc
}
