aboutsummaryrefslogtreecommitdiffstats
path: root/testing/keepalived/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/keepalived/APKBUILD')
-rw-r--r--testing/keepalived/APKBUILD44
1 files changed, 39 insertions, 5 deletions
diff --git a/testing/keepalived/APKBUILD b/testing/keepalived/APKBUILD
index 937ef7f3b3..36e64862db 100644
--- a/testing/keepalived/APKBUILD
+++ b/testing/keepalived/APKBUILD
@@ -1,24 +1,38 @@
# Contributor: Pablo Castorino <pcastorino@mendoza-conicet.gob.ar>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=keepalived
pkgver=1.2.23
-pkgrel=0
+pkgrel=1
pkgdesc="Health Checking for Linux Virtual Server & High-Availability"
url="http://www.keepalived.org/"
arch="all"
license="GPL"
-depends=""
+depends="$pkgname-common !$pkgname-snmp"
makedepends="openssl-dev popt-dev linux-headers net-snmp-dev libnl-dev libnfnetlink-dev"
-subpackages="$pkgname-doc $pkgname-sample-config:samples"
+install="$pkgname.post-upgrade"
+subpackages="$pkgname-doc $pkgname-sample-config:samples $pkgname-common $pkgname-snmp"
source="http://www.keepalived.org/software/$pkgname-$pkgver.tar.gz
$pkgname.initd
$pkgname.confd
"
builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ default_prepare || return 1
+
+ cp -ar "$builddir" "$builddir-snmp"
+}
+
build() {
+ cd "$builddir-snmp"
+ _build --enable-snmp || return 1
+
cd "$builddir"
+ _build
+}
+_build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -28,9 +42,8 @@ build() {
--localstatedir=/var \
--with-kernel-dir=/usr/include/linux \
--enable-vrrp \
- --enable-snmp \
--enable-sha1 \
- || return 1
+ $@ || return 1
make || return 1
}
@@ -51,6 +64,27 @@ package() {
rm -rf "$pkgdir"/etc/rc.d "$pkgdir"/etc/sysconfig
}
+common() {
+ depends=""
+
+ mkdir -p "$subpkgdir"/usr
+
+ mv "$pkgdir"/etc "$subpkgdir"/ || return 1
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
+}
+
+snmp() {
+ pkgdesc="$pkgdesc (with SNMP support)"
+ depends="$pkgname-common !$pkgname"
+
+ cd "$builddir-snmp"
+
+ install -m700 -D bin/keepalived "$subpkgdir"/usr/sbin/keepalived || return 1
+
+ mkdir -p "$subpkgdir"/usr/share/snmp/mibs
+ install -m644 doc/*-MIB "$subpkgdir"/usr/share/snmp/mibs/
+}
+
samples() {
pkgdesc="Sample configuration for keepalived"
arch="noarch"