# Contributor: Cameron <cbanta@gmail.com>
# Maintainer: Cameron <cbanta@gmail.com>
setvar pkgname = 'pgpool'
setvar _opkgname = 'pgpool-II'
setvar pkgver = '3.6.5'
setvar pkgrel = '0'
setvar pkgdesc = ""A connection pooling/replication server for PostgreSQL""
setvar url = ""http://www.pgpool.net""
setvar arch = ""all""
setvar license = ""BSD""
setvar makedepends = ""postgresql-dev linux-headers""
setvar subpackages = ""$pkgname-dev""
setvar source = ""$_opkgname-$pkgver.tar.gz::http://www.pgpool.net/download.php?f=$_opkgname-$pkgver.tar.gz
		$pkgname.initd""

setvar builddir = ""$srcdir"/$_opkgname-$pkgver"

proc prepare {
	cd $builddir
	default_prepare
	update_config_sub
}

proc build {
	cd $builddir
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

proc check {
	cd $builddir
	make check
}

proc package {
	cd $builddir
	make DESTDIR="$pkgdir" install

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

setvar sha512sums = ""12247730f202859c76b0a11ccc485de786e53df7b8e08ffd76d7653c25633d79387f027e7c9d804bf19cd89b9db047b7ca0cf1cf5e914ee74c6efc0b6660eb1d  pgpool-II-3.6.5.tar.gz
de36d7aab6806f1e303901ac80284bb9861edaf9b682901db9f1ead3843ba8cb528c814e5dabfc2c450ebed6450daf3fff14166d08a530e1c44a29e4d4e29a2c  pgpool.initd""