aboutsummaryrefslogtreecommitdiffstats
path: root/community/repmgr/APKBUILD
blob: af3642a2e3d5d325fc9fa26934f3b72ad1e04b27 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=repmgr
pkgver=5.2.0
pkgrel=1
pkgdesc="Replication Manager for PostgreSQL"
url="http://www.repmgr.org/"
arch="all"
license="GPL-3.0"
depends="postgresql-client"
makedepends="postgresql-dev flex libxml2-dev libedit-dev"
pkgusers="postgres"
pkggroups="postgres"
subpackages="$pkgname-doc $pkgname-daemon"
source="$pkgname-$pkgver.tar.gz::https://github.com/2ndQuadrant/repmgr/archive/v$pkgver.tar.gz
	repmgr.conf.patch
	repmgrd.initd
	"

build() {
	./configure
	make USE_PGXS=1
}

check() {
	./repmgr --version
	./repmgrd --version
}

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

	install -D -m 640 -o postgres -g postgres \
		repmgr.conf.sample "$pkgdir"/etc/repmgr.conf

	cd "$pkgdir"

	mkdir -p usr/share/doc/$pkgname
	cp "$builddir"/*.md "$builddir"/doc/*.md usr/share/doc/$pkgname/
}

daemon() {
	pkgdesc="A management and monitoring daemon for PostgreSQL Replication Manager"
	depends="$pkgname"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/repmgrd "$subpkgdir"/usr/bin/

	install -D -m 755 "$srcdir"/repmgrd.initd "$subpkgdir"/etc/init.d/repmgrd
}

sha512sums="4e9fbbba42025226d9b0e13f180f4f8b2ffbafd2b84a4ec9ffe36a804d40f3fc0d8b599bb859b4bdb0ca739d974d014a96e31868e5a48e34df2666c98a314553  repmgr-5.2.0.tar.gz
d378e6109b2e664424b902ae940b71a336fbf93ec7405b8be2f8d36ce3e34bf05257be7dc5c55da47d5a0798383a4fea634b1fdaa0f8f0c39b8e6f0f435e13e9  repmgr.conf.patch
20399aa51351532a35412f09e1c8217a651687d03f545ee250f1d8e22cf73eddb6415848d7c0b8a38b961f1eb5ad3e8c6bec490801a810ad26a37783dc32d5ec  repmgrd.initd"