# Contributor: Danilo Godec <danilo.godec@agenda.si>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pptpd
pkgver=1.4.0
pkgrel=1
pkgdesc="PoPToP - PPTP Daemon, Linux as Microsoft VPN Server"
url="http://www.poptop.org/"
arch="all"
license="GPL-2.0-or-later"
depends=""
makedepends="ppp-dev"
install=""
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://sourceforge.net/projects/poptop/files/$pkgname/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz/download
	fix_MSG_TRYHARD.patch
	pptpd.patch
	pptpd.confd
	pptpd.initd
	options.pptp
	pptpd.conf
	"

_builddir="$srcdir"/$pkgname-$pkgver
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
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr --sysconfdir=/etc || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
	install -Dm755 "$srcdir"/pptpd.initd "$pkgdir"/etc/init.d/pptpd
	install -Dm644 "$srcdir"/pptpd.confd "$pkgdir"/etc/conf.d/pptpd
	install -Dm644 "$srcdir"/options.pptp "$pkgdir"/etc/ppp/options.pptp
	install -Dm644 "$srcdir"/pptpd.conf "$pkgdir"/etc/
}

md5sums="36f9f45c6ffa92bc3b6e24ae2d053505  pptpd-1.4.0.tar.gz
3dc72385cb3df526176a54ef2d2a7e06  fix_MSG_TRYHARD.patch
7b274230768ab70aa32f45df06da501c  pptpd.patch
bff575819b8997e7bbe743b95cb134cb  pptpd.confd
0fceb3c55a8fe9d3ef3b6c105deb6dde  pptpd.initd
95f1efd9f4f896bf3b7aef1940c58e79  options.pptp
0a7af8968a964ebccf12ad512be9bba5  pptpd.conf"
sha256sums="8fcd8b8a42de2af59e9fe8cbaa9f894045c977f4d038bbd6346a8522bb7f06c0  pptpd-1.4.0.tar.gz
a37ad055e31113fc8c51cc9c2b1f513dd1cb76093bd6697ac31232669a038b47  fix_MSG_TRYHARD.patch
215df31dc64ca1706a1257f33d90af101193e000c85688cf56c6fc6452b3697c  pptpd.patch
4d69da546e36439dc1a7cb5abb949ad48046155752c047babb5472decdfa1958  pptpd.confd
62615d546b29c4e0df35d6982195201f378c4e86b5949858d6ef5da88fc32210  pptpd.initd
668b4e3c8e48f7b96836497f43b449414ae4cb0c555b197a033843c75ef14aed  options.pptp
19695e6dcf3e6df1aae0933fe5e91abc094999957cb3890a7f3b671b21f83ae3  pptpd.conf"
sha512sums="cfb4caef3025c0721e7fabf8b7bf595739f2d3048555b30616cdadc37e70ba9e1c50561c25091dd617b5448da2816aeaf83aea0fc2ef6b0dd5e3fe35d9591484  pptpd-1.4.0.tar.gz
718e9fd6a53322f2f390ee4d07b2b4f88b6dd3ad130d4471a4e12e82910942982a06865c06296ff26f08e87aa65f4f7ee4a020cf7c2ff0d67ca5bfb794fe10bc  fix_MSG_TRYHARD.patch
2adbd7203451fe63472fdd443afcf9c85b66d1d4965574f94a7e99a29fdd7f37cfe1eb0f82afebef0e6e11726e0702208e75e90f9867b1103f1d5e401f8ba47f  pptpd.patch
59f118715cf6c36442687a58f46a54519fb5125383e85c4fa352a4c97f8a4e19f46c9715330550755eb9691e8174b70cdfab48fbd14c2707364e8083d6baa488  pptpd.confd
7ccca8dd0c5ecc8bc0352b8e3bed30c7e9ab3591d07ffdf62a7305406a4685b638446d4b0a65753ceaa5bae4f63fb39f9bf6b590e1837851c0a6676d305b3612  pptpd.initd
acf235a1c34f34cded7f2c56d6757fec099032ffaefae003e79b0517ad3fc53e19698e8c644193da9613707f8923b9c78f9e642aa0d9c785db1d4e51717a486e  options.pptp
ed6022b6711b0e6b3e336220d6da7ec9dd7d3a0679fc9219d0931f3b165296b80bc21e23123cc0ed621d76d06d5ad3435659eb7b924daa735ee1a069c1ebcbc1  pptpd.conf"
