mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 04:16:46 +02:00
testing/openvswitch: new aport
This commit is contained in:
parent
5bcbfc3c65
commit
cdb36ab188
72
testing/openvswitch/APKBUILD
Normal file
72
testing/openvswitch/APKBUILD
Normal file
@ -0,0 +1,72 @@
|
||||
# Contributor: William Pitcock <nenolod@dereferenced.org>
|
||||
# Maintainer: William Pitcock <nenolod@dereferenced.org>
|
||||
pkgname=openvswitch
|
||||
pkgver=1.7.1
|
||||
pkgrel=0
|
||||
pkgdesc="an open virtual switch"
|
||||
url="http://openvswitch.org/"
|
||||
arch="all"
|
||||
license="GPL"
|
||||
depends=""
|
||||
depends_dev="openssl-dev"
|
||||
depends_monitor="py-twisted py-twisted-web2 py-qt"
|
||||
makedepends="$depends_dev $depends_monitor"
|
||||
install="openvswitch.post-install openvswitch.post-upgrade"
|
||||
subpackages="$pkgname-doc $pkgname-monitor"
|
||||
source="http://openvswitch.org/releases/openvswitch-$pkgver.tar.gz
|
||||
ovsdb-server.initd
|
||||
ovsdb-server.confd
|
||||
ovs-controller.initd
|
||||
ovs-controller.confd
|
||||
ovs-vswitchd.initd
|
||||
ovs-vswitchd.confd"
|
||||
|
||||
_builddir="$srcdir"/openvswitch-$pkgver
|
||||
prepare() {
|
||||
local i
|
||||
cd "$_builddir"
|
||||
for i in $source; do
|
||||
case $i in
|
||||
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$_builddir"
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--localstatedir=/var \
|
||||
|| return 1
|
||||
make || return 1
|
||||
}
|
||||
|
||||
monitor() {
|
||||
depends="openvswitch $depends_monitor"
|
||||
mkdir -p "$subpkgdir"/usr/share/openvswitch
|
||||
mv "$pkgdir"/usr/share/openvswitch/python "$subpkgdir"/usr/share/openvswitch/python
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$_builddir"
|
||||
make DESTDIR="$pkgdir" install || return 1
|
||||
rm -f "$pkgdir"/usr/lib/*.la
|
||||
|
||||
install -Dm755 "$srcdir"/ovsdb-server.initd "$pkgdir"/etc/init.d/ovsdb-server
|
||||
install -Dm755 "$srcdir"/ovs-controller.initd "$pkgdir"/etc/init.d/ovs-controller
|
||||
install -Dm755 "$srcdir"/ovs-vswitchd.initd "$pkgdir"/etc/init.d/ovs-vswitchd
|
||||
|
||||
install -Dm644 "$srcdir"/ovsdb-server.confd "$pkgdir"/etc/conf.d/ovsdb-server
|
||||
install -Dm644 "$srcdir"/ovs-controller.confd "$pkgdir"/etc/conf.d/ovs-controller
|
||||
install -Dm644 "$srcdir"/ovs-vswitchd.confd "$pkgdir"/etc/conf.d/ovs-vswitchd
|
||||
}
|
||||
|
||||
md5sums="70a7076f84cdb4c0ee86c380e7f7aa78 openvswitch-1.7.1.tar.gz
|
||||
8cc7f62777212fab9fc1c8c506a32e65 ovsdb-server.initd
|
||||
9c2c1d774be02f2e69609bcc4f24a370 ovsdb-server.confd
|
||||
4e6e5afd1dc2d3bc1043dab19cd9f61f ovs-controller.initd
|
||||
0f5ce60dda512b29d4e20cb832e062d4 ovs-controller.confd
|
||||
623db751bbdc390d9e9c076c0ce9a6b2 ovs-vswitchd.initd
|
||||
2d1e0111ea62779f49e14d62678294b2 ovs-vswitchd.confd"
|
||||
11
testing/openvswitch/openvswitch.post-install
Normal file
11
testing/openvswitch/openvswitch.post-install
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
db="/etc/openvswitch/conf.db"
|
||||
if [ -e "$db" ]; then
|
||||
echo "Trying schema migration for $db..."
|
||||
ovsdb-tool convert "$db" "/usr/share/openvswitch/vswitch.ovsschema"
|
||||
else
|
||||
echo "Creating new Open vSwitch database $db..."
|
||||
ovsdb-tool create "$db" "/usr/share/openvswitch/vswitch.ovsschema"
|
||||
fi
|
||||
|
||||
11
testing/openvswitch/openvswitch.post-upgrade
Normal file
11
testing/openvswitch/openvswitch.post-upgrade
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
db="/etc/openvswitch/conf.db"
|
||||
if [ -e "$db" ]; then
|
||||
echo "Trying schema migration for $db..."
|
||||
ovsdb-tool convert "$db" "/usr/share/openvswitch/vswitch.ovsschema"
|
||||
else
|
||||
echo "Creating new Open vSwitch database $db..."
|
||||
ovsdb-tool create "$db" "/usr/share/openvswitch/vswitch.ovsschema"
|
||||
fi
|
||||
|
||||
6
testing/openvswitch/ovs-controller.confd
Normal file
6
testing/openvswitch/ovs-controller.confd
Normal file
@ -0,0 +1,6 @@
|
||||
# Space separated list of methods to listen for OpenFlow connections from switches
|
||||
# The default is "ptcp:" which starts ovs-controller listening on port 6633 on all interfaces.
|
||||
METHODS="ptcp:"
|
||||
|
||||
# Additional options
|
||||
# OPTIONS=""
|
||||
24
testing/openvswitch/ovs-controller.initd
Normal file
24
testing/openvswitch/ovs-controller.initd
Normal file
@ -0,0 +1,24 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/files/ovs-controller,v 1.1 2012/07/18 08:41:29 dev-zero Exp $
|
||||
|
||||
depend() {
|
||||
need lo
|
||||
}
|
||||
|
||||
start() {
|
||||
checkpath -d "/var/run/openvswitch" -m 0750
|
||||
|
||||
ebegin "Starting Open vSwitch OpenFlow controller"
|
||||
start-stop-daemon \
|
||||
--start --quiet --pidfile "/var/run/openvswitch/ovs-controller.pid" \
|
||||
--exec /usr/bin/ovs-controller -- --pidfile --detach --monitor ${OPTIONS} ${METHODS}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Open vSwitch OpenFlow controller"
|
||||
start-stop-daemon --stop --quiet --pidfile "/var/run/openvswitch/ovs-controller.pid"
|
||||
eend $?
|
||||
}
|
||||
6
testing/openvswitch/ovs-vswitchd.confd
Normal file
6
testing/openvswitch/ovs-vswitchd.confd
Normal file
@ -0,0 +1,6 @@
|
||||
# Connection string for the configuration database (usually a unix socket)
|
||||
DATABASE="unix:/var/run/openvswitch/db.sock"
|
||||
|
||||
# Additional options
|
||||
OPTIONS="--mlockall"
|
||||
|
||||
24
testing/openvswitch/ovs-vswitchd.initd
Normal file
24
testing/openvswitch/ovs-vswitchd.initd
Normal file
@ -0,0 +1,24 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/files/ovs-vswitchd,v 1.2 2012/07/18 08:41:29 dev-zero Exp $
|
||||
|
||||
depend() {
|
||||
use ovsdb-server
|
||||
}
|
||||
|
||||
start() {
|
||||
checkpath -d "/var/run/openvswitch" -m 0750
|
||||
|
||||
ebegin "Starting Open vSwitch daemon"
|
||||
start-stop-daemon \
|
||||
--start --quiet --pidfile "/var/run/openvswitch/ovs-vswitchd.pid" \
|
||||
--exec /usr/sbin/ovs-vswitchd -- --pidfile --detach --monitor ${OPTIONS} ${DATABASE}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Open vSwitch daemon"
|
||||
start-stop-daemon --stop --quiet --pidfile "/var/run/openvswitch/ovs-vswitchd.pid"
|
||||
eend $?
|
||||
}
|
||||
16
testing/openvswitch/ovsdb-server.confd
Normal file
16
testing/openvswitch/ovsdb-server.confd
Normal file
@ -0,0 +1,16 @@
|
||||
# Socket for bringing the server up
|
||||
DB_SOCKET="/var/run/openvswitch/db.sock"
|
||||
|
||||
# Remote sockets are defined in the database by default
|
||||
REMOTE_DB="db:Open_vSwitch,manager_options"
|
||||
|
||||
# All certificates and keys are stored in the database (if any)
|
||||
PRIVATE_KEY="db:SSL,private_key"
|
||||
CERTIFICATE="db:SSL,certificate"
|
||||
BOOTSTRAP_CA_CERT="db:SSL,ca_cert"
|
||||
|
||||
# Alternative path for the database (default is /etc/openvswitch/conf.db)
|
||||
# DATABASE="/etc/openvswitch/conf.db"
|
||||
|
||||
# Additional options
|
||||
# OPTIONS=""
|
||||
32
testing/openvswitch/ovsdb-server.initd
Normal file
32
testing/openvswitch/ovsdb-server.initd
Normal file
@ -0,0 +1,32 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/files/ovsdb-server,v 1.1 2012/06/27 08:49:34 dev-zero Exp $
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
}
|
||||
|
||||
start() {
|
||||
checkpath -d "/var/run/openvswitch" -m 0750
|
||||
|
||||
local remote_punix=${DB_SOCKET:+"--remote=punix:${DB_SOCKET}"}
|
||||
local remote_db=${REMOTE_DB:+"--remote=${REMOTE_DB}"}
|
||||
local private_key=${PRIVATE_KEY:+"--private-key=${PRIVATE_KEY}"}
|
||||
local certificate=${CERTIFICATE:+"--certificate=${CERTIFICATE}"}
|
||||
local bootstrap_ca_cert=${BOOTSTRAP_CA_CERT:+"--bootstrap-ca-cert=${BOOTSTRAP_CA_CERT}"}
|
||||
|
||||
ebegin "Starting Open vSwitch DB server"
|
||||
start-stop-daemon \
|
||||
--start --quiet \
|
||||
--pidfile "/var/run/openvswitch/ovsdb-server.pid" \
|
||||
--exec /usr/sbin/ovsdb-server -- --pidfile --detach --monitor ${remote_punix} ${remote_db} ${private_key} ${certificate} ${bootstrap_ca_cert} ${DATABASE} ${OPTIONS}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Open vSwitch DB server"
|
||||
start-stop-daemon --stop --quiet --pidfile "/var/run/openvswitch/ovsdb-server.pid"
|
||||
eend $?
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user