# vim: set syn=sh:
# Packager: Phill Watkins <ubemail~at~ymail~dot~com>

pkgname=fwknop
pkgver=2.0.0rc2
pkgrel=1pw
#arch=noarch
source=("http://www.cipherdyne.org/fwknop/download/fwknop-$pkgver.tar.bz2" "rc.fwknopd.gz")
sourcetemplate=http://people.salixos.org/pwatk/packages/13.37/n/$pkgname
docs=("AUTHORS" "ChangeLog" "COPYING" "INSTALL" "NEWS" "README" "TODO")
url=http://www.cipherdyne.org/fwknop/
dotnew=('etc/fwknop/access.conf' 'etc/fwknop/fwknopd.conf')
options=('noautodotnew' 'nosrcpack')
slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"fwknop (FireWall KNock OPerator)"
"fwknop implements an authorisation scheme called Single Packet"
"Authorisation (SPA). This method of authorisation is based around a"
"default-drop packet filter using iptables and libpcap."
""
"The main application of this program is to protect services such as"
"SSH with an additional layer of security in order to make the"
"exploitation of vulnerabilities (both 0-day and unpatched code) much"
"more difficult."
)


build() {
	set -e
	
	cd $startdir/src/$pkgname-$pkgver
	./configure \
	  --prefix=/usr \
	  --sysconfdir=/etc \
	  --localstatedir=/var \
	  --libdir=/usr/lib${LIBDIRSUFFIX} \
	  --mandir=/usr/man \
	  --infodir=/usr/info \
	  --docdir=/usr/doc/$pkgname-$pkgver \
	  --build=$arch-slackware-linux \
	  --disable-static
	make -j $numjobs
	make install DESTDIR=$startdir/pkg

	install -d  $startdir/pkg/etc/rc.d/desc.d
	cat <<- EOF > $startdir/pkg/etc/rc.d/desc.d/fwknopd.txt
	fwknopd:The Firewall Knock Operator Daemon:fwknopd
	EOF
	install -m 0644 $startdir/src/rc.fwknopd $startdir/pkg/etc/rc.d/
	chmod 644 $startdir/pkg/etc/rc.d/{rc.fwknopd,desc.d/fwknopd.txt}

	set +e
}