diff options
Diffstat (limited to 'community/openvswitch')
-rw-r--r-- | community/openvswitch/PKGBUILD | 49 | ||||
-rw-r--r-- | community/openvswitch/openvswitch.install | 16 | ||||
-rw-r--r-- | community/openvswitch/openvswitch.tmpfiles | 1 | ||||
-rw-r--r-- | community/openvswitch/ovs-vswitchd.service | 14 | ||||
-rw-r--r-- | community/openvswitch/ovsdb-server.service | 6 |
5 files changed, 86 insertions, 0 deletions
diff --git a/community/openvswitch/PKGBUILD b/community/openvswitch/PKGBUILD new file mode 100644 index 000000000..ad7fbf264 --- /dev/null +++ b/community/openvswitch/PKGBUILD @@ -0,0 +1,49 @@ +# $Id: PKGBUILD 107605 2014-03-18 09:51:41Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Pedro Martinez-Julia (pedromj@um.es) +# Contributor: Matt Monaco <net 0x01b dgbaley27> + +pkgname=openvswitch +pkgver=2.0.1 +pkgrel=1 +pkgdesc="Production Quality, Multilayer Open Virtual Switch" +url="http://openvswitch.org" +license=('APACHE') +arch=(x86_64 i686) +install=openvswitch.install +source=("http://openvswitch.org/releases/openvswitch-$pkgver.tar.gz" + openvswitch.install + openvswitch.tmpfiles + ovsdb-server.service + ovs-vswitchd.service) +depends=('openssl') +makedepends=('python2') +optdepends=('python2') +sha256sums=('014907bcf2f98228dfa4472ea1547871d24b8fb8192dcfff3ead1af93c433a67' + '9d30ed859214f4cdeb6b6450d5c5defaf31f2c593c05201109df66fa9373ef0c' + 'e8dc21e50fc886bfd6aa55991bdb3cb66907e11b071045452bb12de01a3ecbd9' + '5900728bca0292ec66e6da234eaa6f32f28ead6bda163d89a480eac08558c657' + 'c2cb5e2685240ea50b1aba4e77784f4dd66d157e7cd05a17853868aa8d8a2a45') + +build() { + cd "$srcdir/$pkgname-$pkgver" + ./boot.sh + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-rundir=/run/openvswitch \ + --sbindir=/usr/bin \ + PYTHON=/usr/bin/python2 + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make DESTDIR="$pkgdir" install + install -Dm0644 $srcdir/openvswitch.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/openvswitch.conf" + install -Dm0644 $srcdir/ovsdb-server.service "$pkgdir/usr/lib/systemd/system/ovsdb-server.service" + install -Dm0644 $srcdir/ovs-vswitchd.service "$pkgdir/usr/lib/systemd/system/ovs-vswitchd.service" + install -dm0755 "$pkgdir/etc/openvswitch" + rm -rf $pkgdir/run +} diff --git a/community/openvswitch/openvswitch.install b/community/openvswitch/openvswitch.install new file mode 100644 index 000000000..a64353d02 --- /dev/null +++ b/community/openvswitch/openvswitch.install @@ -0,0 +1,16 @@ +post_install() { + + if [[ ! -f etc/openvswitch/conf.db ]]; then + + cmd=(ovsdb-tool create + etc/openvswitch/conf.db + usr/share/openvswitch/vswitch.ovsschema) + + printf "Running: %s\n" "${cmd[*]}" + "${cmd[@]}" + fi +} + +post_upgrade() { + post_install +} diff --git a/community/openvswitch/openvswitch.tmpfiles b/community/openvswitch/openvswitch.tmpfiles new file mode 100644 index 000000000..f99f19f89 --- /dev/null +++ b/community/openvswitch/openvswitch.tmpfiles @@ -0,0 +1 @@ +d /run/openvswitch 0770 root root - diff --git a/community/openvswitch/ovs-vswitchd.service b/community/openvswitch/ovs-vswitchd.service new file mode 100644 index 000000000..602b7472f --- /dev/null +++ b/community/openvswitch/ovs-vswitchd.service @@ -0,0 +1,14 @@ +[Unit] +Description = Open vSwitch Daemon +Documentation = man:ovs-vswitchd +Wants = network.target +Before = network.target +Requires = ovsdb-server.service +After = ovsdb-server.service + +[Service] +ExecStartPre = /sbin/modprobe openvswitch +ExecStart = /usr/sbin/ovs-vswitchd + +[Install] +WantedBy = multi-user.target diff --git a/community/openvswitch/ovsdb-server.service b/community/openvswitch/ovsdb-server.service new file mode 100644 index 000000000..b0badc6b9 --- /dev/null +++ b/community/openvswitch/ovsdb-server.service @@ -0,0 +1,6 @@ +[Unit] +Description = Open vSwitch Database Server +Documentation = man:ovsdb-server + +[Service] +ExecStart = /usr/sbin/ovsdb-server --remote=punix:/var/run/openvswitch/db.sock |