aboutsummaryrefslogtreecommitdiffstats
path: root/main/pgpool/APKBUILD
blob: 4fb440b7c3306981731681e3b9fab9d315d20f6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Contributor: Cameron <cbanta@gmail.com>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=pgpool
_pkgname="$pkgname-II"
pkgver=4.1.4
pkgrel=0
pkgdesc="A connection pooling/replication server for PostgreSQL"
url="https://www.pgpool.net/"
arch="all"
license="pgpool-II"
makedepends="postgresql-dev linux-headers"
pkgusers="postgres"
pkggroups="postgres"
install="$pkgname.pre-install $pkgname.post-upgrade"
subpackages="$pkgname-openrc $pkgname-doc $pkgname-static $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://www.pgpool.net/download.php?f=$_pkgname-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	$pkgname.logrotated
	musl-compat.patch
	fix-listen_address.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/$pkgname \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-openssl
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	touch "$pkgdir"/etc/$pkgname/pool_passwd

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.logrotated "$pkgdir"/etc/logrotate.d/$pkgname

	install -d -o "$pkgusers" -g "$pkggroups" -m755 "$pkgdir"/var/log/$pkgname
}

doc() {
	local docdir="$subpkgdir"/usr/share/doc/$_pkgname
	default_doc

	mkdir -p "$docdir"
	mv "$pkgdir"/etc/$pkgname/* "$docdir"/

	local f; for f in pcp.conf pgpool.conf pool_hba.conf; do
		cp "$docdir"/$f.sample "$pkgdir"/etc/$pkgname/$f
	done
}

sha512sums="44c06fe8eb98e3c24109fa12f25ff51b6aaf43eb1dd8b1dedb8dd6e40bbe1a544152db3b870a66f71b943e0b7a9e52700f8e45dea78c025dab1d5f84b0ea9909  pgpool-4.1.4.tar.gz
71b8239b1b29e2c4a8312b300122ced1452bbe60fc7937e80172c7c5e3d6be71e5aee58f6d3d687b0e35df6ccdc27125a12ae9098f7c2d07e76b8103abca3556  pgpool.initd
0e40a681b068ce5c7f03c342c1217b170601a507cacdf120b9a308df65f2065e6085b292a393802d1955079f7ec434a412e6d871f688ad83bc33fa34aca37cfe  pgpool.confd
c9aa2ea9484ed29cb57cdff4004fa9dd4780d73c69db3378effb2e0ecd3ae178771c6a847a28e1a9cc6492ada4321584afb92c9b592119fb11898b42191f22b1  pgpool.logrotated
37e8314f2dab6889c35edb679906db3997c4d5eba704a7337ff82926d400f2ab780103b6a162b1effa74c0d7f8d6655b62cddd2017d3ea7a5de5f370871ab088  musl-compat.patch
625447bd0e5ef7687bcff2d020ddbdf788eec05abeb4f7979f078c15e6969fada8569fe233a543f133a939dac1fae4eb6513d7bbd7333f6f976c9d583ba5857a  fix-listen_address.patch"