openvswitch/openvswitch.spec
Dirk Mueller 15fd25262d Accepting request 631965 from home:markoschandras:network
- Version bump to 2.10.0. Some of the changes are:
  * ovs-vswitchd and utilities now support DNS names in OpenFlow and
    OVSDB remotes.
  * ovs-vswitchd:
    - New options --l7 and --l7-len to "ofproto/trace" command.
    - Previous versions gave OpenFlow tables default names of the form
      "table#".  These are not helpful names for the purpose of accepting
      and displaying table names, so now tables by default have no names.
    - The "null" interface type, deprecated since 2013, has been removed.
    - Add minimum network namespace support for Linux.
    - New command "lacp/show-stats"
  * ovs-ofctl:
    - ovs-ofctl now accepts and display table names in place of numbers.  By
      default it always accepts names and in interactive use it displays them;
      use --names or --no-names to override.  See ovs-ofctl(8) for details.
  * ovs-vsctl: New commands "add-bond-iface" and "del-bond-iface".
  * ovs-dpctl:
    - New commands "ct-set-limits", "ct-del-limits", and "ct-get-limits".
  * OpenFlow:
    - OFPT_ROLE_STATUS is now available in OpenFlow 1.3.
    - OpenFlow 1.5 extensible statistics (OXS) now implemented.
    - New OpenFlow 1.0 extensions for group support.
    - Default selection method for select groups is now dp_hash with improved
      accuracy.
  * ovn:
    - Implemented icmp4/icmp6/tcp_reset actions in order to drop the packet
      and reply with a RST for TCP or ICMPv4/ICMPv6 unreachable message for
      other IPv4/IPv6-based protocols whenever a reject ACL rule is hit.
    - ACL match conditions can now match on Port_Groups as well as address
      sets that are automatically generated by Port_Groups.  ACLs can be

OBS-URL: https://build.opensuse.org/request/show/631965
OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=156
2018-08-31 08:06:11 +00:00

