void-packages/srcpkgs/ppp/template

94 lines
2.8 KiB
Plaintext
Raw Normal View History

# Template file for 'ppp'
pkgname=ppp
version=2.4.5
revision=3
short_desc="PPP (Point-to-Point Protocol) daemon"
homepage="https://ppp.samba.org/"
license="BSD and LGPLv2+ and GPLv2+ and Public Domain"
maintainer="Juan RP <xtraeme@gmail.com>"
distfiles="ftp://ftp.samba.org/pub/ppp/ppp-$version.tar.gz"
checksum=43317afec9299f9920b96f840414c977f0385410202d48e56d2fdb8230003505
long_desc="
This packages provides a daemon which implements the PPP protocol for
dial-up networking."
CFLAGS="-D_GNU_SOURCE"
makedepends="libpcap-devel"
conf_files="
/etc/ppp/ip-up
/etc/ppp/chap-secrets
/etc/ppp/options
/etc/ppp/ip-down
/etc/ppp/pap-secrets"
do_configure() {
# Custom CFLAGS.
sed -i "s:-O2 -pipe -Wall -g:${CFLAGS}:" \
${wrksrc}/pppd/Makefile.linux
sed -i "s:-g -O2:${CFLAGS}:" ${wrksrc}/pppd/plugins/Makefile.linux
sed -i "s:-O2:${CFLAGS}:" ${wrksrc}/pppstats/Makefile.linux
sed -i "s:-O2 -g -pipe:${CFLAGS}:" ${wrksrc}/chat/Makefile.linux
sed -i "s:-O:${CFLAGS}:" ${wrksrc}/pppdump/Makefile.linux
# Enable active filter
sed -i "s:^#FILTER=y:FILTER=y:" ${wrksrc}/pppd/Makefile.linux
# Enable ipv6 support
sed -i "s:^#HAVE_INET6=y:HAVE_INET6=y:" ${wrksrc}/pppd/Makefile.linux
# Enable Microsoft Proprietary Callback Control Protocol
sed -i "s:^#CBCP=y:CBCP=y:" ${wrksrc}/pppd/Makefile.linux
./configure --prefix=/usr
}
do_build() {
make ${makejobs}
}
do_install() {
for f in $(find ${wrksrc} -type f -name Makefile); do
sed -i -e "s|\$(INSTALL) -s|\$(INSTALL|g" ${f}
done
make DESTDIR=${DESTDIR}/usr install
chmod 755 ${DESTDIR}/usr/lib/pppd/${version}/*.so
install -m755 ${wrksrc}/pppd/pppd ${DESTDIR}/usr/sbin
install -m755 ${wrksrc}/chat/chat ${DESTDIR}/usr/sbin
install -D -m644 ${FILESDIR}/options \
${DESTDIR}/etc/ppp/options
install -D -m755 ${FILESDIR}/ip-up \
${DESTDIR}/etc/ppp/ip-up
install -D -m755 ${FILESDIR}/ip-down \
${DESTDIR}/etc/ppp/ip-dowm
install -d -m755 ${DESTDIR}/etc/ppp/ip-up.d
install -d -m755 ${DESTDIR}/etc/ppp/ip-down.d
install -m755 ${FILESDIR}/ip-up.d.dns.sh \
${DESTDIR}/etc/ppp/ip-up.d/00-dns.sh
install -m755 ${FILESDIR}/ip-down.d.dns.sh \
${DESTDIR}/etc/ppp/ip-down.d/00-dns.sh
install -D -m755 ${FILESDIR}/pon \
${DESTDIR}/usr/bin/pon
install -D -m755 ${FILESDIR}/poff \
${DESTDIR}/usr/bin/poff
install -D -m755 ${FILESDIR}/plog \
${DESTDIR}/usr/sbin/plog
install -D -m600 ${wrksrc}/etc.ppp/pap-secrets \
${DESTDIR}/etc/ppp/pap-secrets
install -D -m600 ${wrksrc}/etc.ppp/chap-secrets \
${DESTDIR}/etc/ppp/chap-secrets
#install -D -m644 ${FILESDIR}/pon.1 \
# ${DESTDIR}/usr/share/man/man1/pon.1 || return 1
install -d -m755 ${DESTDIR}/etc/ppp/peers
touch -f ${DESTDIR}/etc/ppp/peers/.empty_on_purpose
}
ppp-devel_package() {
noarch=yes
depends="libpcap-devel>=${version}"
short_desc+=" -- development files"
pkg_install() {
vmove usr/include
}
}