aboutsummaryrefslogtreecommitdiffstats
path: root/community/keepalived
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-11-19 02:33:33 +0100
committerJakub Jirutka <jakub@jirutka.cz>2016-11-19 02:34:01 +0100
commit813ce7dc6afa78c1ef3e67ada1d8005557efc540 (patch)
treea06f35c0ed370816814b149286caa4be34ac21f1 /community/keepalived
parent430f0751b62c42901c4cbedea3e6baeceb7314e6 (diff)
downloadaports-813ce7dc6afa78c1ef3e67ada1d8005557efc540.tar.bz2
aports-813ce7dc6afa78c1ef3e67ada1d8005557efc540.tar.xz
community/keepalived: move from testing
Diffstat (limited to 'community/keepalived')
-rw-r--r--community/keepalived/APKBUILD112
-rw-r--r--community/keepalived/fix-configure.patch46
-rw-r--r--community/keepalived/keepalived.confd2
-rw-r--r--community/keepalived/keepalived.initd23
-rw-r--r--community/keepalived/keepalived.post-upgrade13
5 files changed, 196 insertions, 0 deletions
diff --git a/community/keepalived/APKBUILD b/community/keepalived/APKBUILD
new file mode 100644
index 0000000000..daa562e002
--- /dev/null
+++ b/community/keepalived/APKBUILD
@@ -0,0 +1,112 @@
+# 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.24
+pkgrel=0
+pkgdesc="Health Checking for Linux Virtual Server & High-Availability"
+url="http://www.keepalived.org/"
+arch="all"
+license="GPL"
+depends="$pkgname-common !$pkgname-snmp"
+makedepends="libressl-dev popt-dev linux-headers net-snmp-dev libnl-dev
+ libnfnetlink-dev automake autoconf"
+install="$pkgname.post-upgrade"
+subpackages="$pkgname-doc $pkgname-sample-config:samples:noarch
+ $pkgname-common $pkgname-snmp"
+source="http://www.keepalived.org/software/$pkgname-$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.confd
+ fix-configure.patch
+ "
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+ default_prepare || return 1
+
+ # The build scripts are somehow broken, so we must regenerate them.
+ autoreconf -fiv || 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 \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --with-kernel-dir=/usr/include/linux \
+ --enable-vrrp \
+ --enable-sha1 \
+ $@ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install || return 1
+
+ local f; for f in AUTHOR CONTRIBUTORS ChangeLog README INSTALL TODO \
+ genhash/README genhash/AUTHOR genhash/ChangeLog; do
+ install -m644 -D $f "$pkgdir"/usr/share/doc/$pkgname/$f || return 1
+ done
+
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+
+ # Clean up sysvinit files
+ 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"
+
+ mkdir -p "$subpkgdir"/etc/keepalived/
+ mv "$pkgdir"/etc/keepalived/samples "$subpkgdir"/etc/keepalived/
+}
+
+md5sums="e878312095b7dcab91ad06e257822247 keepalived-1.2.24.tar.gz
+ad67cf11d9fc60f55eff562728a16863 keepalived.initd
+252a289af5b7c7ec6f0cb3fe48f57486 keepalived.confd
+a2283ead67c71ec937a64cfecbb3eb66 fix-configure.patch"
+sha256sums="3071804478077e606197a2348b5733d7d53af2843906af5e0d544945565c36ef keepalived-1.2.24.tar.gz
+535bcfe41410a86e6640bf8c8c8ddb31546ba83476fceef8e0799121737ee5c2 keepalived.initd
+4e655777aa3d6afa6cd746e84aa87fbb356c6d4cac9846c3a2f8805d65763497 keepalived.confd
+0ccc131d013959b430f44ad9a7e9fa5ddbe068cfe2af31ed72d30e8ef394a77e fix-configure.patch"
+sha512sums="a5e555dd955173887896155a04b1f6bb0c2f2a758008472abd5433b057be3fd85e4f270a7b7eb2f36a1c16e46b235ef930b1844938276528ff61bbdd783bb1f5 keepalived-1.2.24.tar.gz
+12361313dd044269150c9ea1a4ffc6987075b0106dfdd4b3804b1852d2a47f608d954ab473419474747b475c98fade3779800be8147134969016817cfa050ee4 keepalived.initd
+413cb05aa2d1d8c0f552398bb5d511ee022b4d07f5b18217350c1159d013f2d26d87ae63d2977329ec78d7416760e84c4048a5ad20a1f63ef2bc3a1a84c3a41a keepalived.confd
+6d24889d83bc3ec6d4d8636380477576ffb6439dc49ff0b59be50a5afe41d1050bbad6f938fc9b5cb4b9cc64b8de9d6c058d8ef1bb721420140ae467656b5429 fix-configure.patch"
diff --git a/community/keepalived/fix-configure.patch b/community/keepalived/fix-configure.patch
new file mode 100644
index 0000000000..14c43d8048
--- /dev/null
+++ b/community/keepalived/fix-configure.patch
@@ -0,0 +1,46 @@
+From 4b6ceb48080044d675bc67ac93a86513b61eea63 Mon Sep 17 00:00:00 2001
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Sat, 19 Nov 2016 01:43:24 +0100
+Subject: [PATCH] Fix illegal syntax in configure script
+
+Indirect expansion (`${!foo}`) is a bashism, it's not POSIX-sh
+compatible and is not supported by common shells except Bash and ZSH!
+Configure script should be portable, hence strictly POSIX compliant.
+Moreover it has shebang /bin/sh.
+
+Sent to upstream: https://github.com/acassen/keepalived/pull/456
+---
+ configure | 4 ++--
+ configure.ac | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index bfd0acb..c6085e2 100755
+--- a/configure
++++ b/configure
+@@ -7087,8 +7087,8 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+
+ for flag in RTA_ENCAP RTA_EXPIRES RTA_NEWDST RTA_PREF RTA_VIA FRA_OIFNAME FRA_SUPPRESS_PREFIXLEN FRA_SUPPRESS_IFGROUP FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK; do
+- decl_var=ac_cv_have_decl_$flag
+- if test ${!decl_var} = yes; then
++ eval decl_var=\$ac_cv_have_decl_$flag
++ if test ${decl_var} = yes; then
+ BUILD_OPTIONS="$BUILD_OPTIONS "${flag}
+ fi
+ done
+diff --git a/configure.ac b/configure.ac
+index 2496be1..15ffc40 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -422,8 +422,8 @@ AC_CHECK_DECLS([RTA_VIA, FRA_OIFNAME], [], [],
+ #include <sys/socket.h>
+ #include <linux/fib_rules.h>]])
+ for flag in RTA_ENCAP RTA_EXPIRES RTA_NEWDST RTA_PREF RTA_VIA FRA_OIFNAME FRA_SUPPRESS_PREFIXLEN FRA_SUPPRESS_IFGROUP FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK; do
+- decl_var=ac_cv_have_decl_$flag
+- if test ${!decl_var} = yes; then
++ AS_VAR_COPY([decl_var], [ac_cv_have_decl_$flag])
++ if test ${decl_var} = yes; then
+ add_build_opt[${flag}]
+ fi
+ done
diff --git a/community/keepalived/keepalived.confd b/community/keepalived/keepalived.confd
new file mode 100644
index 0000000000..7979109c0f
--- /dev/null
+++ b/community/keepalived/keepalived.confd
@@ -0,0 +1,2 @@
+# Keepalived options, see keepalived(8) man page.
+#KEEPALIVED_OPTS="-D"
diff --git a/community/keepalived/keepalived.initd b/community/keepalived/keepalived.initd
new file mode 100644
index 0000000000..760c360c89
--- /dev/null
+++ b/community/keepalived/keepalived.initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="reload"
+
+command="/usr/sbin/keepalived"
+command_args="${KEEPALIVED_OPTS}"
+pidfile="/run/keepalived.pid"
+required_files="/etc/keepalived/keepalived.conf"
+
+depend() {
+ use logger
+ # The interfaces do not actually need to exist to start,
+ # it handles them gracefully.
+ use net
+}
+
+reload() {
+ ebegin "Reloading keepalived.conf"
+ start-stop-daemon --pidfile $pidfile --signal HUP
+ eend $?
+}
diff --git a/community/keepalived/keepalived.post-upgrade b/community/keepalived/keepalived.post-upgrade
new file mode 100644
index 0000000000..b4fe1cfd05
--- /dev/null
+++ b/community/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