Dominique Leuenberger 2016-05-25 19:28:20 +00:00 committed by Git OBS Bridge
commit 2a45959c86
13 changed files with 99 additions and 1031 deletions

View File

@ -1 +0,0 @@
- kernel/net/openvswitch/openvswitch

View File

@ -1,17 +0,0 @@
This package is based on the Debian openvswitch package as the
original openvswitch package in the build service was next to useless
due of being based on the xenserver/ directory of the sources, which
tied the package completely to xen.
Also, the original package was one big package depending even on Qt4.
This package splits in varius subpackages.
The xen part was removed. If it needs to be added again, it needs to
be its subpackage.
TODO:
- [DONE] sysconfig is bogus, as the init scripts do not source it yet (uses debian defaults file)
- pki component does not have the postun postin scripts yet

View File

@ -1,36 +0,0 @@
Index: lib/vlog.c
===================================================================
--- lib/vlog.c.orig
+++ lib/vlog.c
@@ -273,7 +273,7 @@ set_destination_level(enum vlog_destinat
ovs_mutex_lock(&log_file_mutex);
if (!module) {
struct vlog_module *mp;
- LIST_FOR_EACH (mp, list, &vlog_modules) {
+ LIST_FOR_EACH_CHECK (mp, list, &vlog_modules) {
mp->levels[destination] = level;
update_min_level(mp);
}
@@ -397,7 +397,7 @@ vlog_set_log_file(const char *file_name)
log_writer = async_append_create(new_log_fd);
}
- LIST_FOR_EACH (mp, list, &vlog_modules) {
+ LIST_FOR_EACH_CHECK (mp, list, &vlog_modules) {
update_min_level(mp);
}
ovs_mutex_unlock(&log_file_mutex);
Index: lib/list.h
===================================================================
--- lib/list.h.orig
+++ lib/list.h
@@ -271,4 +271,9 @@ list_is_short(const struct ovs_list *lis
return list->next == list->prev;
}
+#define LIST_FOR_EACH_CHECK(ITER, MEMBER, LIST) \
+ for (ASSIGN_CONTAINER(ITER, (LIST)->next, MEMBER); \
+ &(ITER)->MEMBER != (LIST) && (ITER)->MEMBER.next != (ITER)->MEMBER.prev; \
+ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER))
+
#endif /* list.h */

View File

@ -1,187 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# This is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with
# the Debian operating system, in /usr/share/common-licenses/GPL; if
# not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
#
### BEGIN INIT INFO
# Provides: openvswitch-ipsec
# Required-Start: $network $local_fs $remote_fs openvswitch-switch
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Open vSwitch GRE-over-IPsec daemon
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/share/openvswitch/scripts/ovs-monitor-ipsec # Daemon's location
NAME=ovs-monitor-ipsec # Introduce the short server's name here
LOGDIR=/var/log/openvswitch # Log directory to use
PIDFILE=/var/run/openvswitch/$NAME.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
DODTIME=10 # Time to wait for the server to die, in seconds
# If this value is set too low you might not
# let some servers to die gracefully and
# 'restart' will not work
set -e
running_pid() {
# Check if a given process pid's cmdline matches a given name
pid=$1
name=$2
[ -z "$pid" ] && return 1
[ ! -d /proc/$pid ] && return 1
cmd=`cat /proc/$pid/cmdline | tr "\000" " "|cut -d " " -f 2`
# Is this the expected server
[ "$cmd" != "$name" ] && return 1
return 0
}
running() {
# Check if the process is running looking at /proc
# (works for all users)
# No pidfile, probably no daemon present
[ ! -f "$PIDFILE" ] && return 1
pid=`cat $PIDFILE`
running_pid $pid $DAEMON || return 1
return 0
}
start_server() {
if [ ! -d /var/run/openvswitch ]; then
install -d -m 755 -o root -g root /var/run/openvswitch
fi
/usr/share/openvswitch/scripts/ovs-monitor-ipsec \
--pidfile=$PIDFILE --log-file --detach --monitor \
unix:/var/run/openvswitch/db.sock
return 0
}
stop_server() {
if [ -e $PIDFILE ]; then
kill `cat $PIDFILE`
fi
return 0
}
force_stop() {
# Force the process to die killing it manually
[ ! -e "$PIDFILE" ] && return
if running ; then
kill -15 $pid
# Is it really dead?
sleep "$DODTIME"
if running ; then
kill -9 $pid
sleep "$DODTIME"
if running ; then
echo "Cannot kill $NAME (pid=$pid)!"
exit 1
fi
fi
fi
rm -f $PIDFILE
}
case "$1" in
start)
log_daemon_msg "Starting $NAME"
# Check if it's running first
if running ; then
log_progress_msg "apparently already running"
log_end_msg 0
exit 0
fi
if start_server && running ; then
# It's ok, the server started and is running
log_end_msg 0
else
# Either we could not start it or it is not running
# after we did
# NOTE: Some servers might die some time after they start,
# this code does not try to detect this and might give
# a false positive (use 'status' for that)
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping $NAME"
if running ; then
# Only stop the server if we see it running
stop_server
log_end_msg $?
else
# If it's not running don't do anything
log_progress_msg "apparently not running"
log_end_msg 0
exit 0
fi
;;
force-stop)
# First try to stop gracefully the program
$0 stop
if running; then
# If it's still running try to kill it more forcefully
log_daemon_msg "Stopping (force) $NAME"
force_stop
log_end_msg $?
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $NAME"
stop_server
# Wait some sensible amount, some server need this
[ -n "$DODTIME" ] && sleep $DODTIME
start_server
running
log_end_msg $?
;;
status)
log_daemon_msg "Checking status of $NAME"
if running ; then
log_progress_msg "running"
log_end_msg 0
else
log_progress_msg "apparently not running"
log_end_msg 1
exit 1
fi
;;
# Use this if the daemon cannot reload
reload)
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
log_warning_msg "cannot re-read the config file (use restart)."
;;
*)
N=/etc/init.d/openvswitch-ipsec
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@ -1,119 +0,0 @@
#! /bin/sh
#
# Copyright (C) 2011 Nicira Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
### BEGIN INIT INFO
# Provides: openvswitch-switch
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Open vSwitch switch
### END INIT INFO
(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0
. /etc/rc.status
rc_reset
. /usr/share/openvswitch/scripts/ovs-lib
test -e /etc/sysconfig/openvswitch-switch && . /etc/sysconfig/openvswitch-switch
if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then
BRCOMPAT=no
log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility"
fi
ovs_ctl () {
set /usr/share/openvswitch/scripts/ovs-ctl "$@"
if test X"$BRCOMPAT" = Xyes; then
set "$@" --brcompat
fi
"$@"
}
load_kmod () {
ovs_ctl load-kmod || exit $?
}
start () {
if ovs_ctl load-kmod; then
:
else
echo "Module has probably not been built for this kernel."
if ! test -d /usr/share/doc/openvswitch-datapath-source; then
echo "Install the openvswitch-datapath-source package, then read"
else
echo "For instructions, read"
fi
echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
fi
set ovs_ctl ${1-start} --system-id=random
if test X"$FORCE_COREFILES" != X; then
set "$@" --force-corefiles="$FORCE_COREFILES"
fi
"$@" || exit $?
ovs_ctl --protocol=gre enable-protocol
}
stop () {
ovs_ctl stop
}
case $1 in
start)
start
;;
stop | force-stop)
stop
;;
reload | force-reload)
# The OVS daemons keep up-to-date.
;;
try-restart|condrestart)
#restart the service if the service is already running
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
rc_status # Remember status and be quiet
;;
restart)
stop
start
;;
status)
ovs_ctl status
exit $?
;;
force-reload-kmod)
start force-reload-kmod
;;
load-kmod)
load_kmod
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2
exit 1
;;
esac
exit 0

