--- /dev/null
+###############################################################################
+# IPFire.org - An Open Source Firewall Solution #
+# Copyright (C) - IPFire Development Team <info@ipfire.org> #
+###############################################################################
+
+name = openvswitch
+version = 1.4.1
+release = 1
+
+groups = Networking/Tools
+url = http://openvswitch.org/
+license = ASL 2.0 and LGPLv2+ and SISSL
+summary = Open vSwitch daemon/database/utilities.
+
+description
+ Open vSwitch provides standard network bridging functions and
+ support for the OpenFlow protocol for remote per-flow control
+ of traffic.
+end
+
+source_dl = http://openvswitch.org/releases/
+
+build
+ requires
+ autoconf
+ automake
+ groff
+ openssl-devel
+ systemd-units
+ end
+
+ prepare_cmds
+ autoreconf -vfi
+ end
+
+ configure_options += \
+ --enable-ssl \
+ --with-pkidir=%{sharedstatedir}/openvswitch/pki \
+ OVSKMOD=openvswitch
+
+ install_cmds
+ # Install logrotate file.
+ mkdir -pv %{BUILDROOT}%{sysconfdir}/logrotate.d
+ install -m 644 %{DIR_SOURCE}/openvswitch.logrotate \
+ %{BUILDROOT}%{sysconfdir}/logrotate.d/openvswitch
+
+ mkdir -pv %{BUILDROOT}%{sharedstatedir}/openvswitch
+
+ # Remove stuff we don't want to support.
+ rm -vf \
+ %{BUILDROOT}%{bindir}/ovs-controller \
+ %{BUILDROOT}%{sbindir}/ovs-{vlan-bug-workaround,brcompatd} \
+ %{BUILDROOT}%{mandir}/man8/ovs-{controller,vlan-bug-workaround,brcompatd}.8
+ end
+end
+
+packages
+ package %{name}
+ script postin
+ systemctl daemon-reload >/dev/null 2>&1 || :
+ end
+
+ script postup
+ systemctl daemon-reload >/dev/null 2>&1 || :
+ systemctl try-restart openvswitch.service >/dev/null 2>&1 || :
+ end
+
+ script postun
+ systemctl --no-reload disable openvswitch.service >/dev/null 2>&1 || :
+ systemctl stop openvswitch.service >/dev/null 2>&1 || :
+ end
+
+ configfiles
+ %{sysconfdir}/logrotate.d/openvswitch
+ end
+ end
+
+ package %{name}-test
+ summary = Open vSwitch testing utilities.
+ license = ASL 2.0
+ description
+ Utilities that are useful to diagnose performance and connectivity
+ issues in Open vSwitch setup.
+ end
+ arch = noarch
+
+ files
+ %{bindir}/ovs-test
+ %{bindir}/ovs-vlan-test
+ %{mandir}/man8/ovs-test.8*
+ %{mandir}/man8/ovs-vlan-test.8*
+ end
+ end
+
+ package %{name}-debuginfo
+ template DEBUGINFO
+ end
+end
--- /dev/null
+This is the autoconf'd result of applying
+openvswitch-configure-ovskmod-var.patch.
+It updates configure and .in files directly,
+rather than their sources.
+
+diff -aru openvswitch-1.4.0.orig/configure openvswitch-1.4.0/configure
+--- openvswitch-1.4.0.orig/configure 2012-01-30 23:09:16.000000000 -0800
++++ openvswitch-1.4.0/configure 2012-02-29 21:23:09.397779430 -0800
+@@ -599,6 +607,7 @@
+ am__EXEEXT_TRUE
+ LTLIBOBJS
+ LIBOBJS
++OVSKMOD
+ LINUX_ENABLED_FALSE
+ LINUX_ENABLED_TRUE
+ KBUILD
+@@ -757,7 +766,8 @@
+ PKG_CONFIG_LIBDIR
+ SSL_CFLAGS
+ SSL_LIBS
+-KARCH'
++KARCH
++OVSKMOD'
+
+
+ # Initialize some variables set by options.
+@@ -1417,6 +1427,7 @@
+ SSL_CFLAGS C compiler flags for SSL, overriding pkg-config
+ SSL_LIBS linker flags for SSL, overriding pkg-config
+ KARCH Kernel Architecture String
++ OVSKMOD Open vSwitch kernel module name (default openvswitch_mod)
+
+ Use these variables to override the choices made by `configure' or to help
+ it to find libraries and programs with nonstandard names/locations.
+@@ -7882,6 +7893,12 @@
+
+
+
++
++if test "X$OVSKMOD" = "X"; then
++ OVSKMOD=openvswitch_mod
++fi
++
++
+ ac_config_files="$ac_config_files Makefile datapath/Makefile datapath/linux/Kbuild datapath/linux/Makefile datapath/linux/Makefile.main tests/atlocal"
+
+
+diff -aru openvswitch-1.4.0.orig/datapath/Makefile.in openvswitch-1.4.0/datapath/Makefile.in
+--- openvswitch-1.4.0.orig/datapath/Makefile.in 2012-01-30 23:09:16.000000000 -0800
++++ openvswitch-1.4.0/datapath/Makefile.in 2012-02-29 21:23:26.744028440 -0800
+@@ -128,6 +128,7 @@
+ MAKEINFO = @MAKEINFO@
+ MKDIR_P = @MKDIR_P@
+ OBJEXT = @OBJEXT@
++OVSKMOD = @OVSKMOD@
+ PACKAGE = @PACKAGE@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+ PACKAGE_NAME = @PACKAGE_NAME@
+diff -aru openvswitch-1.4.0.orig/Makefile.in openvswitch-1.4.0/Makefile.in
+--- openvswitch-1.4.0.orig/Makefile.in 2012-01-30 23:09:16.000000000 -0800
++++ openvswitch-1.4.0/Makefile.in 2012-02-29 21:23:27.070033119 -0800
+@@ -875,6 +875,7 @@
+ MAKEINFO = @MAKEINFO@
+ MKDIR_P = @MKDIR_P@
+ OBJEXT = @OBJEXT@
++OVSKMOD = @OVSKMOD@
+ PACKAGE = @PACKAGE@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+ PACKAGE_NAME = @PACKAGE_NAME@
+@@ -3634,6 +3635,7 @@
+ -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
+ -e 's,[@]VERSION[@],$(VERSION),g' \
+ -e 's,[@]BUILDNR[@],$(BUILDNR),g' \
++ -e 's,[@]OVSKMOD[@],$(OVSKMOD),g' \
+ -e 's,[@]localstatedir[@],$(localstatedir),g' \
+ -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
+ -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
+diff -aru openvswitch-1.4.0.orig/utilities/ovs-ctl.in openvswitch-1.4.0/utilities/ovs-ctl.in
+--- openvswitch-1.4.0.orig/utilities/ovs-ctl.in 2012-01-30 23:08:18.000000000 -0800
++++ openvswitch-1.4.0/utilities/ovs-ctl.in 2012-02-29 21:22:49.206489585 -0800
+@@ -31,14 +31,14 @@
+ ## ----- ##
+
+ insert_openvswitch_mod_if_required () {
+- # If openvswitch_mod is already loaded then we're done.
+- test -e /sys/module/openvswitch_mod && return 0
++ # If @OVSKMOD@ is already loaded then we're done.
++ test -e /sys/module/@OVSKMOD@ && return 0
+
+- # Load openvswitch_mod. If that's successful then we're done.
+- action "Inserting openvswitch module" modprobe openvswitch_mod && return 0
++ # Load @OVSKMOD@. If that's successful then we're done.
++ action "Inserting openvswitch module" modprobe @OVSKMOD@ && return 0
+
+ # If the bridge module is loaded, then that might be blocking
+- # openvswitch_mod. Try to unload it, if there are no bridges.
++ # @OVSKMOD@. Try to unload it, if there are no bridges.
+ test -e /sys/module/bridge || return 1
+ bridges=`echo /sys/class/net/*/bridge | sed 's,/sys/class/net/,,g;s,/bridge,,g'`
+ if test "$bridges" != "*"; then
+@@ -47,8 +47,8 @@
+ fi
+ action "removing bridge module" rmmod bridge || return 1
+
+- # Try loading openvswitch_mod again.
+- action "Inserting openvswitch module" modprobe openvswitch_mod
++ # Try loading @OVSKMOD@ again.
++ action "Inserting openvswitch module" modprobe @OVSKMOD@
+ }
+
+ insert_brcompat_mod_if_required () {
+@@ -285,8 +285,8 @@
+ if test -e /sys/module/brcompat_mod; then
+ action "Removing brcompat module" rmmod brcompat_mod
+ fi
+- if test -e /sys/module/openvswitch_mod; then
+- action "Removing openvswitch module" rmmod openvswitch_mod
++ if test -e /sys/module/@OVSKMOD@; then
++ action "Removing openvswitch module" rmmod @OVSKMOD@
+ fi
+
+ start