# SliTaz package receipt.

PACKED_SIZE="180.0K"
UNPACKED_SIZE="532.0K"
PACKAGE="ppp"
VERSION="2.4.5"
CATEGORY="network"
SHORT_DESC="Implements the Point-to-Point Protocol (PPP)."
MAINTAINER="pankso@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://ppp.samba.org/"
WGET_URL="ftp://ftp.samba.org/pub/ppp/$TARBALL"
CONFIG_FILES="/etc/ppp"

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	./configure --prefix=/usr --mandir=/usr/share/man \
	$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$PWD/_pkg/usr install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr
	cp -a $_pkg/usr/sbin $fs/usr
	cp -a $_pkg/usr/lib $fs/usr
	# Config files.
	mkdir -p $fs/etc/ppp/scripts
	cp $stuff/README.scripts $fs/etc/ppp
	cp -a $src/etc.ppp/* $fs/etc/ppp
	# PPP scripts.
	cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
	cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
	
	cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
	cp -a $src/scripts/callback $fs/etc/ppp/scripts
	cp -a $src/scripts/redialer $fs/etc/ppp/scripts
	
	cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
	cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
	chmod +x $fs/etc/ppp/ip*
	# insert #!/bin/sh  on top line in ip* scripts
	sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip*	
	# add empty peers dir
	mkdir -p $fs/etc/ppp/peers
	sed -i 's:ppp/ppp-on-dialer:ppp/script/ppp-on-dialer:' $fs/etc/ppp/scripts/ppp-on
	
}
