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

# source: james
TARBALL=pptp-$PKGVER.tar.gz
MD5SUM=8d25341352fdae5ad5b36b9f18254908
SRC_URL=http://downloads.sourceforge.net/pptpclient/$TARBALL
BUNDLE=

SLACKREQ='pppd'
SLACKDESC="pptpclient: pptpclient $PKGVER (PPTP VPN Server)
pptpclient: 
pptpclient: pptpclitn is VPN client implementing PPTP protocol. This protocol is 
pptpclient: known to be insecure and should only be used in last resort (that is, 
pptpclient: if you don't have any other option).
pptpclient: 
pptpclient: http://pptpclient.sourceforge.net/
pptpclient: 
pptpclient: 
pptpclient: 
pptpclient: 
"
SLACKINSTALL='
# load all ppp modules not yet loaded
find /lib/modules/$(uname -r) -type f -name 'ppp_*ko' |
while
	read -r p; do p=${p##*/}; p=${p%.ko};
	grep -q $p ./etc/modules || echo $p >> ./etc/modules && modprobe $p
done 
'

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/pptp* &&
	make $MAKEFLAGS IP=/sbin/ip && make install &&
	pkg_build_slackdesc &&

	# enable mppe by default
	sed -i -e 's|^#require-mppe-128|require-mppe-128|' /etc/ppp/options.pptp
	cat >> /etc/ppp/options.pptp << "EOF" &&
	
## use the DNS server settings supplised by the VPN server
usepeerdns
EOF

	# patch pptpsetup to use peerdns too
	sed -i -e '/^TUNNEL/ i\
usepeerdns' /usr/sbin/pptpsetup
}


