# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pound
pkgver=2.7
pkgrel=4
pkgdesc="A reverse proxy, load balancer, and SSL wrapper"
url="http://www.apsis.ch/pound/index_html"
arch="all"
license="GPL"
depends=
makedepends="pcre-dev libressl-dev"
subpackages="$pkgname-doc"
source="http://www.apsis.ch/$pkgname/Pound-$pkgver.tgz
	pound.cfg
	$pkgname.initd"

builddir="$srcdir"/Pound-$pkgver
prepare() {
	default_prepare
	update_config_sub
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/pound \
		--with-owner=root \
		--with-group=root
	make
}

package() {
	cd "$builddir"
	install -d "$pkgdir"/usr/sbin
	make DESTDIR="$pkgdir" install
	install -Dm755 "$srcdir"/pound.initd "$pkgdir"/etc/init.d/pound
	install -Dm644 "$srcdir"/pound.cfg "$pkgdir"/etc/pound.cfg
}

sha512sums="3edfb948715ff7e38b7665cc083eb5619daf4c2ddda4efcffffa2bcf5d8c1ee158fa5275b16bbaea4cf51bf3f8c022ba2197d5f67d57732404a448ae00e62aa1  Pound-2.7.tgz
9471e5abe3e0ee83165ed01a7081a4d14075c6c21b9f9d7c3fb239aa78c38eae74394a7c7e7e7753d218a7ce5cae388823570d19b702a829baa93e949a8946b8  pound.cfg
cd014677ef7e724d5bd0a101436d0269d2fc18b4cd90ff71eaa690967754d3e4bfe5d0a439099967487b6256121ccc734b01880d96dff50d28242829715e7776  pound.initd"
