diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-15 08:57:32 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-15 09:04:31 +0000 |
commit | 11233ac93b5354d5274c88f500d702426282ae16 (patch) | |
tree | da259bc3a54e47724b3070a6115b86e1d9be7bd8 | |
parent | 2fe619084f6fa2593014b585f4009528afeb463c (diff) | |
download | alpine_aports-11233ac93b5354d5274c88f500d702426282ae16.tar.bz2 alpine_aports-11233ac93b5354d5274c88f500d702426282ae16.tar.xz alpine_aports-11233ac93b5354d5274c88f500d702426282ae16.zip |
testing/slony1: new aport
A master to multiple slaves replication system for PostgreSQL
http://slony.info/
-rw-r--r-- | testing/slony1/APKBUILD | 52 | ||||
-rw-r--r-- | testing/slony1/slony1.confd | 12 | ||||
-rwxr-xr-x | testing/slony1/slony1.initd | 37 |
3 files changed, 101 insertions, 0 deletions
diff --git a/testing/slony1/APKBUILD b/testing/slony1/APKBUILD new file mode 100644 index 0000000000..b45d3b6af6 --- /dev/null +++ b/testing/slony1/APKBUILD | |||
@@ -0,0 +1,52 @@ | |||
1 | # Contributor: Natanael Copa <ncopa@alpinelinux.org> | ||
2 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | pkgname=slony1 | ||
4 | pkgver=2.0.7 | ||
5 | pkgrel=0 | ||
6 | pkgdesc="A master to multiple slaves replication system for PostgreSQL" | ||
7 | url="http://slony.info/" | ||
8 | arch="all" | ||
9 | license="BSD" | ||
10 | depends="" | ||
11 | makedepends="postgresql-dev" | ||
12 | install="" | ||
13 | subpackages="" | ||
14 | source="http://main.slony.info/downloads/2.0/source/slony1-$pkgver.tar.bz2 | ||
15 | slony1.initd | ||
16 | slony1.confd" | ||
17 | |||
18 | _builddir="$srcdir"/slony1-$pkgver | ||
19 | prepare() { | ||
20 | local i | ||
21 | cd "$_builddir" | ||
22 | for i in $source; do | ||
23 | case $i in | ||
24 | *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; | ||
25 | esac | ||
26 | done | ||
27 | } | ||
28 | |||
29 | build() { | ||
30 | cd "$_builddir" | ||
31 | ./configure --prefix=/usr \ | ||
32 | --sysconfdir=/etc \ | ||
33 | --mandir=/usr/share/man \ | ||
34 | --infodir=/usr/share/info \ | ||
35 | --localstatedir=/var \ | ||
36 | || return 1 | ||
37 | make || return 1 | ||
38 | } | ||
39 | |||
40 | package() { | ||
41 | cd "$_builddir" | ||
42 | make DESTDIR="$pkgdir" install || return 1 | ||
43 | rm -f "$pkgdir"/usr/lib/*.la | ||
44 | install -Dm755 "$srcdir"/slony1.initd "$pkgdir"/etc/init.d/slony1 \ | ||
45 | || return 1 | ||
46 | install -Dm644 "$srcdir"/slony1.confd "$pkgdir"/etc/conf.d/slony1 \ | ||
47 | || return 1 | ||
48 | } | ||
49 | |||
50 | md5sums="e8aadfa9c1115f5ce43079381a4b51b5 slony1-2.0.7.tar.bz2 | ||
51 | a4d6b16ff6f23fbb578af35472f1ec97 slony1.initd | ||
52 | 27fe1a24fcab45c0e3ad4dd3e53287cf slony1.confd" | ||
diff --git a/testing/slony1/slony1.confd b/testing/slony1/slony1.confd new file mode 100644 index 0000000000..07822329ab --- /dev/null +++ b/testing/slony1/slony1.confd | |||
@@ -0,0 +1,12 @@ | |||
1 | # /etc/conf.d/slony1: | ||
2 | # $Header: /var/cvsroot/gentoo-x86/dev-db/slony1/files/slony1.conf,v 1.2 2007/03/07 23:18:21 nakano Exp $ | ||
3 | |||
4 | # Configuration file for /etc/init.d/slony1 | ||
5 | |||
6 | USER=postgres | ||
7 | CLUSTER=your_cluster_name | ||
8 | DBUSER=postgres | ||
9 | DBNAME=your_database_name | ||
10 | DBHOST=localhost | ||
11 | LOGFILE=/var/lib/postgresql/data/slony1.log | ||
12 | LOGLEVEL=1 # 1(minimum)..4(maximum) | ||
diff --git a/testing/slony1/slony1.initd b/testing/slony1/slony1.initd new file mode 100755 index 0000000000..4f1469dc64 --- /dev/null +++ b/testing/slony1/slony1.initd | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/sbin/runscript | ||
2 | # Copyright 1999-2004 Gentoo Foundation | ||
3 | # Distributed under the terms of the GNU General Public License v2 | ||
4 | # $Header: /var/cvsroot/gentoo-x86/dev-db/slony1/files/slony1.init,v 1.2 2007/03/07 23:18:21 nakano Exp $ | ||
5 | |||
6 | depend() { | ||
7 | need postgresql | ||
8 | } | ||
9 | |||
10 | start() { | ||
11 | ebegin "Starting slony1" | ||
12 | /usr/bin/slon -p /var/run/slony1.pid -d $LOGLEVEL $CLUSTER "dbname=$DBNAME user=$DBUSER host=$DBHOST" >> $LOGFILE 2>&1 & | ||
13 | |||
14 | while : | ||
15 | do | ||
16 | cnt=$(($cnt + 1)) | ||
17 | if [ -f "/var/run/slony1.pid" ]; then | ||
18 | ret=0 | ||
19 | break | ||
20 | fi | ||
21 | |||
22 | if [ $cnt -eq 30 ]; then | ||
23 | eerror "Please see log file: $LOGFILE" | ||
24 | ret=1 | ||
25 | break | ||
26 | fi | ||
27 | sleep 1 | ||
28 | done | ||
29 | eend $ret | ||
30 | } | ||
31 | |||
32 | stop() { | ||
33 | ebegin "Stopping slony1" | ||
34 | kill `cat /var/run/slony1.pid` | ||
35 | eend $? | ||
36 | } | ||
37 | |||