summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2012-06-27 08:49:35 +0000
committerTiziano Müller <dev-zero@gentoo.org>2012-06-27 08:49:35 +0000
commit503a9c164240be8318de6b192f747404ace704d2 (patch)
tree7da09fc6bae365ad307a1afb44787af72aa6a70c /net-misc/openvswitch
parentVersion bump, drop unused dependency on libkcompactdisc. Remove old. (diff)
downloadgentoo-2-503a9c164240be8318de6b192f747404ace704d2.tar.gz
gentoo-2-503a9c164240be8318de6b192f747404ace704d2.tar.bz2
gentoo-2-503a9c164240be8318de6b192f747404ace704d2.zip
Initial commit (bug #324589). Thanks to all the people on the bug and especially Oliver Roeschke and Florian Manschwetus for testing and comments.
(Portage version: 2.1.11/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/openvswitch')
-rw-r--r--net-misc/openvswitch/ChangeLog11
-rw-r--r--net-misc/openvswitch/files/ovs-vswitchd24
-rw-r--r--net-misc/openvswitch/files/ovs-vswitchd_conf6
-rw-r--r--net-misc/openvswitch/files/ovsdb-server31
-rw-r--r--net-misc/openvswitch/files/ovsdb-server_conf16
-rw-r--r--net-misc/openvswitch/metadata.xml12
-rw-r--r--net-misc/openvswitch/openvswitch-1.6.1.ebuild104
7 files changed, 204 insertions, 0 deletions
diff --git a/net-misc/openvswitch/ChangeLog b/net-misc/openvswitch/ChangeLog
new file mode 100644
index 000000000000..10b2276f2cb4
--- /dev/null
+++ b/net-misc/openvswitch/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for net-misc/openvswitch
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/ChangeLog,v 1.1 2012/06/27 08:49:35 dev-zero Exp $
+
+*openvswitch-1.6.1 (27 Jun 2012)
+
+ 27 Jun 2012; Tiziano Müller <dev-zero@gentoo.org> +files/ovs-vswitchd,
+ +files/ovs-vswitchd_conf, +files/ovsdb-server, +files/ovsdb-server_conf,
+ +metadata.xml, +openvswitch-1.6.1.ebuild:
+ Initial commit (bug #324589). Thanks to all the people on the bug and
+ especially Oliver Roeschke and Florian Manschwetus for testing and comments.
diff --git a/net-misc/openvswitch/files/ovs-vswitchd b/net-misc/openvswitch/files/ovs-vswitchd
new file mode 100644
index 000000000000..4fd1758a8f26
--- /dev/null
+++ b/net-misc/openvswitch/files/ovs-vswitchd
@@ -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.1 2012/06/27 08:49:34 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} ${DB_SOCKET}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Open vSwitch daemon"
+ start-stop-daemon --stop --quiet --pidfile "/var/run/openvswitch/ovs-vswitchd.pid"
+ eend $?
+}
diff --git a/net-misc/openvswitch/files/ovs-vswitchd_conf b/net-misc/openvswitch/files/ovs-vswitchd_conf
new file mode 100644
index 000000000000..c9eadb41862b
--- /dev/null
+++ b/net-misc/openvswitch/files/ovs-vswitchd_conf
@@ -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"
diff --git a/net-misc/openvswitch/files/ovsdb-server b/net-misc/openvswitch/files/ovsdb-server
new file mode 100644
index 000000000000..dbc112f6857a
--- /dev/null
+++ b/net-misc/openvswitch/files/ovsdb-server
@@ -0,0 +1,31 @@
+#!/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 $?
+}
diff --git a/net-misc/openvswitch/files/ovsdb-server_conf b/net-misc/openvswitch/files/ovsdb-server_conf
new file mode 100644
index 000000000000..1299b820640c
--- /dev/null
+++ b/net-misc/openvswitch/files/ovsdb-server_conf
@@ -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=""
diff --git a/net-misc/openvswitch/metadata.xml b/net-misc/openvswitch/metadata.xml
new file mode 100644
index 000000000000..58ed9eb0f936
--- /dev/null
+++ b/net-misc/openvswitch/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>dev-zero@gentoo.org</email>
+</maintainer>
+<herd>virtualization</herd>
+<use>
+ <flag name='monitor'>Build the Python and GUI dependent monitor applications</flag>
+ <flag name='pyside'>Use <pkg>dev-python/pyside</pkg> instead of <pkg>dev-python/PyQt4</pkg> for Python/Qt-bindings when building with USE=monitor.</flag>
+</use>
+</pkgmetadata>
diff --git a/net-misc/openvswitch/openvswitch-1.6.1.ebuild b/net-misc/openvswitch/openvswitch-1.6.1.ebuild
new file mode 100644
index 000000000000..41fdd1aa18ae
--- /dev/null
+++ b/net-misc/openvswitch/openvswitch-1.6.1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/openvswitch-1.6.1.ebuild,v 1.1 2012/06/27 08:49:35 dev-zero Exp $
+
+EAPI=4
+
+PYTHON_DEPEND="monitor? 2"
+
+inherit eutils linux-info python
+
+DESCRIPTION="Production quality, multilayer virtual switch."
+HOMEPAGE="http://openvswitch.org"
+SRC_URI="http://openvswitch.org/releases/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug monitor +pyside +ssl"
+
+RDEPEND="ssl? ( dev-libs/openssl )
+ monitor? ( dev-python/twisted
+ dev-python/twisted-conch
+ pyside? ( dev-python/pyside )
+ !pyside? ( dev-python/PyQt4 )
+ net-zope/zope-interface )
+ debug? ( dev-lang/perl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+CONFIG_CHECK="~NET_CLS_ACT ~NET_CLS_U32 ~NET_SCH_INGRESS ~NET_ACT_POLICE ~IPV6 ~TUN ~OPENVSWITCH"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_configure() {
+ set_arch_to_kernel
+ use monitor || export ovs_cv_python="no"
+ use pyside || export ovs_cv_pyuic4="no"
+ local modconf
+ econf ${modconf} \
+ --with-rundir=/var/run/openvswitch \
+ --with-logdir=/var/log/openvswitch \
+ --with-pkidir=/etc/openvswitch/pki \
+ $(use_enable ssl) \
+ $(use_enable !debug ndebug)
+}
+
+src_compile() {
+ default
+
+ use monitor && python_convert_shebangs 2 \
+ utilities/ovs-{pcap,tcpundump,test,vlan-test} \
+ utilities/bugtool/ovs-bugtool \
+ ovsdb/ovsdbmonitor/ovsdbmonitor
+}
+
+src_install() {
+ default
+
+ # not working without the brcompat_mod kernel module which did not get
+ # included in the kernel and we can't build it anymore
+ rm "${D}/usr/sbin/ovs-brcompatd" "${D}/usr/share/man/man8/ovs-brcompatd.8"
+
+ keepdir /var/log/openvswitch
+ keepdir /etc/openvswitch/pki
+
+ rm -rf "${D}/var/run"
+ use monitor || rmdir "${D}/usr/share/openvswitch/ovsdbmonitor"
+ use debug || rm "${D}/usr/bin/ovs-parse-leaks"
+
+ newconfd "${FILESDIR}/ovsdb-server_conf" ovsdb-server
+ newconfd "${FILESDIR}/ovs-vswitchd_conf" ovs-vswitchd
+ doinitd "${FILESDIR}/ovsdb-server"
+ doinitd "${FILESDIR}/ovs-vswitchd"
+
+ insinto /etc/logrotate.d
+ newins rhel/etc_logrotate.d_openvswitch openvswitch
+}
+
+pkg_postinst() {
+ use monitor && python_mod_optimize /usr/share/openvswitch/ovsdbmonitor
+ python_mod_optimize /usr/share/openvswitch/python
+
+ elog "Use the following command to create an initial database for ovsdb-server:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ elog "(will create a database in /etc/openvswitch/conf.db)"
+}
+
+pkg_postrm() {
+ use monitor && python_mod_cleanup /usr/share/openvswitch/ovsdbmonitor
+ python_mod_cleanup /usr/share/openvswitch/python
+}
+
+pkg_config() {
+ local db="${PREFIX}/etc/openvswitch/conf.db"
+ if [ -e "${db}" ] ; then
+ eerror "Database already exists in ${db}, please remove it first."
+ die "${db} already exists"
+ fi
+ "${PREFIX}/usr/bin/ovsdb-tool" create "${db}" /usr/share/openvswitch/vswitch.ovsschema
+}