# # spec file for package openvswitch # # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # needssslcertforbuild # IpSec build disabled temporarily (need to upgrade ipsec-tools): %bcond_with ipsec # Disable GUI building by default (heavy Qt4 dependencies): %bcond_with gui Name: openvswitch %if 0%{?suse_version} > 1110 Version: 2.5.0 Release: 0 %else Version: 2.4.0 Release: 0 %endif Summary: An open source, production quality, multilayer virtual switch License: Apache-2.0 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 BuildRequires: autoconf BuildRequires: automake BuildRequires: fdupes BuildRequires: gcc BuildRequires: glibc-devel BuildRequires: graphviz BuildRequires: libopenssl-devel BuildRequires: libtool BuildRequires: make BuildRequires: openssl BuildRequires: perl BuildRequires: pkg-config BuildRequires: python-devel BuildRequires: python-xml %ifnarch aarch64 BuildRequires: valgrind-devel %endif Requires: logrotate Requires: openssl Requires: python Provides: openvswitch-common = %{version} Obsoletes: openvswitch-common < %{version} Provides: openvswitch-controller = %{version} Obsoletes: openvswitch-controller < %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build %py_requires %description Open vSwitch is a production quality, multilayer virtual switch licensed under the open source Apache 2.0 license. It is designed to enable massive network automation through programmatic extension, while still supporting standard management interfaces and protocols (e.g. NetFlow, sFlow, RSPAN, ERSPAN, CLI, LACP, 802.1ag). In addition, it is designed to support distribution across multiple physical servers similar to VMware’s vNetwork distributed vswitch or Cisco’s 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 %description -n %{name}-kmp Kernel modules supporting the openvswitch datapath. %endif %package devel Summary: Open vSwitch Devel Libraries License: Apache-2.0 Group: Productivity/Networking/System Requires: %{name} = %{version} %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 Suggests: logrotate %if 0%{?suse_version} > 1230 %{?systemd_requires} %endif %description switch openvswitch-switch provides the userspace components and utilities for 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 Group: Productivity/Networking/System Requires: openvswitch = %{version} Requires: openvswitch-switch = %{version} Requires: openvswitch-vtep = %{version} %description ovn 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 License: Apache-2.0 Group: Productivity/Networking/System Requires: openvswitch = %{version} %description pki openvswitch-pki provides PKI (public key infrastructure) support for Open vSwitch switches and controllers, reducing the risk of man-in-the-middle attacks on the Open vSwitch network infrastructure. Open vSwitch is a full-featured software-based Ethernet switch. %package vtep Summary: Open vSwitch VTEP emulator License: Apache-2.0 Group: Productivity/Networking/System Requires: openvswitch = %{version} Requires: openvswitch-switch = %{version} # Since openvswitch/scripts/ovs-vtep requires various ovs python modules. Requires: python-openvswitch = %{version} %description vtep 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 Group: Productivity/Networking/System Requires: openvswitch = %{version} Requires: python %description -n python-openvswitch This package contains the full Python bindings for Open vSwitch database. %package -n python-openvswitch-test Summary: Python bindings for Open vSwitch License: Python-2.0 Group: Productivity/Networking/System Requires: openvswitch = %{version} Requires: python Requires: python-openvswitch = %{version} 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 "). Open vSwitch is a full-featured software-based Ethernet switch. %endif %package test Summary: Open vSwitch test package License: Apache-2.0 Group: Productivity/Networking/System Requires: openvswitch = %{version} Requires: python Requires: python-argparse Requires: python-openvswitch-test = %{version} Requires: python-twisted %description test This package contains utilities that are useful to diagnose performance and connectivity issues in Open vSwitch setup. Open vSwitch is a full-featured software-based Ethernet switch. %prep %setup -q %patch2 -p0 set -- * .travis* mkdir source mv "$@" source/ mkdir obj %build pushd source # only call boot.sh for distros with autoconf >= 2.64 %if 0%{?suse_version} > 1110 bash -x boot.sh %endif 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 rm -rf obj/$flavor cp -r source obj/$flavor cp -a %{SOURCE11} 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 cd datapath/linux make %{?_smp_mflags} popd done %endif %endif ls source pushd source %configure \ --disable-static \ --enable-shared \ --with-logdir=/var/log/openvswitch make %{?_smp_mflags} popd %install %if %{with kmp} 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 pushd obj/$flavor/datapath/linux make -C /usr/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 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 %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 755 %{buildroot}/%{_sysconfdir}/sysconfig install -d -m 755 %{buildroot}/%{_sysconfdir}/logrotate.d install -d -m 755 %{buildroot}/var/log/openvswitch install -m 644 %{SOURCE4} \ %{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 %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 %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 %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 %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 %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 /sbin/ldconfig %endif %preun test %stop_on_removal openvswitch-testcontroller %postun test %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 %files %defattr(-,root,root) %dir %{_datadir}/openvswitch %doc source/AUTHORS %doc source/CONTRIBUTING.md %doc source/COPYING %doc source/CodingStyle.md %doc source/DESIGN.md %doc source/FAQ.md %doc source/IntegrationGuide.md %doc source/NEWS %doc source/NOTICE %doc source/OPENFLOW-1.1+.md %doc source/PORTING.md %doc source/README* %doc source/SECURITY.md %doc source/TODO.md %doc source/WHY-OVS.md %{_bindir}/ovs-appctl %{_bindir}/ovs-benchmark %{_bindir}/ovs-ofctl %{_bindir}/ovsdb-client %{_bindir}/ovs-parse-backtrace %{_bindir}/ovs-dpctl-top %{_sbindir}/ovs-bugtool %{_sbindir}/ovs-vlan-bug-workaround %dir %{_datadir}/openvswitch/scripts %{_datadir}/openvswitch/bugtool-plugins %{_datadir}/openvswitch/scripts/ovs-bugtool-* %{_libdir}/libofproto.so.* %{_libdir}/libopenvswitch.so.* %{_libdir}/libovsdb.so.* %{_libdir}/libsflow.so.* %{_mandir}/man1/ovs-benchmark.1.gz %{_mandir}/man1/ovsdb-client.1.gz %{_mandir}/man8/ovs-appctl.8.gz %{_mandir}/man8/ovs-bugtool.8.gz %{_mandir}/man8/ovs-ofctl.8.gz %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz %{_mandir}/man8/ovs-parse-backtrace.8.gz %{_mandir}/man8/ovs-dpctl-top.8.gz %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash %files pki %defattr(-,root,root) %{_mandir}/man8/ovs-pki.8.gz %{_bindir}/ovs-pki %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 %{_datadir}/openvswitch/vtep.ovsschema %{_libdir}/libvtep.so.* %files -n python-openvswitch %defattr(-,root,root) %{py_sitedir}/ovs/ %files -n python-openvswitch-test %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 %{_bindir}/ovs-dpctl %{_bindir}/ovs-tcpundump %{_bindir}/ovs-pcap %{_bindir}/ovs-vsctl %{_bindir}/ovsdb-tool %{_sbindir}/ovs-vswitchd %{_sbindir}/ovsdb-server %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs %{_datadir}/openvswitch/scripts/ovs-ctl %{_datadir}/openvswitch/scripts/ovs-lib %{_datadir}/openvswitch/scripts/ovs-save %{_datadir}/openvswitch/vswitch.ovsschema %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch-switch %{_mandir}/man8/ovs-dpctl.8.gz %{_mandir}/man1/ovs-tcpundump.1.gz %{_mandir}/man1/ovs-pcap.1.gz %{_mandir}/man8/ovs-vsctl.8.gz %{_mandir}/man1/ovsdb-tool.1.gz %{_mandir}/man8/ovs-vswitchd.8.gz %{_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 %if 0%{?suse_version} > 1110 %files ovn %defattr(-,root,root) %{_bindir}/ovn-controller %{_bindir}/ovn-controller-vtep %{_bindir}/ovn-docker-overlay-driver %{_bindir}/ovn-docker-underlay-driver %{_bindir}/ovn-nbctl %{_bindir}/ovn-northd %{_bindir}/ovn-sbctl %{_datadir}/openvswitch/scripts/ovn-ctl %{_libdir}/libovn.so.* %{_mandir}/man5/ovn-nb.5* %{_mandir}/man5/ovn-sb.5* %{_mandir}/man7/ovn-architecture.7* %{_mandir}/man8/ovn-controller.8* %{_mandir}/man8/ovn-controller-vtep.8* %{_mandir}/man8/ovn-ctl.8* %{_mandir}/man8/ovn-nbctl.8* %{_mandir}/man8/ovn-northd.8* %{_mandir}/man8/ovn-sbctl.8* %config %{_datadir}/openvswitch/ovn-nb.ovsschema %config %{_datadir}/openvswitch/ovn-sb.ovsschema %if 0%{?suse_version} > 1230 %{_unitdir}/ovn-controller.service %{_unitdir}/ovn-controller-vtep.service %{_unitdir}/ovn-northd.service %endif %endif %files test %defattr(-,root,root) %{_bindir}/ovs-test %{_bindir}/ovs-l3ping %{_bindir}/ovs-vlan-test %{_bindir}/ovs-testcontroller %{_mandir}/man8/ovs-test.8.gz %{_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 %changelog