APKBUILD 4.02 KB
Newer Older
1 2
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
3
pkgname=openvswitch
4
pkgver=2.7.0
5
pkgrel=0
6
pkgdesc="A production quality, multilayer virtual switch"
7 8
url="http://openvswitch.org/"
arch="all"
9
license="ASL 2.0"
10
depends=""
11
depends_dev="libressl-dev"
12
makedepends="$depends_dev perl python2 linux-headers bash py-six"
Timo Teräs's avatar
Timo Teräs committed
13 14
subpackages="$pkgname-doc $pkgname-dbg $pkgname-dev
	$pkgname-monitor::noarch $pkgname-bash-completion:bashcomp:noarch"
15
source="http://openvswitch.org/releases/$pkgname-$pkgver.tar.gz
16 17 18
	ovsdb-server.initd
	ovsdb-server.confd
	ovs-vswitchd.initd
19
	ovs-vswitchd.confd
20 21
	ovs-modules.initd
	musl-if_packet.patch
22
	0002-fix-wait-any.patch
23
	ifupdown-alpine.patch
24
	readme.debian.patch
25
	"
26
builddir="$srcdir/$pkgname-$pkgver"
27 28

build() {
29
	cd "$builddir"
30 31 32 33 34
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
35
		--enable-ndebug \
36
		|| return 1
37
	make || return 1
38
#	make check || return 1
39 40 41
}

monitor() {
42
	depends="openvswitch py-twisted py-twisted-web2 py-qt"
43
	mkdir -p "$subpkgdir"/usr/share/openvswitch
44 45
	mv "$pkgdir"/usr/share/openvswitch/python \
		"$subpkgdir"/usr/share/openvswitch/python
46 47 48
}

package() {
49
	cd "$builddir"
50
	make DESTDIR="$pkgdir" install || return 1
51
	rm -f "$pkgdir"/usr/lib/*.a
52 53 54 55 56 57 58 59 60 61
	install -Dm755 "$srcdir"/ovsdb-server.initd \
		"$pkgdir"/etc/init.d/ovsdb-server || return 1
	install -Dm755 "$srcdir"/ovs-vswitchd.initd \
		"$pkgdir"/etc/init.d/ovs-vswitchd || return 1
	install -Dm755 "$srcdir"/ovs-modules.initd \
		"$pkgdir"/etc/init.d/ovs-modules || return 1
	install -Dm644 "$srcdir"/ovsdb-server.confd \
		"$pkgdir"/etc/conf.d/ovsdb-server || return 1
	install -Dm644 "$srcdir"/ovs-vswitchd.confd \
		"$pkgdir"/etc/conf.d/ovs-vswitchd
62 63 64 65 66 67 68

	install -d "$pkgdir"/etc/network/if-pre-up.d \
		"$pkgdir"/etc/network/if-post-down.d || return 1
	install -m755 debian/ifupdown.sh \
		"$pkgdir"/etc/network/if-pre-up.d/openvswitch || return 1
	ln -s ../if-pre-up.d/openvswitch \
		"$pkgdir"/etc/network/if-post-down.d/openvswitch || return 1
69 70
	mkdir -p "$pkgdir"/usr/share/doc/openvswitch || return 1
	install -m644 debian/openvswitch-switch.README.Debian \
71
		"$pkgdir"/usr/share/doc/openvswitch/README.alpine || return 1
72 73
}

74
bashcomp() {
75 76 77
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
78

79 80 81
	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions/$pkgname
	mv "$builddir"/utilities/*-bashcomp.bash \
		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname/ || return 1
82 83
}

84
sha512sums="d0c61fa149f5279182de561ed82125e7ddd4ecd4278eba3c5e6a7221840c8cbb70581269afdf4ff2508b8e5baeb8783b1a196d6e6f747e3a21aacdf778d6d190  openvswitch-2.7.0.tar.gz
85
097d4721a78fff749c534910d98543778474406bd61b469b88a0d981a2a380556444437ec44278cead6d8688c45a38b2acbf1551acb9ab38d048f413728e3b88  ovsdb-server.initd
86
b1588d076bbfc7ef2dd46fce8e46186f40cbbc4667697f7ac13ddc68e34568fdab315fde47838de7f6d32916853190336cfe3735f672ad7cb624ae14dbff55a5  ovsdb-server.confd
87
4bff37f8bed32d5327b4b0433984ab8ffdce77f618034aa6ffd1ad4a7caa00703ea2bef312876dce5aafa4c17fe06dddd75e5c05c10e13bf8f5c3805a0654a96  ovs-vswitchd.initd
88
346aea099f51707d2b4fc9fdc8c1502582723fb4e00c4d5d1624b0378c94dfb76674fa95e2af894f36169df52109dbe441ee6a45aa744584d9e4c74d15a46c1d  ovs-vswitchd.confd
89
614c86eab826bb8f934cf4a98508fde9952a0b7211414e074510473af3455077a333729aa0e59f3634b9bf30d64847d0f7597246506c36a8f09d57573a2522fc  ovs-modules.initd
90
c5f137bce28bf80c1e5a6ca18722dae9a5ecff03d20bf92642270951bbbb499e5fb05a08163442720e866d135fcd7426b88add0b42ed240d5f0c068aa9fcd9da  musl-if_packet.patch
91
973e1e188c23981114c5120d04cf39bec4597349d4c60056cc3834aa8148cd7bafea6216b0649db3dbd0ea540f8876bfaac90262e9a493abf2faf660c4dda01e  0002-fix-wait-any.patch
92
0f2847986783f020f0708f2b185f10d1d34ead679bcae553a42df34a244c815e6e7346a2d73af69aff86258ecb3c855630a99ec28c6c7567bcfeacfb5379e5ee  ifupdown-alpine.patch
93
346f11a81f1538513151ea328fcbf2cdfc3c864aa34ea522055bc70266b9b2b2e05bdc0691593a9a1e4ef360d89d465507623edbcd9f764e3707d852736c895c  readme.debian.patch"