View File

@ -1,278 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2011, 2014 Nicira, Inc.
# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# This is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with
# the Debian operating system, in /usr/share/common-licenses/GPL; if
# not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
#
### BEGIN INIT INFO
# Provides: openvswitch-testcontroller
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $named
# Should-Stop: $null
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple OpenFlow controller for testing
# Description: This controller enables OpenFlow switches that connect to
# it to act as MAC-learning Ethernet switches.
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/ovs-testcontroller # Introduce the server's location here
NAME=ovs-testcontroller # Introduce the short server's name here
DESC=ovs-testcontroller # Introduce a short description here
LOGDIR=/var/log/openvswitch # Log directory to use
PIDFILE=/var/run/openvswitch/$NAME.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
# Default options, these can be overriden by the information
# at /etc/default/openvswitch-testcontroller
DAEMON_OPTS="" # Additional options given to the server
DODTIME=10 # Time to wait for the server to die, in seconds
# If this value is set too low you might not
# let some servers to die gracefully and
# 'restart' will not work
LOGFILE=$LOGDIR/$NAME.log # Server logfile
#DAEMONUSER= # User to run the daemons as. If this value
# is set start-stop-daemon will chuid the server
# Include defaults if available
default=/etc/default/openvswitch-testcontroller
if [ -f $default ] ; then
. $default
fi
# Check that the user exists (if we set a user)
# Does the user exist?
if [ -n "$DAEMONUSER" ] ; then
if getent passwd | grep -q "^$DAEMONUSER:"; then
# Obtain the uid and gid
DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
else
log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist."
exit 1
fi
fi
set -e
running_pid() {
# Check if a given process pid's cmdline matches a given name
pid=$1
name=$2
[ -z "$pid" ] && return 1
[ ! -d /proc/$pid ] && return 1
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
# Is this the expected server
[ "$cmd" != "$name" ] && return 1
return 0
}
running() {
# Check if the process is running looking at /proc
# (works for all users)
# No pidfile, probably no daemon present
[ ! -f "$PIDFILE" ] && return 1
pid=`cat $PIDFILE`
running_pid $pid $DAEMON || return 1
return 0
}
start_server() {
if [ -z "$LISTEN" ]; then
echo "$default: No connection methods configured, controller disabled" >&2
exit 0
fi
if [ ! -d /var/run/openvswitch ]; then
install -d -m 755 -o root -g root /var/run/openvswitch
fi
SSL_OPTS=
case $LISTEN in
*ssl*)
: ${PRIVKEY:=/etc/openvswitch-testcontroller/privkey.pem}
: ${CERT:=/etc/openvswitch-testcontroller/cert.pem}
: ${CACERT:=/etc/openvswitch-testcontroller/cacert.pem}
if test ! -e "$PRIVKEY" || test ! -e "$CERT" ||
test ! -e "$CACERT"; then
if test ! -e "$PRIVKEY"; then
echo "$PRIVKEY: private key missing" >&2
fi
if test ! -e "$CERT"; then
echo "$CERT: certificate for private key missing" >&2
fi
if test ! -e "$CACERT"; then
echo "$CACERT: CA certificate missing" >&2
fi
exit 1
fi
SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT"
;;
esac
# Start the process using the wrapper
if [ -z "$DAEMONUSER" ] ; then
start-stop-daemon --start --pidfile $PIDFILE \
--exec $DAEMON -- --detach --pidfile=$PIDFILE \
$LISTEN $DAEMON_OPTS $SSL_OPTS
errcode=$?
else
# if we are using a daemonuser then change the user id
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--chuid $DAEMONUSER --exec $DAEMON -- \
--detach --pidfile=$PIDFILE $LISTEN $DAEMON_OPTS \
$SSL_OPTS
errcode=$?
fi
return $errcode
}
stop_server() {
# Stop the process using the wrapper
if [ -z "$DAEMONUSER" ] ; then
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
errcode=$?
else
# if we are using a daemonuser then look for process that match
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--user $DAEMONUSER --exec $DAEMON
errcode=$?
fi
return $errcode
}
reload_server() {
[ ! -f "$PIDFILE" ] && return 1
pid=`cat $PIDFILE` # This is the daemon's pid
# Send a SIGHUP
kill -1 $pid
return $?
}
force_stop() {
# Force the process to die killing it manually
[ ! -e "$PIDFILE" ] && return
if running ; then
kill -15 $pid
# Is it really dead?
sleep "$DODTIME"
if running ; then
kill -9 $pid
sleep "$DODTIME"
if running ; then
echo "Cannot kill $NAME (pid=$pid)!"
exit 1
fi
fi
fi
rm -f $PIDFILE
}
case "$1" in
start)
log_daemon_msg "Starting $DESC " "$NAME"
# Check if it's running first
if running ; then
log_progress_msg "apparently already running"
log_end_msg 0
exit 0
fi
if start_server && running ; then
# It's ok, the server started and is running
log_end_msg 0
else
# Either we could not start it or it is not running
# after we did
# NOTE: Some servers might die some time after they start,
# this code does not try to detect this and might give
# a false positive (use 'status' for that)
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
if running ; then
# Only stop the server if we see it running
stop_server
log_end_msg $?
else
# If it's not running don't do anything
log_progress_msg "apparently not running"
log_end_msg 0
exit 0
fi
;;
force-stop)
# First try to stop gracefully the program
$0 stop
if running; then
# If it's still running try to kill it more forcefully
log_daemon_msg "Stopping (force) $DESC" "$NAME"
force_stop
log_end_msg $?
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
if running; then
stop_server
# Wait some sensible amount, some server need this.
[ -n "$DODTIME" ] && sleep $DODTIME
fi
start_server
running
log_end_msg $?
;;
status)
log_daemon_msg "Checking status of $DESC" "$NAME"
if running ; then
log_progress_msg "running"
log_end_msg 0
else
log_progress_msg "apparently not running"
log_end_msg 1
exit 1
fi
;;
# Use this if the daemon cannot reload
reload)
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
log_warning_msg "cannot re-read the config file (use restart)."
;;
*)
N=/etc/init.d/openvswitch-testcontroller
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@ -1,78 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: openvswitch-vtep
# Required-Start: $network $named $remote_fs $syslog
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Open vSwitch VTEP emulator
# Description: Initializes the Open vSwitch VTEP emulator
### END INIT INFO
# Include defaults if available
default=/etc/default/openvswitch-vtep
if [ -f $default ] ; then
. $default
fi
start () {
if [ "$ENABLE_OVS_VTEP" = "false" ]; then
exit 0
fi
update-rc.d -f openvswitch-switch remove >/dev/null 2>&1
/etc/init.d/openvswitch-switch stop
mkdir -p "/var/run/openvswitch"
if [ ! -e "/etc/openvswitch/conf.db" ]; then
ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
fi
if [ ! -e "/etc/openvswitch/vtep.db" ]; then
ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema
fi
if [ ! -e "/etc/openvswitch/ovsclient-cert.pem" ]; then
export RANDFILE="/root/.rnd"
cd /etc/openvswitch && ovs-pki req ovsclient && ovs-pki self-sign ovsclient
fi
ovsdb-server --pidfile --detach --log-file --remote \
punix:/var/run/openvswitch/db.sock \
--remote=db:hardware_vtep,Global,managers \
--private-key=/etc/openvswitch/ovsclient-privkey.pem \
--certificate=/etc/openvswitch/ovsclient-cert.pem \
--bootstrap-ca-cert=/etc/openvswitch/vswitchd.cacert \
/etc/openvswitch/conf.db /etc/openvswitch/vtep.db
modprobe openvswitch
ovs-vswitchd --pidfile --detach --log-file \
unix:/var/run/openvswitch/db.sock
}
stop () {
/etc/init.d/openvswitch-switch stop
}
case $1 in
start)
start
;;
stop)
stop
;;
restart|force-reload)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

