diff options
-rw-r--r-- | testing/keepalived/APKBUILD | 44 | ||||
-rw-r--r-- | testing/keepalived/keepalived.post-upgrade | 13 |
2 files changed, 52 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" diff --git a/testing/keepalived/keepalived.post-upgrade b/testing/keepalived/keepalived.post-upgrade new file mode 100644 index 0000000000..b4fe1cfd05 --- /dev/null +++ b/testing/keepalived/keepalived.post-upgrade @@ -0,0 +1,13 @@ +#!/bin/sh + +ver_new="$1" +ver_old="$2" + +if [ "$(apk version -t "$ver_old" "1.2.23-r1")" = "<" ]; then + cat 1>&2 <<-EOF + * + * Since 1.2.23-r1 package keepalived doesn't provide SNMP support. + * If you need it, install package keepalived-snmp instead. + * + EOF +fi |