aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-09-19 18:03:45 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-09-19 18:04:33 +0200
commitf5e7c5305285d99740d1e2297debd1dd98913911 (patch)
treeddb071fbd3d92a46b10dd692fb8f0ef22cb5cdd4
parentdafccc9cc11016559bc3047bb14a18d5e39e58c8 (diff)
downloadaports-f5e7c5305285d99740d1e2297debd1dd98913911.tar.bz2
aports-f5e7c5305285d99740d1e2297debd1dd98913911.tar.xz
testing/repmgr: new aport
http://www.repmgr.org Replication Manager for PostgreSQL
-rw-r--r--testing/repmgr/APKBUILD55
-rw-r--r--testing/repmgr/repmgrd.initd7
2 files changed, 62 insertions, 0 deletions
diff --git a/testing/repmgr/APKBUILD b/testing/repmgr/APKBUILD
new file mode 100644
index 0000000000..fa96ed6cd7
--- /dev/null
+++ b/testing/repmgr/APKBUILD
@@ -0,0 +1,55 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=repmgr
+pkgver=3.3.2
+pkgrel=0
+pkgdesc="Replication Manager for PostgreSQL"
+url="http://www.repmgr.org/"
+arch="all"
+license="GPL-3"
+depends="postgresql-client"
+makedepends="postgresql-dev"
+pkgusers="postgres"
+subpackages="$pkgname-doc $pkgname-daemon"
+source="$pkgname-$pkgver.tar.gz::https://github.com/2ndQuadrant/$pkgname/archive/v$pkgver.tar.gz
+ repmgrd.initd"
+builddir="$srcdir/$pkgname-$pkgver"
+options="!checkroot"
+
+build() {
+ cd "$builddir"
+ make USE_PGXS=1
+}
+
+check() {
+ cd "$builddir"
+ ./repmgr --version
+ ./repmgrd --version
+}
+
+package() {
+ cd "$builddir"
+
+ 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"/docs/*.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="98fba8fc0d9074e496c66762dbec45734fe279f39c9c51adb3e66dca929ac37f66a609789c8c658545856fd81f5afc5b35f6b5e389e52bce8c04ce8c52acd8dd repmgr-3.3.2.tar.gz
+74a03cfd36d739ddfad2078ba88980c7dea983ebc664bc3ab4dc6792bf36f144d1cd9d2b1bfbd30dda7e2b1198e7eb388dbea616d9ad710602b775ad30b1a3ab repmgrd.initd"
diff --git a/testing/repmgr/repmgrd.initd b/testing/repmgr/repmgrd.initd
new file mode 100644
index 0000000000..5adb5c4547
--- /dev/null
+++ b/testing/repmgr/repmgrd.initd
@@ -0,0 +1,7 @@
+#!/sbin/openrc-run
+
+command="/usr/bin/repmgrd"
+command_background="yes"
+
+pidfile="/run/$RC_SVCNAME.pid"
+start_stop_daemon_args="--user ${user:-postgres}"