APKBUILD 2.45 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ppp
Natanael Copa's avatar
Natanael Copa committed
3
pkgver=2.4.5
4
pkgrel=7
Natanael Copa's avatar
Natanael Copa committed
5 6
pkgdesc="A daemon which implements the PPP protocol for dial-up networking"
url="http://www.samba.org/ppp/"
7
arch="all"
Natanael Copa's avatar
Natanael Copa committed
8
license="custom:GPL/BSD"
Natanael Copa's avatar
Natanael Copa committed
9
depends=
Natanael Copa's avatar
Natanael Copa committed
10 11 12
makedepends="libpcap-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="ftp://ftp.samba.org/pub/$pkgname/$pkgname-$pkgver.tar.gz
13
	defaultroute-metric.3.patch
Natanael Copa's avatar
Natanael Copa committed
14 15 16 17 18 19 20 21
	options
	pon
	poff
	plog
	pon.1
	ip-up
	ip-down"

Natanael Copa's avatar
Natanael Copa committed
22
_builddir="$srcdir"/$pkgname-$pkgver
23 24 25 26 27 28 29 30 31 32
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

Natanael Copa's avatar
Natanael Copa committed
33
build () { 
Natanael Copa's avatar
Natanael Copa committed
34
	cd "$_builddir"
35

Carlo Landmeter's avatar
Carlo Landmeter committed
36 37 38 39 40 41 42 43
	# fix CFLAGS
	# -D_GNU_SOURCE is needed for IPv6 to work apparently
	export CFLAGS="$CFLAGS -D_GNU_SOURCE"
	sed -i "s:-O2 -pipe -Wall -g:${CFLAGS}:" pppd/Makefile.linux
	sed -i "s:-g -O2:${CFLAGS}:" pppd/plugins/Makefile.linux
	sed -i "s:-O2:${CFLAGS}:" pppstats/Makefile.linux
	sed -i "s:-O2 -g -pipe:${CFLAGS}:" chat/Makefile.linux
	sed -i "s:-O:${CFLAGS}:" pppdump/Makefile.linux
44 45 46 47 48 49
	# enable active filter
	sed -i "s:^#FILTER=y:FILTER=y:" pppd/Makefile.linux
	# enable ipv6 support
	sed -i "s:^#HAVE_INET6=y:HAVE_INET6=y:" pppd/Makefile.linux
	# Enable Microsoft proprietary Callback Control Protocol
	sed -i "s:^#CBCP=y:CBCP=y:" pppd/Makefile.linux
Carlo Landmeter's avatar
Carlo Landmeter committed
50 51
	# Fix build error with recent kernels
	rm include/linux/if_pppol2tp.h
Natanael Copa's avatar
Natanael Copa committed
52 53
	./configure --prefix=/usr
	make COPTS="$CFLAGS" || return 1
Natanael Copa's avatar
Natanael Copa committed
54 55 56 57
}

package() {
	cd "$_builddir"
Natanael Copa's avatar
Natanael Copa committed
58 59 60 61 62 63 64 65 66 67 68 69 70
	make INSTROOT="$pkgdir" install

	install -D -m644 "$srcdir"/options "$pkgdir"/etc/ppp/options
	install -D -m755 "$srcdir"/ip-up "$pkgdir"/etc/ppp/ip-up
	install -D -m755 "$srcdir"/ip-down "$pkgdir"/etc/ppp/ip-down
	install -D -m755 "$srcdir"/pon "$pkgdir"/usr/bin/pon
	install -D -m755 "$srcdir"/poff "$pkgdir"/usr/bin/poff
	install -D -m755 "$srcdir"/plog "$pkgdir"/usr/sbin/plog
	install -D -m600 etc.ppp/pap-secrets "$pkgdir"/etc/ppp/pap-secrets
	install -D -m600 etc.ppp/chap-secrets "$pkgdir"/etc/ppp/chap-secrets
	install -D -m644 "$srcdir"/pon.1 "$pkgdir"/usr/share/man/man1/pon.1
	mkdir -p "$pkgdir"/etc/ppp/peers
}
Natanael Copa's avatar
Natanael Copa committed
71
md5sums="4621bc56167b6953ec4071043fe0ec57  ppp-2.4.5.tar.gz
72
e26f807a61490fedbc9a7632caebd973  defaultroute-metric.3.patch
73
9185f645bb433b22a9951d9d12f79c35  options
Natanael Copa's avatar
Natanael Copa committed
74 75 76 77 78 79
48c024f73a80c8b69c4def22f86902cc  pon
2d811f8470ccdea3b8c4505a438483e9  poff
86cdaf133f7a79fb464f02d83afc7734  plog
44cc662ba9aa61dd9add3ddd4c5ded57  pon.1
fac0c773490371ea673f4be0977a230f  ip-up
a88b40b1bf91eb5cca3762b7195e4fe2  ip-down"