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

TARBALL=foo2zjs-$PKGVER.tar.gz
MD5SUM=c8581870a677e635fd342a98ea76b52c
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$TARBALL

# tarball actually here, but it gets updated without version number,
# so we keep a persistent copy.
# http://foo2zjs.rkkda.com/foo2zjs.tar.gz

SLACKREQ='cups ghostscript cups-filters foomatic'
SLACKDESC="foo2zjs: foo2zjs $PKGVER (Extra printer drivers)
foo2zjs: 
foo2zjs: foo2zjs contains additional printers supporting QPLD protocol 
foo2zjs: (Samsung printers), ZjStream protocol (some HP printers), and others.
foo2zjs: 
foo2zjs: http://rkkda.com/
foo2zjs: 
foo2zjs: 
foo2zjs: 
foo2zjs: 
foo2zjs
"

SLACKINSTALL='
cat >> ./etc/cups/cups-files.conf << "EOF"
# "FileDevice Yes" line installed by foo2zjs...
FileDevice Yes
EOF
'

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	# we are going to download something, so get DNS working
	echo "nameserver 8.8.8.8" > /etc/resolv.conf &&

	# create users (must be the same as the one we will use in the running system)
	echo lp::111: >> /etc/group
	echo lpadmin::112: >> /etc/group
	echo lp:x:9:111:lp:/var/spool/cups:/bin/false >> /etc/passwd
	#return 1
	
	cd /tmp/foo2zjs* &&
	
	# remove gcc test, it fails otherwise
	sed -i -e 's/[\t]all-test//' Makefile &&

	# build and install additional stuff
	make &&
	./getweb all &&
	make install PREFIX=/usr &&
	# make cups && # we use slack-install instead

    # done
	pkg_build_slackdesc &&
	rm -f /etc/resolv.conf /etc/passwd /etc/group
}