View File

@ -1,3 +1,46 @@
-------------------------------------------------------------------
Mon May 23 18:33:13 UTC 2016 - jengelh@inai.de
- Keep %prep small for speedier `quilt setup`. Kill __DATE__ from
source. Drop all .la files that are in %_libdir.
-------------------------------------------------------------------
Fri May 20 09:54:16 UTC 2016 - mchandras@suse.de
- Add missing %dir directive for /var/log/openvswitch
-------------------------------------------------------------------
Thu May 19 10:13:41 UTC 2016 - dmueller@suse.com
- remove aarch64 conditional, no longer needed
-------------------------------------------------------------------
Thu May 5 09:00:26 UTC 2016 - mchandras@suse.de
- Multiple spec file and package fixes.
* Drop obsolete log-check-module-loop.patch patch.
* Drop conditional code for older openSUSE releases. This also removes
all of the sysvinit files which were pulled in when the package was
originally developed.
* Drop support for building the GUI. The GUI code has been removed in
7868fbc6c97c2 ("ovsdbmonitor: Remove.") upstream commit and it does
not exist since v2.2.0 so drop the code in the spec file.
* Use the upstream systemd service files for the OVN components instead
of maintaining our own downstream.
* Drop the unofficial ipsec support. It hasn't been enabled in years.
* Drop support for building the upstream kernel module since it's being
shipped with the kernel package in latest releases. Restore the
%bcond_with kmp to make it easier to build the external kernel module
if needed.
* Fix some suse-missing-rclink rpmlint warnings for the ovn subpackage
* Base our service unit to the upstream one.
* Stop silently enabling the GRE protocol in iptables by default.
* Install the upstream sysconfig file to pass more information to the
openvswitch service unit.
* Use make install instead of %makeinstall
* Drop brcompat leftovers.
* spec-cleaner fixes
-------------------------------------------------------------------
Fri Apr 1 10:39:26 UTC 2016 - dmueller@suse.com

