aboutsummaryrefslogtreecommitdiffstats
path: root/testing/keepalived/APKBUILD
blob: 86876e6f132afb96c5f0b28e0f0b81c3c043aa96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Contributor: Pablo Castorino <pcastorino@mendoza-conicet.gob.ar>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=keepalived
pkgver=1.2.19
pkgrel=0
pkgdesc="Health Checking for Linux Virtual Server & High-Availability"
url="http://www.keepalived.org/"
arch="all"
license="GPL"
depends=
makedepends="openssl-dev popt-dev linux-headers net-snmp-dev libnl-dev"
install=""
subpackages="$pkgname-doc $pkgname-sample-config:samples"
source="http://www.keepalived.org/software/$pkgname-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	"

_builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	cd "$_builddir"
	# apply patches here
	for i in $source; do
		case $i in
		*.patch)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-kernel-dir=/usr/include/linux \
		--enable-vrrp \
		--enable-snmp \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/genhash
	for f in AUTHOR CONTRIBUTORS ChangeLog README INSTALL TODO \
			genhash/README genhash/AUTHOR genhash/ChangeLog; do
		install -m644 $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
}

samples() {
	pkgdesc="Sample configuration for keepalived"
	mkdir -p "$subpkgdir"/etc/keepalived/
	mv "$pkgdir"/etc/keepalived/samples "$subpkgdir"/etc/keepalived/
}

md5sums="5c98b06639dd50a6bff76901b53febb6  keepalived-1.2.19.tar.gz
965cb4d5deca2d00112cb82ed798edb9  keepalived.initd
a714b2a54e4f9bfea41f1476d36c22eb  keepalived.confd"
sha256sums="32fbae732c1cd854cacd7a930d4a26f5bad6372cdecb5e3139f0c17e87493853  keepalived-1.2.19.tar.gz
0567d2b8cfeb78951e6c9e9d8ae5ed018e9eb116dd9d3d92779cfb823700c9b9  keepalived.initd
dcc2d9b209a9836d861612547537df8f06bb08153482920dd4b927730ba6ae8d  keepalived.confd"
sha512sums="d2848726aa97bbd5a3be3e667314a453d26572ef6d14f5f606395a203ceab7bce8a6c63e3b5ebb05c83d75a5491b77f1fa4e3042cd919d7d673c3595ec829974  keepalived-1.2.19.tar.gz
240201b81bcca7b213bd3ec45fc286f0305d72a6952a3baf485d717df413df3a2da0f4b018eaa050b0b12cda78767f5c4ae60ec75e5802cfe57cb29951e86ba0  keepalived.initd
468d176d22f1ce308871829f24624b33e6ba3b234a413395599a67a865f3cf815cc24a10c244dffd1421a0acf5352fe51027a2d3b282cd3822dfeadc8a1d4df0  keepalived.confd"