From ff3fe68c49ca79e90a2fb1712c1e5881858e0175 Mon Sep 17 00:00:00 2001 From: Tiziano Müller Date: Wed, 18 Jul 2012 08:41:29 +0000 Subject: Add init.d-script for ovs-controller (Portage version: 2.1.11/cvs/Linux x86_64) --- net-misc/openvswitch/ChangeLog | 9 +- net-misc/openvswitch/files/ovs-controller | 24 +++++ net-misc/openvswitch/files/ovs-controller_conf | 7 ++ net-misc/openvswitch/files/ovs-vswitchd | 4 +- net-misc/openvswitch/openvswitch-1.6.1-r1.ebuild | 112 ---------------------- net-misc/openvswitch/openvswitch-1.6.1-r2.ebuild | 114 +++++++++++++++++++++++ 6 files changed, 155 insertions(+), 115 deletions(-) create mode 100644 net-misc/openvswitch/files/ovs-controller create mode 100644 net-misc/openvswitch/files/ovs-controller_conf delete mode 100644 net-misc/openvswitch/openvswitch-1.6.1-r1.ebuild create mode 100644 net-misc/openvswitch/openvswitch-1.6.1-r2.ebuild (limited to 'net-misc/openvswitch') diff --git a/net-misc/openvswitch/ChangeLog b/net-misc/openvswitch/ChangeLog index 9e2fccc48d68..6ac7345aa1cb 100644 --- a/net-misc/openvswitch/ChangeLog +++ b/net-misc/openvswitch/ChangeLog @@ -1,6 +1,13 @@ # 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.3 2012/07/18 07:53:05 dev-zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/ChangeLog,v 1.4 2012/07/18 08:41:29 dev-zero Exp $ + +*openvswitch-1.6.1-r2 (18 Jul 2012) + + 18 Jul 2012; Tiziano Müller +files/ovs-controller, + +files/ovs-controller_conf, +openvswitch-1.6.1-r2.ebuild, + -openvswitch-1.6.1-r1.ebuild, files/ovs-vswitchd: + Add init.d-script for ovs-controller 18 Jul 2012; Tiziano Müller openvswitch-1.6.1-r1.ebuild: Add GPL-2 to LICENSE for init.d files (bug #426086). diff --git a/net-misc/openvswitch/files/ovs-controller b/net-misc/openvswitch/files/ovs-controller new file mode 100644 index 000000000000..554aebe3f2bc --- /dev/null +++ b/net-misc/openvswitch/files/ovs-controller @@ -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 $? +} diff --git a/net-misc/openvswitch/files/ovs-controller_conf b/net-misc/openvswitch/files/ovs-controller_conf new file mode 100644 index 000000000000..1756c9b98bc4 --- /dev/null +++ b/net-misc/openvswitch/files/ovs-controller_conf @@ -0,0 +1,7 @@ + +# Space separated list of methods to listen for OpenFlow connections from switches +# The default ist "ptcp:" which starts ovs-controller listening on port 6633 on all interfaces. +METHODS="ptcp:" + +# Additional options +# OPTIONS="" diff --git a/net-misc/openvswitch/files/ovs-vswitchd b/net-misc/openvswitch/files/ovs-vswitchd index 4fd1758a8f26..eea20db5406e 100644 --- a/net-misc/openvswitch/files/ovs-vswitchd +++ b/net-misc/openvswitch/files/ovs-vswitchd @@ -1,7 +1,7 @@ #!/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 $ +# $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 @@ -13,7 +13,7 @@ start() { 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} + --exec /usr/sbin/ovs-vswitchd -- --pidfile --detach --monitor ${OPTIONS} ${DATABASE} eend $? } diff --git a/net-misc/openvswitch/openvswitch-1.6.1-r1.ebuild b/net-misc/openvswitch/openvswitch-1.6.1-r1.ebuild deleted file mode 100644 index ffe067415d3c..000000000000 --- a/net-misc/openvswitch/openvswitch-1.6.1-r1.ebuild +++ /dev/null @@ -1,112 +0,0 @@ -# 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-r1.ebuild,v 1.2 2012/07/18 07:53:05 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 GPL-2" -SLOT="0" -KEYWORDS="~amd64" -IUSE="debug monitor +pyside +ssl" - -RDEPEND="ssl? ( dev-libs/openssl ) - monitor? ( dev-python/twisted - dev-python/twisted-conch - dev-python/twisted-web - 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 - - if use monitor ; then - insinto $(python_get_sitedir) - doins -r "${D}"/usr/share/openvswitch/python/* - rm -r "${D}/usr/share/openvswitch/python" - fi - # 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 ovs ovstest - - 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)" - elog "or to convert the database to the current schema after upgrading." -} - -pkg_postrm() { - use monitor && python_mod_cleanup /usr/share/openvswitch/ovsdbmonitor ovs ovstest -} - -pkg_config() { - local db="${PREFIX}/etc/openvswitch/conf.db" - if [ -e "${db}" ] ; then - einfo "Database '${db}' already exists, doing schema migration..." - einfo "(if the migration fails, make sure that ovsdb-server is not running)" - "${PREFIX}/usr/bin/ovsdb-tool" convert "${db}" "${PREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "converting database failed" - else - einfo "Creating new database '${db}'..." - "${PREFIX}/usr/bin/ovsdb-tool" create "${db}" "${PREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "creating database failed" - fi -} diff --git a/net-misc/openvswitch/openvswitch-1.6.1-r2.ebuild b/net-misc/openvswitch/openvswitch-1.6.1-r2.ebuild new file mode 100644 index 000000000000..6bffd35ab526 --- /dev/null +++ b/net-misc/openvswitch/openvswitch-1.6.1-r2.ebuild @@ -0,0 +1,114 @@ +# 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-r2.ebuild,v 1.1 2012/07/18 08:41:29 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 GPL-2" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug monitor +pyside +ssl" + +RDEPEND="ssl? ( dev-libs/openssl ) + monitor? ( dev-python/twisted + dev-python/twisted-conch + dev-python/twisted-web + 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 + + if use monitor ; then + insinto $(python_get_sitedir) + doins -r "${D}"/usr/share/openvswitch/python/* + rm -r "${D}/usr/share/openvswitch/python" + fi + # 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 + newconfd "${FILESDIR}/ovs-controller_conf" ovs-controller + doinitd "${FILESDIR}/ovsdb-server" + doinitd "${FILESDIR}/ovs-vswitchd" + doinitd "${FILESDIR}/ovs-controller" + + insinto /etc/logrotate.d + newins rhel/etc_logrotate.d_openvswitch openvswitch +} + +pkg_postinst() { + use monitor && python_mod_optimize /usr/share/openvswitch/ovsdbmonitor ovs ovstest + + 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)" + elog "or to convert the database to the current schema after upgrading." +} + +pkg_postrm() { + use monitor && python_mod_cleanup /usr/share/openvswitch/ovsdbmonitor ovs ovstest +} + +pkg_config() { + local db="${PREFIX}/etc/openvswitch/conf.db" + if [ -e "${db}" ] ; then + einfo "Database '${db}' already exists, doing schema migration..." + einfo "(if the migration fails, make sure that ovsdb-server is not running)" + "${PREFIX}/usr/bin/ovsdb-tool" convert "${db}" "${PREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "converting database failed" + else + einfo "Creating new database '${db}'..." + "${PREFIX}/usr/bin/ovsdb-tool" create "${db}" "${PREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "creating database failed" + fi +} -- cgit v1.2.3-65-gdbad