View File

@ -5,8 +5,10 @@ Before=network.service
[Service]
Type=oneshot
ExecStart=/usr/share/openvswitch/scripts/openvswitch-switch start
ExecStop=/usr/share/openvswitch/scripts/openvswitch-switch stop
EnvironmentFile=-/etc/sysconfig/openvswitch
ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start \
--system-id=random $OPTIONS
ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop
RemainAfterExit=yes
[Install]

View File

@ -18,10 +18,8 @@
# needssslcertforbuild
# IpSec build disabled temporarily (need to upgrade ipsec-tools):
%bcond_with ipsec
# Disable GUI building by default (heavy Qt4 dependencies):
%bcond_with gui
# Disable building the external kernel datapath by default
%bcond_with kmp
Name: openvswitch
Version: 2.5.0
@ -32,21 +30,9 @@ Group: Productivity/Networking/System
Url: http://openvswitch.org/
Source0: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
Source1: preamble
Source2: openvswitch-switch.init
Source4: openvswitch-switch.logrotate
Source5: openvswitch-vtep.init
Source6: openvswitch-ipsec.init
Source7: openvswitch.service
Source8: openvswitch-testcontroller.init
Source10: Module.supported
Source11: Module.supported.updates
%if 0%{?suse_version} > 1110
Source12: ovn-controller.service
Source13: ovn-controller-vtep.service
Source14: ovn-northd.service
%endif
Source99: README.packager
Patch2: log-check-module-loop.patch
Source2: openvswitch-switch.logrotate
Source3: openvswitch.service
Source89: Module.supported.updates
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
@ -61,9 +47,6 @@ BuildRequires: perl
BuildRequires: pkg-config
BuildRequires: python-devel
BuildRequires: python-xml
%ifnarch aarch64
BuildRequires: valgrind-devel
%endif
Requires: logrotate
Requires: openssl
Requires: python
@ -73,6 +56,7 @@ Provides: openvswitch-controller = %{version}
Obsoletes: openvswitch-controller < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%py_requires
BuildRequires: valgrind-devel
%description
Open vSwitch is a production quality, multilayer virtual switch licensed under
@ -83,16 +67,12 @@ it is designed to support distribution across multiple physical servers similar
VMwares vNetwork distributed vswitch or Ciscos Nexus 1000V.
%if %{with kmp}
%package kmp
Summary: Open vSwitch kernel modules
License: GPL-2.0+
Group: System/Kernel
BuildRequires: %kernel_module_package_buildreqs
%if %{with kernel_kmp}
BuildRequires: kernel-source
%endif
%suse_kernel_module_package -p %_sourcedir/preamble ec2 xenpae vmi um
BuildRequires: %{kernel_module_package_buildreqs}
%suse_kernel_module_package -p %{_sourcedir}/preamble ec2 xenpae vmi um
%description -n %{name}-kmp
Kernel modules supporting the openvswitch datapath.
@ -104,47 +84,23 @@ License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
%description devel
%description devel
Devel libraries and headers for Open vSwitch.
%if %{with ipsec}
%package ipsec
Summary: Open vSwitch GRE-over-IPsec support
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
Requires: %{name}-switch = %{version}
Requires: ipsec-tools >= 0.8
Requires: python
Requires: python-argparse
Requires: python-openvswitch = %{version}
Requires: racoon >= 0.8
%description ipsec
The ovs-monitor-ipsec script provides support for encrypting GRE
tunnels with IPsec.
Open vSwitch is a full-featured software-based Ethernet switch.
%endif
%package switch
Summary: Open vSwitch switch implementations
License: Apache-2.0
Group: Productivity/Networking/System
Requires(pre): %fillup_prereq
Requires(pre): %insserv_prereq
Requires: modutils
Requires: openvswitch = %{version}
Requires: procps
Requires: python
# ovs-ctl / ovs-pki use /usr/bin/uuidgen:
Requires: util-linux
Suggests: openvswitch-kmp
Requires(post): %fillup_prereq
Suggests: logrotate
%if 0%{?suse_version} > 1230
Suggests: openvswitch-kmp
%{?systemd_requires}
%endif
%description switch
openvswitch-switch provides the userspace components and utilities for
@ -152,7 +108,6 @@ the Open vSwitch kernel-based switch.
Open vSwitch is a full-featured software-based Ethernet switch.
%if 0%{?suse_version} > 1110
%package ovn
Summary: Open vSwitch - Open Virtual Network support
License: Apache-2.0
@ -166,7 +121,6 @@ OVN, the Open Virtual Network, is a system to support virtual network
abstraction. OVN complements the existing capabilities of OVS to add
native support for virtual network abstractions, such as virtual L2 and L3
overlays and security groups.
%endif
%package pki
Summary: Open vSwitch public key infrastructure dependency package
@ -195,25 +149,6 @@ A VTEP emulator that uses Open vSwitch for forwarding.
Open vSwitch is a full-featured software-based Ethernet switch.
%package brcompat
Summary: Open vSwitch bridge compatibility support (deprecated)
License: Apache-2.0
Group: Productivity/Networking/System
Requires: openvswitch-switch = %{version}
Recommends: bridge-utils
%description brcompat
openvswitch-brcompat provides a way for applications that use the
Linux bridge to gradually migrate to Open vSwitch. Programs that
ordinarily control the Linux bridge module, such as "brctl", instead
control the Open vSwitch kernel-based switch. Please note that this
feature is deprecated and will be removed soon.
Once this package is installed, adding BRCOMPAT=yes in
/etc/default/openvswitch-switch enables bridge compatibility.
Open vSwitch is a full-featured software-based Ethernet switch.
%package -n python-openvswitch
Summary: Python bindings for Open vSwitch
License: Python-2.0
@ -236,33 +171,6 @@ Requires: python-twisted
%description -n python-openvswitch-test
This package contains the full Python bindings for Open vSwitch database.
%if %{with gui}
%package ovsdbmonitor
Summary: Open vSwitch graphical monitoring tool
License: Apache-2.0
Group: Productivity/Networking/System
BuildRequires: python-pyside
BuildRequires: python-qt4-devel
BuildRequires: python-twisted
BuildRequires: python-zopeinterface
Requires: python-openvswitch
Requires: python-pyasn1
Requires: python-pyside
Requires: python-qt4
Requires: python-twisted
Requires: python-zopeinterface
%description ovsdbmonitor
This package is a GUI tool for monitoring and troubleshooting local
or remote Open vSwitch installations. It presents GUI tables that
graphically represent an Open vSwitch kernel flow table (similar to
"ovs-dpctl dump-flows") and Open vSwitch database contents (similar
to "ovs-vsctl list <table>").
Open vSwitch is a full-featured software-based Ethernet switch.
%endif
%package test
Summary: Open vSwitch test package
License: Apache-2.0
@ -281,53 +189,40 @@ Open vSwitch is a full-featured software-based Ethernet switch.
%prep
%setup -q
%patch2 -p0
%build
set -- * .travis*
mkdir source
mv "$@" source/
mkdir obj
%build
pushd source
perl -i -pe 's{__(DATE|TIME)__}{""}g' include/openvswitch/util.h
# only call boot.sh for distros with autoconf >= 2.64
%if 0%{?suse_version} > 1110
bash -x boot.sh
%endif
bash -x boot.sh
popd
%if %{with kmp}
%if %{with kernel_kmp}
for flavor in %flavors_to_build; do
mkdir -p $flavor
cp -a %{SOURCE10} $flavor/
krel=$(make -s -C /usr/src/linux-obj/%_target_cpu/$flavor kernelrelease)
kernel_source_dir=$(readlink /lib/modules/$krel/source)
cp -a $kernel_source_dir/net/openvswitch/* $flavor/
make %{?_smp_mflags} -C %{kernel_source $flavor} modules M=$PWD/$flavor
done
%else
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
for flavor in %flavors_to_build; do
for flavor in %{flavors_to_build}; do
rm -rf obj/$flavor
cp -r source obj/$flavor
cp -a %{SOURCE11} obj/$flavor/datapath/linux/Module.supported
cp -a %{SOURCE89} obj/$flavor/datapath/linux/Module.supported
pushd obj/$flavor
%configure \
--with-logdir=/var/log/openvswitch \
--with-linux=/usr/src/linux-obj/%_target_cpu/$flavor \
--with-linux-source=/usr/src/linux
--with-logdir=%{_localstatedir}/log/openvswitch \
--with-linux=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor \
--with-linux-source=%{_prefix}/src/linux
cd datapath/linux
make %{?_smp_mflags}
popd
done
%endif
%endif
ls source
pushd source
%configure \
--disable-static \
--enable-shared \
--with-logdir=/var/log/openvswitch
--with-logdir=%{_localstatedir}/log/openvswitch
make %{?_smp_mflags}
popd
@ -337,137 +232,78 @@ export NO_BRP_STALE_LINK_ERROR=yes
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
export BRP_PESIGN_FILES="*.ko /lib/firmware"
for flavor in %flavors_to_build; do
%if %{with kernel_kmp}
make -C %{kernel_source $flavor} modules_install M=$PWD/$flavor
%else
for flavor in %{flavors_to_build}; do
pushd obj/$flavor/datapath/linux
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install M=$PWD
make -C %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor modules_install M=$PWD
popd
%endif
done
%endif
pushd source
%makeinstall
install -d -m 755 %{buildroot}/%{_datadir}/%{name}/scripts
install -d -m 755 %{buildroot}/%{_sysconfdir}/init.d
install -d -m 755 %{buildroot}%{_localstatedir}/adm/fillup-templates
make %{?_smp_mflags} DESTDIR=%{buildroot} install
for service in ovn-controller ovn-controller-vtep ovn-northd; do
install -D -m 644 rhel/usr_lib_systemd_system_${service}.service \
%{buildroot}%{_unitdir}/${service}.service
done
# We use our own openvswitch.service
install -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
install -m 755 %{SOURCE2} \
%{buildroot}/%{_sysconfdir}/init.d/%{name}-switch
install -m 755 %{SOURCE5} \
%{buildroot}/%{_sysconfdir}/init.d/%{name}-vtep
install -m 755 %{SOURCE8} \
%{buildroot}/%{_sysconfdir}/init.d/%{name}-testcontroller
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcovn-controller
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcovn-controller-vtep
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcovn-northd
%if 0%{?suse_version} > 1230
ln -sf %_sbindir/service %{buildroot}%{_sbindir}/rc%{name}
ln -sf %_sbindir/service %{buildroot}%{_sbindir}/rc%{name}-vtep
ln -sf %_sbindir/service %{buildroot}%{_sbindir}/rc%{name}-testcontroller
# Move the openvswitch-switch rc file to the scripts directory
# to prevent systemd from autogenerating a unit file for us (bsc#966762)
mv %{buildroot}/%{_sysconfdir}/init.d/%{name}-switch \
%{buildroot}/%{_datadir}/%{name}/scripts/%{name}-switch
install -D -m 644 %{SOURCE7} \
%{buildroot}%{_unitdir}/openvswitch.service
install -D -m 644 %{SOURCE12} \
%{buildroot}%{_unitdir}/ovn-controller.service
install -D -m 644 %{SOURCE13} \
%{buildroot}%{_unitdir}/ovn-controller-vtep.service
install -D -m 644 %{SOURCE14} \
%{buildroot}%{_unitdir}/ovn-northd.service
%else
ln -sf %{_sysconfdir}/init.d/%{name}-switch %{buildroot}%{_sbindir}/rc%{name}-switch
ln -sf %{_sysconfdir}/init.d/%{name}-vtep %{buildroot}%{_sbindir}/rc%{name}-vtep
ln -sf %{_sysconfdir}/init.d/%{name}-testcontroller %{buildroot}%{_sbindir}/rc%{name}-testcontroller
%endif
install -D -m 644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
%{buildroot}/%{_localstatedir}/adm/fillup-templates/sysconfig.openvswitch
install -d -m 755 %{buildroot}/%{_sysconfdir}/sysconfig
install -d -m 755 %{buildroot}/%{_sysconfdir}/logrotate.d
install -d -m 755 %{buildroot}/var/log/openvswitch
install -d -m 755 %{buildroot}/%{_localstatedir}/log/openvswitch
install -m 644 %{SOURCE4} \
install -m 644 %{SOURCE2} \
%{buildroot}/%{_sysconfdir}/logrotate.d/%{name}-switch
install -d -m 755 %{buildroot}/%{_sysconfdir}/profile.d
install -m 644 vswitchd/vswitch.ovsschema \
%{buildroot}/%{_datadir}/%{name}/vswitch.ovsschema
%if %{with ipsec}
install -m 755 debian/ovs-monitor-ipsec \
%{buildroot}/%{_datadir}/%{name}/ovs-monitor-ipsec
install -m 755 %{SOURCE6} \
%{buildroot}/%{_sysconfdir}/init.d/%{name}-ipsec
ln -s %{_sysconfdir}/init.d/%{name}-ipsec %{buildroot}%{_sbindir}/rc%{name}-ipsec
%endif
popd
mkdir -p %{buildroot}%{py_sitedir}
mv %{buildroot}%{_datadir}/%{name}/python/* %{buildroot}%{py_sitedir}
rmdir %{buildroot}%{_datadir}/%{name}/python
rm -f %buildroot/%_libdir/*.la
%fdupes %{buildroot}%{py_sitedir}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%pre switch
%if 0%{?suse_version} > 1230
%service_add_pre openvswitch.service
%endif
%post switch
%{fillup_only -n openvswitch-switch}
%if 0%{?suse_version} > 1230
%service_add_post openvswitch.service
%endif
%{fillup_only -n openvswitch}
%preun switch
%stop_on_removal openvswitch-switch
%if 0%{?suse_version} > 1230
%service_del_preun openvswitch.service
%endif
%postun switch
%restart_on_update openvswitch-switch
%if 0%{?suse_version} > 1230
%service_del_postun openvswitch.service
%endif
%insserv_cleanup
%if 0%{?suse_version} > 1110
%pre ovn
%if 0%{?suse_version} > 1230
%service_add_pre ovn-controller.service
%service_add_pre ovn-controller-vtep.service
%service_add_pre ovn-northd.service
%endif
%service_add_pre ovn-controller.service ovn-controller-vtep.service ovn-northd.service
%post ovn
/sbin/ldconfig
%if 0%{?suse_version} > 1230
%service_add_post ovn-controller.service
%service_add_post ovn-controller-vtep.service
%service_add_post ovn-northd.service
%endif
%service_add_post ovn-controller.service ovn-controller-vtep.service ovn-northd.service
%preun ovn
%if 0%{?suse_version} > 1230
%service_del_preun ovn-controller.service
%service_del_preun ovn-controller-vtep.service
%service_del_preun ovn-northd.service
%endif
%service_del_preun ovn-controller.service ovn-controller-vtep.service ovn-northd.service
%postun ovn
%if 0%{?suse_version} > 1230
%service_del_postun ovn-controller.service
%service_del_postun ovn-controller-vtep.service
%service_del_postun ovn-northd.service
%endif
%service_del_postun ovn-controller.service ovn-controller-vtep.service ovn-northd.service
/sbin/ldconfig
%endif
%preun test
%stop_on_removal openvswitch-testcontroller
@ -476,13 +312,7 @@ rmdir %{buildroot}%{_datadir}/%{name}/python
%restart_on_update openvswitch-testcontroller
%post vtep -p /sbin/ldconfig
%preun vtep
%stop_on_removal openvswitch-vtep
%postun vtep
%restart_on_update openvswitch-vtep
/sbin/ldconfig
%postun vtep -p /sbin/ldconfig
%files
%defattr(-,root,root)
@ -535,8 +365,6 @@ rmdir %{buildroot}%{_datadir}/%{name}/python
%files vtep
%defattr(-,root,root)
%{_bindir}/vtep-ctl
%{_sysconfdir}/init.d/openvswitch-vtep
%{_sbindir}/rc%{name}-vtep
%{_mandir}/man5/vtep.5.gz
%{_mandir}/man8/vtep-ctl.8.gz
%{_datadir}/openvswitch/scripts/ovs-vtep
@ -551,15 +379,6 @@ rmdir %{buildroot}%{_datadir}/%{name}/python
%defattr(-,root,root)
%{py_sitedir}/ovstest/
%if %{with ipsec}
%files ipsec
%defattr(-,root,root)
%{_datadir}/openvswitch/ovs-monitor-ipsec
%{_sysconfdir}/init.d/openvswitch-ipsec
%{_sbindir}/rc%{name}-ipsec
%endif
%files switch
%defattr(-,root,root)
%{_bindir}/ovs-docker
@ -586,17 +405,11 @@ rmdir %{buildroot}%{_datadir}/%{name}/python
%{_mandir}/man1/ovsdb-server.1.gz
%{_mandir}/man5/ovs-vswitchd.conf.db.5.gz
%{_mandir}/man8/ovs-ctl.8.gz
%if 0%{?suse_version} > 1230
%{_sbindir}/rc%{name}
%{_unitdir}/openvswitch.service
%{_datadir}/openvswitch/scripts/openvswitch-switch
%else
%{_sbindir}/rc%{name}-switch
%{_sysconfdir}/init.d/openvswitch-switch
%endif
%dir /var/log/openvswitch
%{_localstatedir}/adm/fillup-templates/sysconfig.openvswitch
%dir %{_localstatedir}/log/openvswitch
%if 0%{?suse_version} > 1110
%files ovn
%defattr(-,root,root)
%{_bindir}/ovn-controller
@ -619,12 +432,12 @@ rmdir %{buildroot}%{_datadir}/%{name}/python
%{_mandir}/man8/ovn-sbctl.8*
%config %{_datadir}/openvswitch/ovn-nb.ovsschema
%config %{_datadir}/openvswitch/ovn-sb.ovsschema
%if 0%{?suse_version} > 1230
%{_sbindir}/rcovn-controller
%{_sbindir}/rcovn-controller-vtep
%{_sbindir}/rcovn-northd
%{_unitdir}/ovn-controller.service
%{_unitdir}/ovn-controller-vtep.service
%{_unitdir}/ovn-northd.service
%endif
%endif
%files test
%defattr(-,root,root)
@ -636,25 +449,15 @@ rmdir %{buildroot}%{_datadir}/%{name}/python
%{_mandir}/man8/ovs-l3ping.8.gz
%{_mandir}/man8/ovs-vlan-test.8.gz
%{_mandir}/man8/ovs-testcontroller.8.gz
%{_sysconfdir}/init.d/openvswitch-testcontroller
%{_sbindir}/rc%{name}-testcontroller
%files devel
%defattr(-,root,root)
%{_libdir}/libofproto.so
%{_libdir}/libofproto.la
%{_libdir}/libopenvswitch.so
%{_libdir}/libopenvswitch.la
%if 0%{?suse_version} > 1110
%{_libdir}/libovn.so
%exclude %{_libdir}/libovn.la
%endif
%{_libdir}/libovsdb.so
%{_libdir}/libovsdb.la
%{_libdir}/libsflow.so
%{_libdir}/libsflow.la
%{_libdir}/libvtep.so
%{_libdir}/libvtep.la
%{_includedir}/openflow/
%{_includedir}/openvswitch/
%{_libdir}/pkgconfig/*.pc

View File

@ -1,30 +0,0 @@
#
# You may override the following variables to customize ovn-controller-vtep
# behavior:
#
# OVN_DB - Set this variable to the location of the ovsdb server that is
# serving the OVN_Southbound database. See the manpage for
# ovn-controller-vtep for more details on the format for the db
# location.
#
# VTEP_DB - Set this variable to the location of the ovsdb server that is
# serving the hardware_vtep database. See the manpage for
# ovn-controller-vtep for more details on the format for the db
# location.
#
[Unit]
Description=OVN VTEP gateway controller daemon
After=syslog.target
Requires=openvswitch.service
After=openvswitch.service
[Service]
Type=simple
Environment=OVS_RUNDIR=%t/openvswitch
Environment=OVN_DB=unix:%t/openvswitch/db.sock
Environment=VTEP_DB=unix:%t/openvswitch/db.sock
ExecStart=/usr/bin/ovn-controller-vtep -vconsole:emer -vsyslog:err -vfile:info \
--log-file=/var/log/openvswitch/ovn-controller-vtep.log \
--no-chdir --pidfile=${OVS_RUNDIR}/ovn-controller-vtep.pid \
--ovnsb-db=${OVN_DB} --vtep-db=${VTEP_DB}

View File

@ -1,22 +0,0 @@
#
# You may override the following variables to customize ovn-controller behavior:
#
# OVS_DB - Set this variable to the location of the ovsdb server that is
# serving the Open_vSwitch database for the local ovs-vswitchd.
# See the manpage for ovn-controller for more details on the
# format for the db location.
#
[Unit]
Description=OVN controller daemon
After=syslog.target
Requires=openvswitch.service
After=openvswitch.service
[Service]
Type=simple
Environment=OVS_RUNDIR=%t/openvswitch
Environment=OVS_DB=unix:%t/openvswitch/db.sock
ExecStart=/usr/bin/ovn-controller -vconsole:emer -vsyslog:err -vfile:info \
--log-file=/var/log/openvswitch/ovn-controller.log \
--no-chdir --pidfile=${OVS_RUNDIR}/ovn-controller.pid ${OVS_DB}

View File

@ -1,12 +0,0 @@
[Unit]
Description=OVN northd management daemon
After=syslog.target
Requires=openvswitch.service
After=openvswitch.service
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=OVS_RUNDIR=%t/openvswitch OVS_DBDIR=/var/lib/openvswitch
ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_northd
ExecStop=/usr/share/openvswitch/scripts/ovn-ctl stop_northd