999 lines
31 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# spec file for package openvswitch
#
# Copyright (c) 2018 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
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
%define lname libopenvswitch-2_9-0
%ifarch aarch64 x86_64 %{ix86}
%if 0%{?suse_version}
# DPDK enabled only SUSE/openSUSE
%bcond_without dpdk
%else
# DPDK disabled elsewhere even if supported by the architecture.
%bcond_with dpdk
%endif
%else
# No DPDK support on these architectures
%bcond_with dpdk
%endif
# The testsuite is somewhat fragile for continuous testing in OBS
# but keep it here as an option
%bcond_with check
# Disable building the external kernel datapath by default
%bcond_with kmp
Name: openvswitch
Version: 2.10.0
Release: 0
Summary: A multilayer virtual network switch
# All code is Apache-2.0 except
# - lib/sflow* which is SISSL
# - utilities/bugtool which is LGPL-2.1
License: Apache-2.0 AND LGPL-2.1-only AND SISSL
Group: Productivity/Networking/System
Url: http://openvswitch.org/
Source0: http://openvswitch.org/releases/openvswitch-%{version}.tar.gz
Source1: preamble
Source89: Module.supported.updates
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: graphviz
BuildRequires: libcap-ng-devel
BuildRequires: libtool
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: pkgconfig(openssl)
Requires: modutils
# ovs-ctl / ovs-pki use /usr/bin/uuidgen:
Requires: util-linux
Provides: openvswitch-common = %{version}
Obsoletes: openvswitch-common < 2.7.0
Provides: openvswitch-controller = %{version}
Obsoletes: openvswitch-controller < 2.7.0
# openvswitch-switch has been merged to the main package
# so we need to provide a migration path
Provides: %{name}-dpdk = %{version}
Provides: %{name}-dpdk-switch = %{version}
Provides: %{name}-switch = %{version}
Obsoletes: %{name}-dpdk < 2.7.0
Obsoletes: %{name}-dpdk-switch < 2.7.0
Obsoletes: %{name}-switch < 2.7.0
%if 0%{?suse_version}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module six}
BuildRequires: %{python_module xml}
BuildRequires: fdupes
BuildRequires: libopenssl-devel
BuildRequires: python-rpm-macros
Requires(post): %fillup_prereq
Requires(pre): shadow
Suggests: logrotate
%{?systemd_requires}
%else
BuildRequires: findutils
BuildRequires: openssl-devel
BuildRequires: python-devel
BuildRequires: python-six
BuildRequires: python2-rpm-macros
BuildRequires: python3-rpm-macros
BuildRequires: systemd-units
Requires(post): systemd-units
Requires(postun): systemd-units
Requires(pre): shadow-utils
Requires(preun): systemd-units
%endif
# Needed by the testsuite
%if %{with check}
BuildRequires: procps
%endif
%if %{with kmp}
Suggests: openvswitch-kmp
%endif
%if %{with dpdk}
# We need to be a bit strict with the dpdk version since
# it's very possible for DPDK to change it's API between
# releases. This version currently requires >=17.XX and
# < 18.05
BuildRequires: dpdk-devel < 18.05
BuildRequires: dpdk-devel >= 17.05
BuildRequires: libnuma-devel
BuildRequires: libpcap-devel
%endif
%description
Open vSwitch is a multilayer virtual network Ethernet switch. It is
enables network automation through programmatic extension, and
supports standard management interfaces and protocols (e.g. NetFlow,
sFlow, RSPAN, ERSPAN, CLI, LACP, 802.1ag). In addition, it supports
distribution across multiple physical servers similar to VMwares
vNetwork distributed vswitch or Ciscos Nexus 1000V.
%if %{with kmp}
%package kmp
Summary: Open vSwitch kernel modules
License: GPL-2.0-or-later
Group: System/Kernel
BuildRequires: %{kernel_module_package_buildreqs}
%suse_kernel_module_package -p %{_sourcedir}/preamble ec2 xenpae vmi um
%description kmp
Kernel modules supporting the openvswitch datapath.
%endif
%package -n %{lname}
Summary: Open vSwitch core libraries
License: Apache-2.0
Group: System/Libraries
%description -n %{lname}
Contains the shared libraries used by Open vSwitch and any eventual extensions.
%package doc
Summary: Open vSwitch Documentation
License: Apache-2.0
Group: System/Libraries
BuildArch: noarch
%description doc
Contains additional documentation for the Open vSwitch
%package devel
Summary: Development files for Open vSwitch
License: Apache-2.0
Group: Development/Libraries/C and C++
Requires: %{lname} = %{version}
Provides: %{name}-dpdk-devel = %{version}
Obsoletes: %{name}-dpdk-devel < 2.7.0
%description devel
Devel libraries and headers for Open vSwitch.
%package ovn-central
Summary: Open Virtual Network support for Open vSwitch
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
Requires: %{name}-ovn-common
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
Provides: %{name}-dpdk-ovn:%{_bindir}/ovn-northd
Provides: %{name}-ovn:%{_bindir}/ovn-northd
%description ovn-central
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.
%package ovn-host
Summary: Open Virtual Network support for Open vSwitch
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
Requires: %{name}-ovn-common
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
Provides: %{name}-dpdk-ovn:%{_bindir}/ovn-controller
Provides: %{name}-ovn:%{_bindir}/ovn-controller
%description ovn-host
This subpackage contains the OVN host controller.
%package ovn-vtep
Summary: Open Virtual Network VTEP controller for Open vSwitch
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
Requires: %{name}-ovn-common
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
Provides: %{name}-dpdk-ovn:%{_bindir}/ovn-controller-vtep
Provides: %{name}-ovn:%{_bindir}/ovn-controller-vtep
%description ovn-vtep
This subpackage contains the OVN VTEP (VXLAN Tunnel Endpoint) controller.
%package ovn-common
Summary: Open Virtual Network diagnostic utilities
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
Provides: %{name}-dpdk-ovn = %{version}
Provides: %{name}-ovn = %{version}
Obsoletes: %{name}-dpdk-ovn < 2.7.0
Obsoletes: %{name}-ovn < 2.7.0
%description ovn-common
Utilities that are used to diagnose and manage the OVN components.
%package ovn-docker
Summary: Docker network plugins for OVN
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
Requires: %{name}-ovn-common = %{version}
Requires: python-openvswitch = %{version}
# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep}
Provides: %{name}-dpdk-ovn:%{_bindir}/ovn-docker-overlay-driver
Provides: %{name}-ovn:%{_bindir}/ovn-docker-overlay-driver
%description ovn-docker
Docker network plugins for OVN.
%package pki
Summary: Open vSwitch public key infrastructure dependency package
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
Provides: %{name}-dpdk-pki = %{version}
Obsoletes: %{name}-dpdk-pki < 2.7.0
%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: %{name} = %{version}
Requires: %{name}-switch = %{version}
# Since openvswitch/scripts/ovs-vtep requires various ovs python modules.
Requires: python-openvswitch = %{version}
Provides: %{name}-dpdk-vtep = %{version}
Obsoletes: %{name}-dpdk-vtep < 2.7.0
%description vtep
A VTEP (VXLAN Tunnel EndPoint) emulator that uses Open vSwitch for
forwarding.
Open vSwitch is a full-featured software-based Ethernet switch.
%package -n python2-openvswitch
Summary: Python2 bindings for Open vSwitch
License: Apache-2.0
Group: Productivity/Networking/System
Requires: openvswitch-common = %{version}
Requires: python2
Requires: python2-six
Provides: python-openvswitch = %{version}
Obsoletes: python-openvswitch < 2.8.1
BuildArch: noarch
%description -n python2-openvswitch
This package contains the Python2 bindings for Open vSwitch database.
%package -n python2-openvswitch-test
Summary: Python2 bindings for Open vSwitch
License: Apache-2.0
Group: Productivity/Networking/System
Requires: openvswitch-common = %{version}
Requires: python2
Requires: python2-Twisted
Requires: python2-openvswitch = %{version}
Provides: python-openvswitch-test = %{version}
Obsoletes: python-openvswitch-test < 2.8.1
BuildArch: noarch
%description -n python2-openvswitch-test
This package contains the Python bindings for Open vSwitch database.
%package -n python3-openvswitch
Summary: Python3 bindings for Open vSwitch
License: Apache-2.0
Group: Productivity/Networking/System
Requires: openvswitch-common = %{version}
Requires: python3
Requires: python3-six
BuildArch: noarch
%description -n python3-openvswitch
This package contains the Python3 bindings for Open vSwitch database.
%package -n python3-openvswitch-test
Summary: Python3 bindings for Open vSwitch
License: Apache-2.0
Group: Productivity/Networking/System
Requires: openvswitch-common = %{version}
Requires: python3
Requires: python3-Twisted
Requires: python3-openvswitch = %{version}
BuildArch: noarch
%description -n python3-openvswitch-test
This package contains the Python3 bindings for Open vSwitch database.
%package test
Summary: Open vSwitch test package
License: Apache-2.0
Group: Productivity/Networking/System
Requires: %{name} = %{version}
Requires: python3-openvswitch-test = %{version}
Provides: %{name}-dpdk-test = %{version}
Obsoletes: %{name}-dpdk-test < 2.7.0
%description test
Open vSwitch is a software-based Ethernet switch.
This package contains utilities that are useful to diagnose
performance and connectivity issues in Open vSwitch setup.
%prep
%setup -q -n openvswitch-%{version}
%build
set -- * .travis* .mailmap
mkdir source
mv "$@" source/
mkdir obj
pushd source
# only call boot.sh for distros with autoconf >= 2.64
bash -x boot.sh
popd
%if %{with kmp}
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
for flavor in %{flavors_to_build}; do
rm -rf obj/$flavor
cp -r source obj/$flavor
cp -a %{SOURCE89} obj/$flavor/datapath/linux/Module.supported
pushd obj/$flavor
%configure \
--with-logdir=%{_localstatedir}/log/openvswitch \
--with-rundir=%{_rundir}/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
pushd source
%if %{with dpdk}
dpdk_opt="--with-dpdk"
%endif
%{_bindir}/python build-aux/dpdkstrip.py \
%if %{with dpdk}
--dpdk \
%else
--nodpdk \
%endif
< rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
> rhel/usr_lib_systemd_system_ovs-vswitchd.service
%if 0%{?suse_version}
export PYTHON='%{_bindir}/python3'
%endif
%configure \
--disable-static \
--enable-libcapng \
--enable-shared \
--enable-ssl \
${dpdk_opt} \
--with-rundir=%{_rundir}/openvswitch \
--with-logdir=%{_localstatedir}/log/openvswitch
make %{?_smp_mflags}
popd
%check
%if %{with check}
pushd source
# Recheck tests before we declare them broken. If that fails, dump
# the log and exit. >2.5.0 uses the RECHECK env variable so this
# needs to be taken into consideration for future releases.
if ! make check TESTSUITEFLAGS="%{?_smp_mflags}" &&
! make check TESTSUITEFLAGS='--recheck'; then
cat tests/testsuite.log
exit 1
fi
popd
%endif
%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
pushd obj/$flavor/datapath/linux
make -C %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor modules_install M=$PWD
popd
done
%endif
pushd source
%make_install
for service in openvswitch ovn-controller ovn-controller-vtep \
ovn-northd ovsdb-server ovs-vswitchd; do
install -D -m 644 rhel/usr_lib_systemd_system_${service}.service \
%{buildroot}%{_unitdir}/${service}.service
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc${service}
done
%if %{with dpdk}
install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \
%{buildroot}%{_prefix}/lib/udev/rules.d/91-vfio.rules
%endif
%if 0%{?suse_version}
install -D -m 644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
%{buildroot}%{_fillupdir}/sysconfig.openvswitch
# fixing W: suse-filelist-forbidden-bashcomp-userdirs /etc/bash_completion.d/ovs-appctl-bashcomp.bash is not allowed in SUSE
mkdir -p %{buildroot}/%{_prefix}/share/bash-completion/completions/
mv %{buildroot}/%{_sysconfdir}/bash_completion.d/ovs-* %{buildroot}/%{_prefix}/share/bash-completion/completions/
%else
install -D -m 644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
%{buildroot}%{_sysconfdir}/sysconfig/openvswitch
install -d -m 0755 %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
%{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
%{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
%endif
install -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
install -d -m 755 %{buildroot}%{_localstatedir}/log/openvswitch
install -p -D -m 0644 rhel/etc_openvswitch_default.conf \
%{buildroot}/%{_sysconfdir}/openvswitch/default.conf
install -m 644 rhel/etc_logrotate.d_openvswitch \
%{buildroot}%{_sysconfdir}/logrotate.d/openvswitch
install -d -m 755 %{buildroot}%{_sysconfdir}/profile.d
install -m 644 vswitchd/vswitch.ovsschema \
%{buildroot}%{_datadir}/openvswitch/vswitch.ovsschema
# firewalld
install -d %{buildroot}%{_prefix}/lib/firewalld/services/
install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \
%{buildroot}%{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml
install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml \
%{buildroot}%{_prefix}/lib/firewalld/services/ovn-host-firewall-service.xml
# Copy documentation.
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -r Documentation/* %{buildroot}%{_docdir}/%{name}
find %{buildroot}%{_docdir}/%{name}/ -type f ! -name '*.rst' -delete
popd
# Python subpackages
# SLES
%if 0%{?suse_version}
mkdir -p %{buildroot}%{python2_sitelib}
cp -a %{buildroot}%{_datadir}/openvswitch/python/* %{buildroot}%{python2_sitelib}
# Build the byte compiled files
%py_compile %{buildroot}%{python2_sitelib}
%fdupes %{buildroot}%{python2_sitelib}
mkdir -p %{buildroot}%{python3_sitelib}
cp -a %{buildroot}%{_datadir}/openvswitch/python/* %{buildroot}%{python3_sitelib}
# Build the byte compiled files
%py3_compile %{buildroot}%{python3_sitelib}
%fdupes %{buildroot}%{python3_sitelib}
%else
# RHEL
install -d -m 0755 %{buildroot}%{python2_sitelib}
cp -a %{buildroot}%{_datadir}/openvswitch/python/* \
%{buildroot}%{python2_sitelib}
# No python3 for RHEL. We are missing python3-* packages from EPEL
%endif
rm -rf %{buildroot}%{_datadir}/openvswitch/python
find %{buildroot} -type f -name "*.la" -delete -print
%define eflag /run/openvswitch-was-enabled
%post
/sbin/ldconfig
%{fillup_only -n openvswitch}
if [ $1 -eq 1 ]; then
sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' %{_sysconfdir}/sysconfig/openvswitch
%if %{with dpdk}
sed -i \
's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs"@'\
%{_sysconfdir}/sysconfig/openvswitch
%endif
# In the case of upgrade, this is not needed
chown -R openvswitch:openvswitch %{_sysconfdir}/openvswitch
fi
%if 0%{?suse_version}
%service_add_post ovsdb-server.service
%service_add_post ovs-vswitchd.service
%service_add_post openvswitch.service
%{fillup_only -n openvswitch}
%else
%if 0%{?systemd_post:1}
%systemd_post %{name}.service
%else
# Package install, not upgrade
if [ $1 -eq 1 ]; then
/bin/systemctl daemon-reload >dev/null || :
fi
%endif
%endif
%posttrans
# Save the "enabled" state across the transition of ownership
# of openvswitch.service from openvswitch-switch to
# openvswitch.
if test -f %{eflag}; then
rm -f %{eflag}
systemctl enable openvswitch.service
fi
%postun
/sbin/ldconfig
# Do not restart the openvswitch service on package updates.
# Restarting the service may break the existing network state.
# For example, openflow rules are not automatically re-installed
# after an OvS update if no SDN controller is used. Moreover, restaring
# the OvS can break remote administration during the update so let the
# admin decide when it's the best time for an OvS restart.
# 5771f476573445710834234a6a9f7bd999a027e7 ("fedora: do not restart the service on a pkg upgrade")
%if 0%{?suse_version}
export DISABLE_RESTART_ON_UPDATE=yes
%service_del_postun ovsdb-server.service
%service_del_postun ovs-vswitchd.service
%service_del_postun openvswitch.service
%else
%if 0%{?systemd_postun:1}
%systemd_postun %{name}.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
%endif
%pre
%if 0%{?suse_version}
%service_add_pre ovsdb-server.service
%service_add_pre ovs-vswitchd.service
%service_add_pre openvswitch.service
%endif
# Save the "enabled" state across the transition of
# ownership of openvswitch.service from openvswitch-switch to
# openvswitch.
if [ "$FIRST_ARG" -ge 1 ]; then \
if [ x$(systemctl is-enabled openvswitch.service 2>/dev/null ||:) = "xenabled" ]; then
touch %{eflag}
fi
fi
getent group openvswitch >/dev/null || groupadd -r openvswitch
getent passwd openvswitch >/dev/null || \
useradd -r -g openvswitch -d / -s /sbin/nologin \
-c "Open vSwitch Daemons" openvswitch
%if %{with dpdk}
getent group hugetlbfs >/dev/null || \
groupadd hugetlbfs
usermod -a -G hugetlbfs openvswitch
%endif
exit 0
%preun
# This prevents networking breakages on package removals.
export DISABLE_STOP_ON_REMOVAL=yes
%if 0%{?suse_version}
%service_del_preun ovsdb-server.service
%service_del_preun ovs-vswitchd.service
%service_del_preun openvswitch.service
%else
%if 0%{?systemd_preun:1}
%systemd_preun %{name}.service
%else
# Package install, not upgrade
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
/bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
fi
%endif
%endif
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%pre ovn-central
%if 0%{?suse_version}
%service_add_pre ovn-northd.service
%endif
%pre ovn-host
%if 0%{?suse_version}
%service_add_pre ovn-controller.service
%endif
%pre ovn-vtep
%if 0%{?suse_version}
%service_add_pre ovn-controller-vtep.service
%endif
%post ovn-central
%if 0%{?suse_version}
%service_add_post ovn-northd.service
%else
%if 0%{?systemd_post:1}
%systemd_post ovn-northd.service
%else
# Package install, not upgrade
if [ $1 -eq 1 ]; then
/bin/systemctl daemon-reload >dev/null || :
fi
%endif
%endif
%post ovn-host
%if 0%{?suse_version}
%service_add_post ovn-controller.service
%else
%if 0%{?systemd_post:1}
%systemd_post ovn-controller.service
%else
# Package install, not upgrade
if [ $1 -eq 1 ]; then
/bin/systemctl daemon-reload >dev/null || :
fi
%endif
%endif
%post ovn-vtep
%if 0%{?suse_version}
%service_add_post ovn-controller-vtep.service
%else
%if 0%{?systemd_post:1}
%systemd_post ovn-controller-vtep.service
%else
# Package install, not upgrade
if [ $1 -eq 1 ]; then
/bin/systemctl daemon-reload >dev/null || :
fi
%endif
%endif
%preun ovn-central
# This prevents networking breakages on package removals.
export DISABLE_STOP_ON_REMOVAL=yes
%if 0%{?suse_version}
%service_del_preun ovn-northd.service
%else
%if 0%{?systemd_preun:1}
%systemd_preun ovn-northd.service
%else
# Package install, not upgrade
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable ovn-northd.service >/dev/null 2>&1 || :
/bin/systemctl stop ovn-northd.service >/dev/null 2>&1 || :
fi
%endif
%endif
%preun ovn-host
# This prevents networking breakages on package removals.
export DISABLE_STOP_ON_REMOVAL=yes
%if 0%{?suse_version}
%service_del_preun ovn-controller.service
%else
%if 0%{?systemd_preun:1}
%systemd_preun ovn-controller.service
%else
# Package install, not upgrade
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable ovn-controller.service >/dev/null 2>&1 || :
/bin/systemctl stop ovn-controller.service >/dev/null 2>&1 || :
fi
%endif
%endif
%preun ovn-vtep
# This prevents networking breakages on package removals.
export DISABLE_STOP_ON_REMOVAL=yes
%if 0%{?suse_version}
%service_del_preun ovn-controller-vtep.service
%else
%if 0%{?systemd_preun:1}
%systemd_preun ovn-controller-vtep.service
%else
# Package install, not upgrade
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable ovn-controller-vtep.service >/dev/null 2>&1 || :
/bin/systemctl stop ovn-controller-vtep.service >/dev/null 2>&1 || :
fi
%endif
%endif
%postun ovn-central
%if 0%{?suse_version}
%service_del_postun ovn-northd.service
%else
%if 0%{?systemd_postun:1}
%systemd_postun ovn-northd.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
%endif
%post ovn-common -p /sbin/ldconfig
%postun ovn-common -p /sbin/ldconfig
%postun ovn-host
%if 0%{?suse_version}
export DISABLE_RESTART_ON_UPDATE=yes
%service_del_postun ovn-controller.service
%else
%if 0%{?systemd_postun:1}
%systemd_postun ovn-controller.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
%endif
%postun ovn-vtep
%if 0%{?suse_version}
export DISABLE_RESTART_ON_UPDATE=yes
%service_del_postun ovn-controller-vtep.service
%else
%if 0%{?systemd_postun:1}
%systemd_postun ovn-controller-vtep.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
%endif
%preun test
# This prevents networking breakages on package removals.
export DISABLE_STOP_ON_REMOVAL=yes
%if 0%{?suse_version}
%service_del_preun openvswitch-testcontroller
%else
%if 0%{?systemd_post:1}
%systemd_preun openvswitch-testcontroller.service
%else
# Package install, not upgrade
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable openvswitch-testcontroller.service >/dev/null 2>&1 || :
/bin/systemctl stop openvswitch-testcontroller.service >/dev/null 2>&1 || :
fi
%endif
%endif
%postun test
%if 0%{?suse_version}
export DISABLE_RESTART_ON_UPDATE=yes
%service_del_postun openvswitch-testcontroller
%else
%if 0%{?systemd_postun:1}
%systemd_postun openvswitch-testcontroller.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
%endif
%post vtep -p /sbin/ldconfig
%postun vtep -p /sbin/ldconfig
%files
%defattr(-,openvswitch,openvswitch)
%dir %{_sysconfdir}/openvswitch
%config(noreplace) %{_sysconfdir}/openvswitch/default.conf
%config %ghost %{_sysconfdir}/openvswitch/conf.db
%ghost %{_sysconfdir}/openvswitch/.conf.db.~lock~
%config %ghost %{_sysconfdir}/openvswitch/system-id.conf
%defattr(-,root,root)
%{_bindir}/ovs-appctl
%{_bindir}/ovs-docker
%{_bindir}/ovs-dpctl
%{_bindir}/ovs-dpctl-top
%{_bindir}/ovs-ofctl
%{_bindir}/ovs-parse-backtrace
%{_bindir}/ovs-vsctl
%{_bindir}/ovsdb-client
%{_bindir}/ovsdb-tool
%{_sbindir}/ovs-bugtool
%{_sbindir}/ovs-vlan-bug-workaround
%{_sbindir}/ovs-vswitchd
%{_sbindir}/ovsdb-server
%dir %{_datadir}/openvswitch
%dir %{_datadir}/openvswitch/scripts
%{_datadir}/openvswitch/bugtool-plugins
%{_datadir}/openvswitch/scripts/ovs-bugtool-*
%{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
%{_datadir}/openvswitch/scripts/ovs-ctl
%{_datadir}/openvswitch/scripts/ovs-kmod-ctl
%{_datadir}/openvswitch/scripts/ovs-lib
%{_datadir}/openvswitch/scripts/ovs-save
%{_datadir}/openvswitch/vswitch.ovsschema
%{_mandir}/man1/ovsdb-client.1%{?ext_man}
%{_mandir}/man1/ovsdb-server.1%{?ext_man}
%{_mandir}/man1/ovsdb-tool.1%{?ext_man}
%{_mandir}/man5/ovs-vswitchd.conf.db.5%{?ext_man}
%{_mandir}/man5/ovsdb-server.5%{?ext_man}
%{_mandir}/man7/ovs-fields.7%{?ext_man}
%{_mandir}/man8/ovs-appctl.8%{?ext_man}
%{_mandir}/man8/ovs-bugtool.8%{?ext_man}
%{_mandir}/man8/ovs-ctl.8%{?ext_man}
%{_mandir}/man8/ovs-dpctl-top.8%{?ext_man}
%{_mandir}/man8/ovs-dpctl.8%{?ext_man}
%{_mandir}/man8/ovs-kmod-ctl.8%{?ext_man}
%{_mandir}/man8/ovs-ofctl.8%{?ext_man}
%{_mandir}/man8/ovs-vlan-bug-workaround.8%{?ext_man}
%{_mandir}/man8/ovs-parse-backtrace.8%{?ext_man}
%{_mandir}/man8/ovs-vsctl.8%{?ext_man}
%{_mandir}/man8/ovs-vswitchd.8%{?ext_man}
%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
%{_sbindir}/rcovsdb-server
%{_sbindir}/rcovs-vswitchd
%{_sbindir}/rcopenvswitch
%{_unitdir}/openvswitch.service
%{_unitdir}/ovs-vswitchd.service
%{_unitdir}/ovsdb-server.service
%if 0%{?suse_version}
%{_fillupdir}/sysconfig.openvswitch
%{_datadir}/bash-completion/completions/ovs-appctl-bashcomp.bash
%{_datadir}/bash-completion/completions/ovs-vsctl-bashcomp.bash
%else
%config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
%{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
%{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
%endif
%attr(750,root,root) %dir %{_localstatedir}/log/openvswitch
%ghost %attr(755,root,root) %{_rundir}/openvswitch
%if %{with dpdk}
%{_prefix}/lib/udev/rules.d/91-vfio.rules
%endif
%exclude %{_docdir}/%{name}
%doc source/AUTHORS.rst source/CONTRIBUTING.rst source/NEWS source/README.rst
%license source/LICENSE source/NOTICE
%files doc
%exclude %{_docdir}/%{name}/AUTHORS.rst
%exclude %{_docdir}/%{name}/CONTRIBUTING.rst
%exclude %{_docdir}/%{name}/LICENSE
%exclude %{_docdir}/%{name}/NEWS
%exclude %{_docdir}/%{name}/NOTICE
%exclude %{_docdir}/%{name}/README.rst
%{_docdir}/%{name}/
%files -n %{lname}
%{_libdir}/libofproto-2*.so.*
%{_libdir}/libopenvswitch-2*.so.*
%{_libdir}/libovsdb-2*.so.*
%{_libdir}/libsflow-2*.so.*
%{_libdir}/libovn-2*.so.*
%{_libdir}/libvtep-2*.so.*
%files pki
%{_mandir}/man8/ovs-pki.8%{?ext_man}
%{_bindir}/ovs-pki
%files vtep
%{_bindir}/vtep-ctl
%{_mandir}/man5/vtep.5%{?ext_man}
%{_mandir}/man8/vtep-ctl.8%{?ext_man}
%{_datadir}/openvswitch/scripts/ovs-vtep
%{_datadir}/openvswitch/vtep.ovsschema
%files -n python2-openvswitch
%{python2_sitelib}/ovs/
%files -n python2-openvswitch-test
%{python2_sitelib}/ovstest/
%if 0%{?suse_version}
%files -n python3-openvswitch
%{python3_sitelib}/ovs/
%files -n python3-openvswitch-test
%{python3_sitelib}/ovstest/
%endif
%files ovn-docker
%{_bindir}/ovn-docker-overlay-driver
%{_bindir}/ovn-docker-underlay-driver
%files ovn-common
%{_bindir}/ovn-nbctl
%{_bindir}/ovn-sbctl
%{_bindir}/ovn-trace
%{_bindir}/ovn-detrace
%{_datadir}/openvswitch/scripts/ovn-ctl
%{_datadir}/openvswitch/scripts/ovndb-servers.ocf
%{_datadir}/openvswitch/scripts/ovn-bugtool-nbctl-show
%{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-lflow-list
%{_datadir}/openvswitch/scripts/ovn-bugtool-sbctl-show
%{_mandir}/man5/ovn-nb.5%{?ext_man}
%{_mandir}/man5/ovn-sb.5%{?ext_man}
%{_mandir}/man1/ovn-detrace.1%{?ext_man}
%{_mandir}/man7/ovn-architecture.7%{?ext_man}
%{_mandir}/man8/ovn-ctl.8%{?ext_man}
%{_mandir}/man8/ovn-nbctl.8%{?ext_man}
%{_mandir}/man8/ovn-trace.8%{?ext_man}
%{_mandir}/man8/ovn-sbctl.8%{?ext_man}
%files ovn-central
# Can't use libexecdir because it differs between
# RedHat and SUSE and firewalld expects things in /usr/lib
%dir %{_prefix}/lib/firewalld
%dir %{_prefix}/lib/firewalld/services
%{_bindir}/ovn-northd
%{_mandir}/man8/ovn-northd.8%{?ext_man}
%{_datadir}/openvswitch/ovn-nb.ovsschema
%{_datadir}/openvswitch/ovn-sb.ovsschema
%{_unitdir}/ovn-northd.service
%{_sbindir}/rcovn-northd
%{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml
%files ovn-host
# Can't use libexecdir because it differs between
# RedHat and SUSE and firewalld expects things in /usr/lib
%dir %{_prefix}/lib/firewalld
%dir %{_prefix}/lib/firewalld/services
%{_bindir}/ovn-controller
%{_mandir}/man8/ovn-controller.8%{?ext_man}
%{_unitdir}/ovn-controller.service
%{_sbindir}/rcovn-controller
%{_prefix}/lib/firewalld/services/ovn-host-firewall-service.xml
%files ovn-vtep
%{_bindir}/ovn-controller-vtep
%{_mandir}/man8/ovn-controller-vtep.8%{?ext_man}
%{_unitdir}/ovn-controller-vtep.service
%{_sbindir}/rcovn-controller-vtep
%files test
%{_bindir}/ovs-l3ping
%{_bindir}/ovs-pcap
%{_bindir}/ovs-test
%{_bindir}/ovs-testcontroller
%{_bindir}/ovs-tcpdump
%{_bindir}/ovs-tcpundump
%{_bindir}/ovs-vlan-test
%{_mandir}/man1/ovs-pcap.1%{?ext_man}
%{_mandir}/man1/ovs-tcpundump.1%{?ext_man}
%{_mandir}/man8/ovs-l3ping.8%{?ext_man}
%{_mandir}/man8/ovs-tcpdump.8%{?ext_man}
%{_mandir}/man8/ovs-testcontroller.8%{?ext_man}
%files devel
%{_libdir}/libofproto.so
%{_libdir}/libopenvswitch.so
%{_libdir}/libovn.so
%{_libdir}/libovsdb.so
%{_libdir}/libsflow.so
%{_libdir}/libvtep.so
%{_includedir}/openflow/
%{_includedir}/ovn/
%{_includedir}/openvswitch/
%{_libdir}/pkgconfig/*.pc
%changelog