From 2cfeceea7aee9e1ab56ac2b37a78e715aeb419e8476832f8e503b86c2d642f53 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 3 Mar 2022 21:11:12 +0000 Subject: [PATCH 1/2] Accepting request 957920 from home:susnux:branches:network * Update OVS to version 2.17.0 * Fix CVE-2021-36980 (boo#1188524) * Enable multiple python3 flavor sub-packages on Tumbleweed / Factory Requires: https://build.opensuse.org/request/show/957836 (added patch for missing programs for OVN) OBS-URL: https://build.opensuse.org/request/show/957920 OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=217 --- ...-Replace-deprecated-var-run-with-run.patch | 101 --- 0001-Run-ovn-as-openvswitch-openvswitch.patch | 67 -- ...ngswan-for-openvswitch-ipsec-service.patch | 14 +- install-ovsdb-tools.patch | 34 + openvswitch-2.14.2.tar.gz | 3 - openvswitch-2.17.0.tar.gz | 3 + openvswitch.changes | 100 ++ openvswitch.spec | 857 +++--------------- ovn-20.06.2.tar.gz | 3 - 9 files changed, 247 insertions(+), 935 deletions(-) delete mode 100644 0001-Replace-deprecated-var-run-with-run.patch delete mode 100644 0001-Run-ovn-as-openvswitch-openvswitch.patch create mode 100644 install-ovsdb-tools.patch delete mode 100644 openvswitch-2.14.2.tar.gz create mode 100644 openvswitch-2.17.0.tar.gz delete mode 100644 ovn-20.06.2.tar.gz diff --git a/0001-Replace-deprecated-var-run-with-run.patch b/0001-Replace-deprecated-var-run-with-run.patch deleted file mode 100644 index 3713b7a..0000000 --- a/0001-Replace-deprecated-var-run-with-run.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 89ddd0707175de0f56b605a45afd9926cb80826f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= -Date: Thu, 29 Apr 2021 18:00:12 +0200 -Subject: [PATCH] Replace deprecated /var/run with /run - ---- - rhel/etc_logrotate.d_openvswitch | 4 ++-- - rhel/usr_lib_systemd_system_openvswitch-ipsec.service | 2 +- - ...sr_lib_systemd_system_ovs-delete-transient-ports.service | 2 +- - rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | 6 +++--- - rhel/usr_lib_systemd_system_ovsdb-server.service | 4 ++-- - 5 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/rhel/etc_logrotate.d_openvswitch b/rhel/etc_logrotate.d_openvswitch -index eaf1fd5bf..fa6303873 100644 ---- a/rhel/etc_logrotate.d_openvswitch -+++ b/rhel/etc_logrotate.d_openvswitch -@@ -13,8 +13,8 @@ - missingok - postrotate - # Tell Open vSwitch daemons to reopen their log files -- if [ -d /var/run/openvswitch ]; then -- for ctl in /var/run/openvswitch/*.ctl; do -+ if [ -d /run/openvswitch ]; then -+ for ctl in /run/openvswitch/*.ctl; do - ovs-appctl -t "$ctl" vlog/reopen 2>/dev/null || : - done - fi -diff --git a/rhel/usr_lib_systemd_system_openvswitch-ipsec.service b/rhel/usr_lib_systemd_system_openvswitch-ipsec.service -index 3c4a40138..ec86874cb 100644 ---- a/rhel/usr_lib_systemd_system_openvswitch-ipsec.service -+++ b/rhel/usr_lib_systemd_system_openvswitch-ipsec.service -@@ -5,7 +5,7 @@ After=openvswitch.service - - [Service] - Type=forking --PIDFile=/var/run/openvswitch/ovs-monitor-ipsec.pid -+PIDFile=/run/openvswitch/ovs-monitor-ipsec.pid - ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ - --ike-daemon=strongswan start-ovs-ipsec - ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop-ovs-ipsec -diff --git a/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service -index 4cd4d7f57..d4d7b204b 100644 ---- a/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service -+++ b/rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service -@@ -2,7 +2,7 @@ - Description=Open vSwitch Delete Transient Ports - After=ovsdb-server.service - Before=ovs-vswitchd.service --AssertPathExists=/var/run/openvswitch/db.sock -+AssertPathExists=/run/openvswitch/db.sock - - [Service] - Type=oneshot -diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in -index 08355d950..71c49dc59 100644 ---- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in -+++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in -@@ -4,14 +4,14 @@ After=ovsdb-server.service network-pre.target systemd-udev-settle.service - Before=network.target network.service - Requires=ovsdb-server.service - ReloadPropagatedFrom=ovsdb-server.service --AssertPathIsReadWrite=/var/run/openvswitch/db.sock -+AssertPathIsReadWrite=/run/openvswitch/db.sock - PartOf=openvswitch.service - - [Service] - Type=forking --PIDFile=/var/run/openvswitch/ovs-vswitchd.pid -+PIDFile=/run/openvswitch/ovs-vswitchd.pid - Restart=on-failure --Environment=XDG_RUNTIME_DIR=/var/run/openvswitch -+Environment=XDG_RUNTIME_DIR=/run/openvswitch - EnvironmentFile=/etc/openvswitch/default.conf - EnvironmentFile=-/etc/sysconfig/openvswitch - EnvironmentFile=-/run/openvswitch.useropts -diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service -index 98338b9df..49dc06e38 100644 ---- a/rhel/usr_lib_systemd_system_ovsdb-server.service -+++ b/rhel/usr_lib_systemd_system_ovsdb-server.service -@@ -7,7 +7,7 @@ PartOf=openvswitch.service - - [Service] - Type=forking --PIDFile=/var/run/openvswitch/ovsdb-server.pid -+PIDFile=/run/openvswitch/ovsdb-server.pid - Restart=on-failure - EnvironmentFile=/etc/openvswitch/default.conf - EnvironmentFile=-/etc/sysconfig/openvswitch -@@ -18,7 +18,7 @@ EnvironmentFile=-/run/openvswitch.useropts - # OVS_USER_ID from default.conf or sysconfig. - ExecStartPre=/usr/bin/rm -f /run/openvswitch.useropts - --ExecStartPre=-/usr/bin/chown ${OVS_USER_ID} /var/run/openvswitch /var/log/openvswitch -+ExecStartPre=-/usr/bin/chown ${OVS_USER_ID} /run/openvswitch /var/log/openvswitch - ExecStartPre=/bin/sh -c '/usr/bin/echo "OVS_USER_ID=${OVS_USER_ID}" > /run/openvswitch.useropts' - ExecStartPre=/bin/sh -c 'if [ "$${OVS_USER_ID/:*/}" != "root" ]; then /usr/bin/echo "OVS_USER_OPT=--ovs-user=${OVS_USER_ID}" >> /run/openvswitch.useropts; fi' - ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ --- -2.26.2 - diff --git a/0001-Run-ovn-as-openvswitch-openvswitch.patch b/0001-Run-ovn-as-openvswitch-openvswitch.patch deleted file mode 100644 index ab9a28d..0000000 --- a/0001-Run-ovn-as-openvswitch-openvswitch.patch +++ /dev/null @@ -1,67 +0,0 @@ -From aa1869378cf512fd7aeee16c0a030264c2623270 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= -Date: Fri, 8 May 2020 11:23:04 +0200 -Subject: [PATCH] Run ovn as openvswitch:openvswitch - -Change default run configuration to unprivilieged user openvswitch and -group openvswitch. Expect any further customization from user in -sysconfig/ovn. ---- - rhel/etc_logrotate.d_ovn | 2 +- - rhel/usr_lib_systemd_system_ovn-controller-vtep.service | 1 + - rhel/usr_lib_systemd_system_ovn-controller.service | 1 + - rhel/usr_lib_systemd_system_ovn-northd.service | 1 + - 4 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/rhel/etc_logrotate.d_ovn b/rhel/etc_logrotate.d_ovn -index a351ec303..4b26333fc 100644 ---- a/rhel/etc_logrotate.d_ovn -+++ b/rhel/etc_logrotate.d_ovn -@@ -6,7 +6,7 @@ - # without warranty of any kind. - - /var/log/ovn/*.log { -- su root root -+ su openvswitch openvswitch - daily - compress - sharedscripts -diff --git a/rhel/usr_lib_systemd_system_ovn-controller-vtep.service b/rhel/usr_lib_systemd_system_ovn-controller-vtep.service -index 09ad0612c..dd6ff6675 100644 ---- a/rhel/usr_lib_systemd_system_ovn-controller-vtep.service -+++ b/rhel/usr_lib_systemd_system_ovn-controller-vtep.service -@@ -35,6 +35,7 @@ After=openvswitch.service - [Service] - Type=simple - Restart=on-failure -+Environment=OVN_USER_ID=openvswitch:openvswitch - Environment=OVS_RUNDIR=%t/openvswitch - Environment=OVN_RUNDIR=%t/ovn - Environment=OVN_DB=unix:%t/ovn/ovnsb_db.sock -diff --git a/rhel/usr_lib_systemd_system_ovn-controller.service b/rhel/usr_lib_systemd_system_ovn-controller.service -index 15d0ac853..c602760f1 100644 ---- a/rhel/usr_lib_systemd_system_ovn-controller.service -+++ b/rhel/usr_lib_systemd_system_ovn-controller.service -@@ -23,6 +23,7 @@ After=openvswitch.service - Type=forking - PIDFile=/var/run/ovn/ovn-controller.pid - Restart=on-failure -+Environment=OVN_USER_ID=openvswitch:openvswitch - Environment=OVN_RUNDIR=%t/ovn OVS_RUNDIR=%t/openvswitch - EnvironmentFile=-/etc/sysconfig/ovn - EnvironmentFile=-/etc/sysconfig/ovn-controller -diff --git a/rhel/usr_lib_systemd_system_ovn-northd.service b/rhel/usr_lib_systemd_system_ovn-northd.service -index d281f861c..d5c7dfa5f 100644 ---- a/rhel/usr_lib_systemd_system_ovn-northd.service -+++ b/rhel/usr_lib_systemd_system_ovn-northd.service -@@ -20,6 +20,7 @@ After=syslog.target - [Service] - Type=oneshot - RemainAfterExit=yes -+Environment=OVN_USER_ID=openvswitch:openvswitch - Environment=OVN_RUNDIR=%t/ovn OVN_DBDIR=/var/lib/ovn - EnvironmentFile=-/etc/sysconfig/ovn - EnvironmentFile=-/etc/sysconfig/ovn-northd --- -2.16.4 - diff --git a/0001-Use-strongswan-for-openvswitch-ipsec-service.patch b/0001-Use-strongswan-for-openvswitch-ipsec-service.patch index 08a8049..0835760 100644 --- a/0001-Use-strongswan-for-openvswitch-ipsec-service.patch +++ b/0001-Use-strongswan-for-openvswitch-ipsec-service.patch @@ -9,19 +9,15 @@ time being. rhel/usr_lib_systemd_system_openvswitch-ipsec.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/rhel/usr_lib_systemd_system_openvswitch-ipsec.service b/rhel/usr_lib_systemd_system_openvswitch-ipsec.service -index d8f47af68..3c4a40138 100644 ---- a/rhel/usr_lib_systemd_system_openvswitch-ipsec.service -+++ b/rhel/usr_lib_systemd_system_openvswitch-ipsec.service -@@ -7,7 +7,7 @@ After=openvswitch.service +diff -Nur openvswitch-2.17.0/rhel/usr_lib_systemd_system_openvswitch-ipsec.service new/rhel/usr_lib_systemd_system_openvswitch-ipsec.service +--- openvswitch-2.17.0/rhel/usr_lib_systemd_system_openvswitch-ipsec.service 2022-02-17 23:15:55.257680736 +0100 ++++ new/rhel/usr_lib_systemd_system_openvswitch-ipsec.service 2022-02-26 02:22:12.429785364 +0100 +@@ -7,7 +7,7 @@ Type=forking - PIDFile=/var/run/openvswitch/ovs-monitor-ipsec.pid + PIDFile=/run/openvswitch/ovs-monitor-ipsec.pid ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ - --ike-daemon=libreswan start-ovs-ipsec + --ike-daemon=strongswan start-ovs-ipsec ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop-ovs-ipsec [Install] --- -2.16.4 - diff --git a/install-ovsdb-tools.patch b/install-ovsdb-tools.patch new file mode 100644 index 0000000..925a57b --- /dev/null +++ b/install-ovsdb-tools.patch @@ -0,0 +1,34 @@ +diff -Nur openvswitch-2.17.0/ovsdb/automake.mk new/ovsdb/automake.mk +--- openvswitch-2.17.0/ovsdb/automake.mk 2022-02-17 23:15:55.240680736 +0100 ++++ new/ovsdb/automake.mk 2022-02-27 20:21:59.358719903 +0100 +@@ -88,8 +88,9 @@ + MAN_ROOTS += ovsdb/ovsdb-server.1.in + + # ovsdb-idlc +-noinst_SCRIPTS += ovsdb/ovsdb-idlc ++bin_SCRIPTS += ovsdb/ovsdb-idlc + EXTRA_DIST += ovsdb/ovsdb-idlc.in ++man_MANS += ovsdb/ovsdb-idlc.1 + MAN_ROOTS += ovsdb/ovsdb-idlc.1 + CLEANFILES += ovsdb/ovsdb-idlc + SUFFIXES += .ovsidl .ovsschema +@@ -112,14 +113,18 @@ + # at least for now. + $(OVSIDL_BUILT): ovsdb/ovsdb-idlc.in python/ovs/dirs.py + ++# Some internal tools, but installed for e.g. depending projects like OVN ++ovsdbdir = $(pkgdatadir)/ovsdb ++ovsdb_SCRIPTS = + # ovsdb-doc ++ovsdb_SCRIPTS += ovsdb/ovsdb-doc + EXTRA_DIST += ovsdb/ovsdb-doc + OVSDB_DOC = $(run_python) $(srcdir)/ovsdb/ovsdb-doc + ovsdb/ovsdb-doc: python/ovs/dirs.py + + # ovsdb-dot + EXTRA_DIST += ovsdb/ovsdb-dot.in ovsdb/dot2pic +-noinst_SCRIPTS += ovsdb/ovsdb-dot ++ovsdb_SCRIPTS += ovsdb/ovsdb-dot + CLEANFILES += ovsdb/ovsdb-dot + OVSDB_DOT = $(run_python) $(srcdir)/ovsdb/ovsdb-dot.in + diff --git a/openvswitch-2.14.2.tar.gz b/openvswitch-2.14.2.tar.gz deleted file mode 100644 index 33adfb7..0000000 --- a/openvswitch-2.14.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65f420f954e250d895fb2db22a132e1cb560bc5e2b9051e834511348108e597a -size 7394648 diff --git a/openvswitch-2.17.0.tar.gz b/openvswitch-2.17.0.tar.gz new file mode 100644 index 0000000..939da01 --- /dev/null +++ b/openvswitch-2.17.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e03bfab7ca82d81a7d3a36de4f390a3b5210e3f39657671f922877cd4ea6dc73 +size 7729001 diff --git a/openvswitch.changes b/openvswitch.changes index 839bd0f..deb395a 100644 --- a/openvswitch.changes +++ b/openvswitch.changes @@ -1,3 +1,103 @@ +------------------------------------------------------------------- +Sun Feb 27 19:24:57 UTC 2022 - Ferdinand Thiessen + +- Added install-ovsdb-tools.patch to install ovsdb tools required + for building OVN + +------------------------------------------------------------------- +Sat Feb 26 22:11:06 UTC 2022 - Ferdinand Thiessen + +- Enable multiple python3 flavor subpackages on Tumbleweed / Factory + +------------------------------------------------------------------- +Sat Feb 26 00:56:03 UTC 2022 - Ferdinand Thiessen + +- Update OVS to version 2.17.0 + * Userspace datapath: + * Optimized flow lookups for datapath flows with simple match criteria. + * New per-interface configuration knob 'other_config:tx-steering'. + * Removed experimental tag for PMD Auto Load Balance. + * New configuration knob 'other_config:n-offload-threads' to change the + number of HW offloading threads. + * DPDK: + * EAL argument --socket-mem is no longer configured by default upon + start-up. If dpdk-socket-mem and dpdk-alloc-mem are not specified, + DPDK defaults will be used. + * EAL argument --socket-limit no longer takes on the value of --socket-mem + by default. 'other_config:dpdk-socket-limit' can be set equal to + the 'other_config:dpdk-socket-mem' to preserve the legacy memory + limiting behavior. + * EAL argument --in-memory is applied by default if supported. + * Add support for DPDK 21.11. + * Forbid use of DPDK multiprocess feature. + * Add support for running threads on cores >= RTE_MAX_LCORE. + * Python: For SSL support, the use of the pyOpenSSL library has + been replaced with the native 'ssl' module. + * OVSDB: + * Python library for OVSDB clients now also supports faster + resynchronization with a clustered database after a brief disconnection, + i.e. 'monitor_cond_since' monitoring method. + * Major improvement in the performance of the OVSDB server. + * OpenFlow: + * Default selection method for select groups with up to 256 buckets is + now dp_hash. Previously this was limited to 64 buckets. This change + is mainly for the benefit of OVN load balancing configurations. + * Encap & Decap action support for MPLS packet type. +- Update OVS to version 2.16.0 + * Fix CVE-2021-36980 (boo#1188524) + openvswitch 2.11.0 through 2.15.0 has a use-after-free in + decode_NXAST_RAW_ENCAP (called from ofpact_decode and ofpacts_decode) + during the decoding of a RAW_ENCAP action + * Removed support for 1024-bit Diffie-Hellman key exchange + * Rate limiting configuration now supports setting packet-per-second + limits in addition to the previously configurable byte rate settings. + * OVSDB: + * Introduced new database service model - "relay". + * New command line options --record/--replay for ovsdb-server and + ovsdb-client to record and replay all the incoming transactions, + monitors, etc. + * The Python Idl class now has a cooperative_yield() method + * In ovs-vsctl and vtep-ctl, the "find" command now accept new + operators {in} and {not-in}. + * Various Userspace datapath improvements + * ovs-ctl: + * New option '--no-record-hostname' to disable hostname configuration + in ovsdb on startup. + * New command 'record-hostname-if-not-set' to update hostname in ovsdb. + * ovs-appctl: Added ability to add and delete static mac entries using: + 'ovs-appctl fdb/add ' + 'ovs-appctl fdb/del ' + * Linux datapath: + * ovs-vswitchd will configure the kernel module using per-cpu dispatch + mode (if available). This changes the way upcalls are delivered to + user space in order to resolve a number of issues with per-vport dispatch. + * New vswitchd unixctl command `dpif-netlink/dispatch-mode` will return + the current dispatch mode for each datapath. +- Update OVS to version 2.15.0 + * OVSDB: + * Changed format in which ovsdb transactions are stored in + database files. Now each transaction contains diff of data + instead of the whole new value of a column. + * New unixctl command 'ovsdb-server/get-db-storage-status' + * New unixctl command 'ovsdb-server/memory-trim-on-compaction on|off'. + * Maximum backlog on RAFT connections limited to 500 messages or 4GB. + * DPDK: Removed support for vhost-user dequeue zero-copy. + * Add support for DPDK 20.11. + * The environment variable OVS_UNBOUND_CONF, if set, is now used + as the DNS resolver's (unbound) configuration file. + * Linux datapath: Support for kernel versions up to 5.8.x. + * Building the Linux kernel module from the OVS source tree is deprecated + * Support for the Linux kernel is capped at version 5.8 + * Only bug fixes for the Linux OOT kernel module will be accepted. + * The Linux kernel module will be fully removed from the OVS source tree + in OVS branch 2.18 +- Rebased 0001-Use-strongswan-for-openvswitch-ipsec-service.patch +- Drop upstream fixed 0001-Replace-deprecated-var-run-with-run.patch +- Separated OVN + * Stand alone package, this enables better maintenance + especially updates. + * Drop 0001-Run-ovn-as-openvswitch-openvswitch.patch from OVN + ------------------------------------------------------------------- Mon May 10 10:28:32 UTC 2021 - Dirk Müller diff --git a/openvswitch.spec b/openvswitch.spec index 731a5dd..3077524 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -1,7 +1,7 @@ # # spec file for package openvswitch # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,26 +17,15 @@ # needssslcertforbuild -%define ovs_lname libopenvswitch-2_14-0 -%define ovn_lname libovn-20_06-0 -%define ovs_version 2.14.2 -%define ovn_version 20.06.2 -%define ovs_dir ovs-%{ovs_version} -%define ovn_dir ovn-%{ovn_version} +%define skip_python2 1 %define rpmstate %{_rundir}/openvswitch-rpm-state- #Compat macro for new _fillupdir macro introduced in Nov 2017 %if ! %{defined _fillupdir} %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif -%ifarch aarch64 x86_64 -%if 0%{?suse_version} -# DPDK enabled only SUSE/openSUSE +%ifarch aarch64 x86_64 ppc64le %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 @@ -45,8 +34,9 @@ %bcond_with check # Disable building the external kernel datapath by default %bcond_with kmp +%define lname libopenvswitch-2_17-0 Name: openvswitch -Version: %{ovs_version} +Version: 2.17.0 Release: 0 Summary: A multilayer virtual network switch # All code is Apache-2.0 except @@ -56,10 +46,8 @@ 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: https://github.com/ovn-org/ovn/archive/v%{ovn_version}.tar.gz#/ovn-%{ovn_version}.tar.gz Source2: preamble Source89: Module.supported.updates -# OVS patches # PATCH-FIX-OPENSUSE: Use-strongswan-for-openvswitch-ipsec-service.patch Patch0: 0001-Use-strongswan-for-openvswitch-ipsec-service.patch # PATCH-FIX-OPENSUSE: 0001-Run-openvswitch-as-openvswitch-openvswitch.patch @@ -68,24 +56,29 @@ Patch1: 0001-Run-openvswitch-as-openvswitch-openvswitch.patch Patch2: 0001-Don-t-change-permissions-of-dev-hugepages.patch # PATCH-FIX-OPENSUSE: 0001-Use-double-hash-for-OVS_USER_ID-comment.patch Patch3: 0001-Use-double-hash-for-OVS_USER_ID-comment.patch -# PATCH-FIX-OPENSUSE: 0001-Replace-deprecated-var-run-with-run.patch -Patch4: 0001-Replace-deprecated-var-run-with-run.patch -#OVN patches -# PATCH-FIX-OPENSUSE: 0001-Run-ovn-as-openvswitch-openvswitch.patch -Patch20: 0001-Run-ovn-as-openvswitch-openvswitch.patch +# PATCH-FEATURE-UPSTREAM install-ovsdb-tools.patch -- Install some tools required for building OVN +Patch4: install-ovsdb-tools.patch +BuildRequires: %{python_module setuptools} BuildRequires: autoconf BuildRequires: automake +BuildRequires: fdupes BuildRequires: graphviz BuildRequires: libcap-ng-devel +BuildRequires: libopenssl-devel BuildRequires: libtool BuildRequires: make BuildRequires: pkgconfig -BuildRequires: python3-devel +BuildRequires: python +BuildRequires: python-rpm-macros +BuildRequires: python3-Sphinx BuildRequires: unbound-devel BuildRequires: pkgconfig(openssl) Requires: modutils # ovs-ctl / ovs-pki use /usr/bin/uuidgen: Requires: util-linux +Requires(post): %fillup_prereq +Requires(pre): shadow +Suggests: logrotate Provides: openvswitch-common = %{version} Obsoletes: openvswitch-common < 2.7.0 Provides: openvswitch-controller = %{version} @@ -98,26 +91,7 @@ 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: fdupes -BuildRequires: libopenssl-devel -BuildRequires: python-rpm-macros -BuildRequires: python3-Sphinx -Requires(post): %fillup_prereq -Requires(pre): shadow -Suggests: logrotate %{?systemd_ordering} -%else -BuildRequires: environment-modules -BuildRequires: openssl-devel -BuildRequires: python3-rpm-macros -BuildRequires: python3-sphinx -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 @@ -128,14 +102,23 @@ Suggests: openvswitch-kmp %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 19.11.1. -BuildRequires: dpdk-devel < 19.12 -BuildRequires: dpdk-devel >= 19.11.1 +# releases. +BuildRequires: dpdk-devel <= 21.11 +BuildRequires: dpdk-devel >= 20.11.0 BuildRequires: libmnl-devel BuildRequires: libnuma-devel BuildRequires: libpcap-devel BuildRequires: rdma-core-devel %endif +%if 0%{?suse_version} >= 1550 +# TW: generate subpackages for every python3 flavor +%define python_subpackage_only 1 +%python_subpackages +%else +%define python_sitelib %python3_sitelib +%define python_sitelib %{python3_sitelib} +%define python_files() -n python3-%{**} +%endif %description Open vSwitch is a multilayer virtual network Ethernet switch. It is @@ -157,12 +140,12 @@ BuildRequires: %{kernel_module_package_buildreqs} Kernel modules supporting the openvswitch datapath. %endif -%package -n %{ovs_lname} +%package -n %{lname} Summary: Open vSwitch core libraries License: Apache-2.0 Group: System/Libraries -%description -n %{ovs_lname} +%description -n %{lname} Contains the shared libraries used by Open vSwitch and any eventual extensions. %package doc @@ -178,7 +161,7 @@ Contains additional documentation for the Open vSwitch. Summary: Development files for Open vSwitch License: Apache-2.0 Group: Development/Libraries/C and C++ -Requires: %{ovs_lname} = %{version} +Requires: %{lname} = %{version} Provides: %{name}-dpdk-devel = %{version} Obsoletes: %{name}-dpdk-devel < 2.7.0 @@ -229,19 +212,6 @@ Requires: strongswan %description ipsec This package provides IPsec tunneling support for OVS tunnels. -%package -n python3-ovs -Summary: Python3 bindings for Open vSwitch -License: Apache-2.0 -Group: Productivity/Networking/System -Requires: %{ovs_lname} = %{version} -Requires: python3 -Requires: python3-sortedcontainers -Provides: python3-%{name} = %{version} -Obsoletes: python3-%{name} < 2.10.1 - -%description -n python3-ovs -This package contains the Python3 bindings for Open vSwitch database. - %package test Summary: Open vSwitch test package License: Apache-2.0 @@ -259,189 +229,56 @@ 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. -# OVN preambles from now on, overwrites Version and URL - -%package -n ovn -Version: %{ovn_version} -Release: 0 -Summary: Open Virtual Network diagnostic utilities +%if 0%{?python_subpackage_only} +%package -n python-ovs +Summary: Python bindings for Open vSwitch License: Apache-2.0 Group: Productivity/Networking/System -URL: http://ovn.org/ -Requires: %{name} = %{ovs_version} -# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep} -Provides: %{name}-dpdk-ovn = %{ovn_version} -Provides: %{name}-ovn = %{ovn_version} -Provides: %{name}-ovn-common = %{ovn_version} -Obsoletes: %{name}-dpdk-ovn < 2.7.0 -Obsoletes: %{name}-ovn < 2.7.0 -Obsoletes: %{name}-ovn-common < 2.13.0 -%if 0%{?suse_version} -Suggests: logrotate +Requires: %{lname} = %{version} +Requires: python-sortedcontainers + +%description -n python-ovs +This package contains the Python3 bindings for Open vSwitch database. +%else + +%package -n python3-ovs +Summary: Python bindings for Open vSwitch +License: Apache-2.0 +Group: Productivity/Networking/System +Requires: %{lname} = %{version} +Requires: python-sortedcontainers + +%description -n python3-ovs +This package contains the Python3 bindings for Open vSwitch database. %endif -%description -n 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. - -%package -n ovn-central -Version: %{ovn_version} -Release: 0 -Summary: Open Virtual Network support for Open vSwitch -License: Apache-2.0 -Group: Productivity/Networking/System -URL: http://ovn.org/ -Requires: %{name} = %{ovs_version} -Requires: ovn = %{ovn_version} -# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep} -Provides: %{name}-dpdk-ovn:%{_bindir}/ovn-northd -Provides: %{name}-ovn-central = %{ovn_version} -Provides: %{name}-ovn:%{_bindir}/ovn-northd -Obsoletes: %{name}-ovn-central < 2.13.0 - -%description -n ovn-central -This subpackage contains the OVN database and northbound daemon. - -%package -n ovn-host -Version: %{ovn_version} -Release: 0 -Summary: Open Virtual Network support for Open vSwitch -License: Apache-2.0 -Group: Productivity/Networking/System -URL: http://ovn.org/ -Requires: %{name} = %{ovs_version} -Requires: ovn = %{ovn_version} -# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep} -Provides: %{name}-dpdk-ovn:%{_bindir}/ovn-controller -Provides: %{name}-ovn-host = %{ovn_version} -Provides: %{name}-ovn:%{_bindir}/ovn-controller -Obsoletes: %{name}-ovn-host < 2.13.0 - -%description -n ovn-host -This subpackage contains the OVN host controller. - -%package -n ovn-vtep -Version: %{ovn_version} -Release: 0 -Summary: Open Virtual Network VTEP controller for Open vSwitch -License: Apache-2.0 -Group: Productivity/Networking/System -URL: http://ovn.org/ -Requires: %{name} = %{ovs_version} -Requires: ovn = %{ovn_version} -# openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep} -Provides: %{name}-dpdk-ovn:%{_bindir}/ovn-controller-vtep -Provides: %{name}-ovn-vtep = %{ovn_version} -Provides: %{name}-ovn:%{_bindir}/ovn-controller-vtep -Obsoletes: %{name}-ovn-vtep < 2.13.0 - -%description -n ovn-vtep -This subpackage contains the OVN VTEP (VXLAN Tunnel Endpoint) controller. - -%package -n ovn-docker -Version: %{ovn_version} -Release: 0 -Summary: Docker network plugins for OVN -License: Apache-2.0 -Group: Productivity/Networking/System -URL: http://ovn.org/ -Requires: %{name} = %{ovs_version} -Requires: ovn = %{ovn_version} -Requires: python3-openvswitch = %{ovs_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-docker = %{ovn_version} -Provides: %{name}-ovn:%{_bindir}/ovn-docker-overlay-driver -Obsoletes: %{name}-ovn-docker < 2.13.0 - -%description -n ovn-docker -This subpackage contains the OVN Docker network plugins. - -%package -n ovn-doc -Version: %{ovn_version} -Release: 0 -Summary: Open Virtual Network Documentation -License: Apache-2.0 -Group: System/Libraries -BuildArch: noarch - -%description -n ovn-doc -Contains additional documentation for OVN. - -%package -n %{ovn_lname} -Version: %{ovn_version} -Release: 0 -Summary: Open Virtual Network core libraries -License: Apache-2.0 -Group: System/Libraries - -%description -n %{ovn_lname} -iThis subpackage contains the OVN shared libraries. - -%package -n ovn-devel -Version: %{ovn_version} -Release: 0 -Summary: Development files for Open Virtual Network -License: Apache-2.0 -Group: Development/Libraries/C and C++ -Requires: %{ovn_lname} = %{ovn_version} -# ovn-devel was split form openvswitch-devel -Provides: %{name}-devel:%{_includedir}/ovn - -%description -n ovn-devel -Devel libraries and headers for Open Virtual Network. - %prep -%setup -q -n %{name}-%{ovs_version} -a 1 -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -cd %{ovn_dir} -%patch20 -p1 +%autosetup -p1 %build -mkdir %ovs_dir -# We build both OVS and OVN. OVN is already on its own subdir ovn_dir. -# Move OVS sources to ovs_dir -find $PWD -maxdepth 1 ! -path $PWD ! -name %ovs_dir -a ! -name %ovn_dir -exec mv -t %ovs_dir {} + - -# Init OVS config. -pushd %ovs_dir -# only call boot.sh for distros with autoconf >= 2.64 -bash -x boot.sh -popd +autoreconf -fi # Build kernel modules if needed. %if %{with kmp} mkdir kmp - export EXTRA_CFLAGS='-DVERSION=\"%{ovs_version}\"' + export EXTRA_CFLAGS='-DVERSION=\"%{version}\"' for flavor in %{flavors_to_build}; do rm -rf kmp/$flavor - cp -r %ovs_dir kmp/$flavor - cp -a %{SOURCE89} kmp/$flavor/datapath/linux/Module.supported + mkdir -p kmp/$flavor pushd kmp/$flavor + tar -xf "%{SOURCE0}" + cp -a %{SOURCE89} datapath/linux/Module.supported %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} + %make_build popd done %endif -# Build OVS. -pushd %ovs_dir - -%if %{with dpdk} - dpdk_opt="--with-dpdk" -%endif - # This currently has no effect as the @dpdk section has been patched out of the # service file. Run it anyway, in case a new section that we need appears over # time. @@ -455,42 +292,25 @@ python3 build-aux/dpdkstrip.py \ > rhel/usr_lib_systemd_system_ovs-vswitchd.service %configure \ - --disable-static \ - --enable-shared \ - --enable-libcapng \ - --enable-ssl \ - ${dpdk_opt} \ - --with-dbdir=%{_sharedstatedir}/openvswitch \ - --with-rundir=%{_rundir}/openvswitch \ - --with-logdir=%{_localstatedir}/log/openvswitch \ - --with-pkidir=%{_sharedstatedir}/openvswitch/pki \ - PYTHON3=%{_bindir}/python3 -make %{?_smp_mflags} -popd - -# Build OVN. -pushd %ovn_dir - -bash -x boot.sh -%configure \ - --with-ovs-source=../%ovs_dir \ - --disable-static \ - --enable-shared \ - --enable-libcapng \ - --enable-ssl \ - --with-dbdir=%{_sharedstatedir}/ovn \ - --with-rundir=%{_rundir}/ovn \ - --with-logdir=%{_localstatedir}/log/ovn \ - --with-pkidir=%{_sharedstatedir}/openvswitch/pki \ - PYTHON3=%{_bindir}/python3 -make %{?_smp_mflags} + --disable-static \ + --enable-shared \ + --enable-libcapng \ + --enable-ssl \ +%if %{with dpdk} + --with-dpdk=shared \ +%endif + --with-dbdir=%{_sharedstatedir}/openvswitch \ + --with-rundir=%{_rundir}/openvswitch \ + --with-logdir=%{_localstatedir}/log/openvswitch \ + --with-pkidir=%{_sharedstatedir}/openvswitch/pki \ + PYTHON3=%{_bindir}/python3 +%make_build %check %if %{with check} touch resolv.conf export OVS_RESOLV_CONF=$(pwd)/resolv.conf -pushd %ovs_dir # 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. @@ -499,18 +319,9 @@ if ! make check TESTSUITEFLAGS="%{?_smp_mflags}" && cat tests/testsuite.log exit 1 fi -popd - -pushd $ovn_dir -if ! make check TESTSUITEFLAGS="%{?_smp_mflags}" RECHECK=yes; then - cat tests/testsuite.log - exit 1 -fi -popd %endif %install - # Intall kernel modules. %if %{with kmp} export NO_BRP_STALE_LINK_ERROR=yes @@ -524,40 +335,9 @@ for flavor in %{flavors_to_build}; do done %endif -# Install OVS dist files on temp buildroot. -mkdir -p buildroot/ovs -pushd %ovs_dir -%make_install DESTDIR=$(pwd)/../buildroot/ovs -popd - -# Clean up OVS files -rm -f buildroot/ovs%{_libdir}/*.a -rm -f buildroot/ovs%{_libdir}/*.la - -# Install OVN dist files on temp build root. -mkdir -p buildroot/ovn -pushd %ovn_dir -%make_install DESTDIR=$(pwd)/../buildroot/ovn -popd - -# Clean up OVN files -rm -f buildroot/ovn%{_datadir}/ovn/scripts/ovs* -rm -rf buildroot/ovn%{_datadir}/ovn/bugtool-plugins -rm -f buildroot/ovn%{_libdir}/*.a -rm -f buildroot/ovn%{_libdir}/*.la - -# Remove known OVS dupes from OVN. -rm -f buildroot/ovn%{_mandir}/man5/ovs* -rm -f buildroot/ovn%{_mandir}/man7/ovs* - -# Verify no duplicates and move dist files to real buildroot -dupes=$(find buildroot -mindepth 2 -type f -printf '%p\n' | cut -d'/' -f3- | sort | uniq -c | grep -Ev "^ *1 " || true) -[ -n "$dupes" ] && exit 1 -cp -an buildroot/ovn/* %{buildroot}/ -cp -an buildroot/ovs/* %{buildroot}/ - -# Install OVS additional files -pushd %ovs_dir +%make_install +# Remove static libraries and libtool files +rm -f %{buildroot}%{_libdir}/*.{l,}a # Install extra headers not included with 'make install' copy_headers() { @@ -572,6 +352,7 @@ copy_headers include/sparse/netinet %{_includedir}/openvswitch/sparse/netinet copy_headers include/sparse/sys %{_includedir}/openvswitch/sparse/sys copy_headers lib %{_includedir}/openvswitch/lib +# Install systemd files for service in openvswitch \ ovsdb-server \ ovs-vswitchd \ @@ -582,32 +363,13 @@ for service in openvswitch \ ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc${service} done -# This changes group ownership of any vfio device to 'hugetlbfs' through udev. -# That's probably not the most appropriate name for such a group and also -# should probably be coordinated system wide. -#%%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 +# Fix installation path mkdir -p %{buildroot}/%{_datadir}/bash-completion/completions/ mv %{buildroot}/%{_sysconfdir}/bash_completion.d/ovs-* %{buildroot}/%{_datadir}/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 0755 %{buildroot}/%{_rundir}/openvswitch install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d install -d -m 0755 %{buildroot}%{_localstatedir}/log/openvswitch @@ -627,83 +389,27 @@ rm -rf %{buildroot}%{_docdir}/%{name}/_build rm %{buildroot}%{_docdir}/%{name}/automake.mk rm %{buildroot}%{_docdir}/%{name}/conf.py -popd - # Tests mkdir -p %{buildroot}%{python3_sitelib} cp -a %{buildroot}%{_datadir}/openvswitch/python/ovstest \ %{buildroot}%{python3_sitelib} # Python subpackage -# Build on a temporary directory. -mkdir python3-ovs && pushd $_ # Some build files are in sources while others are generated directly on # buildroot as part of make_install (dirs.py). Copy them first. -cp -an ../buildroot/ovs%{_datadir}/openvswitch/python/* $(pwd)/ -cp -an ../%{ovs_dir}/python/* $(pwd)/ +pushd python +cp -an %{buildroot}%{_datadir}/openvswitch/python/* . rm -rf %{buildroot}%{_datadir}/openvswitch/python export LDFLAGS="${LDFLAGS} -L %{buildroot}%{_libdir}" export CPPFLAGS="-I ../../include" -%if 0%{?suse_version} -# SLES -%{python3_build} -%{python3_install} -%fdupes %{buildroot}%{python3_sitearch} -%else -# RHEL -%py3_build -%py3_install -%endif - -# Done with OVS additional files. -popd - -# Install OVN aditional files. -pushd %ovn_dir - -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 - ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc${service} -done - -%if 0%{?suse_version} -install -D -m 644 rhel/usr_share_ovn_scripts_systemd_sysconfig.template \ - %{buildroot}%{_fillupdir}/sysconfig.ovn -%else -install -D -m 644 rhel/usr_share_ovn_scripts_systemd_sysconfig.template \ - %{buildroot}%{_sysconfdir}/sysconfig/ovn -%endif - -# 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 - -install -p -D -m 0644 rhel/etc_logrotate.d_ovn \ - %{buildroot}%{_sysconfdir}/logrotate.d/ovn -install -d -m 0755 %{buildroot}%{_localstatedir}/log/ovn - -# Copy documentation. -mkdir -p %{buildroot}%{_docdir}/ovn -cp -r Documentation/* %{buildroot}%{_docdir}/ovn -rm -rf %{buildroot}%{_docdir}/ovn/_build -rm %{buildroot}%{_docdir}/ovn/automake.mk -rm %{buildroot}%{_docdir}/ovn/conf.py - -# Done with OVN additional files. +%python_build +%python_install popd %pre -%if 0%{?suse_version} - %service_add_pre ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service -%endif +%service_add_pre ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service if [ "$1" -ge 1 ]; then # Save the "enabled" state across the transition of # ownership of openvswitch.service from openvswitch-switch to @@ -721,44 +427,16 @@ getent passwd openvswitch >/dev/null || \ exit 0 %pre ipsec -%if 0%{?suse_version} - %service_add_pre openvswitch-ipsec.service -%endif +%service_add_pre openvswitch-ipsec.service %preun -%if 0%{?suse_version} - %service_del_preun ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.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 +%service_del_preun ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service %preun ipsec -%if 0%{?suse_version} - %service_del_preun openvswitch-ipsec.service -%endif +%service_del_preun openvswitch-ipsec.service %preun test -%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 +%service_del_preun openvswitch-testcontroller %post if [ $1 -eq 1 ]; then @@ -766,26 +444,12 @@ if [ $1 -eq 1 ]; then # configuration is changed on upgrade so use fillup only for new installs. %{?suse_version: %fillup_only -n openvswitch} fi - -%if 0%{?suse_version} - %service_add_post ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service -%else - %if 0%{?systemd_post:1} - %systemd_post openvswitch.service - %else - # Package install, not upgrade - if [ $1 -eq 1 ]; then - /bin/systemctl daemon-reload >dev/null || : - fi - %endif -%endif +%service_add_post ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service %post ipsec -%if 0%{?suse_version} - %service_add_post openvswitch-ipsec.service -%endif +%service_add_post openvswitch-ipsec.service -%post -n %{ovs_lname} -p /sbin/ldconfig +%post -n %{lname} -p /sbin/ldconfig %postun # Do not restart the openvswitch service on package updates. @@ -794,34 +458,15 @@ fi # 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} - %service_del_postun_without_restart ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service -%else - %if 0%{?systemd_postun:1} - %systemd_postun openvswitch.service - %else - /bin/systemctl daemon-reload >/dev/null 2>&1 || : - %endif -%endif +%service_del_postun_without_restart ovsdb-server.service ovs-vswitchd.service openvswitch.service ovs-delete-transient-ports.service %postun ipsec -%if 0%{?suse_version} - %service_del_postun_without_restart openvswitch-ipsec.service -%endif +%service_del_postun_without_restart openvswitch-ipsec.service %postun test -%if 0%{?suse_version} - %service_del_postun_without_restart openvswitch-testcontroller -%else - %if 0%{?systemd_postun:1} - %systemd_postun openvswitch-testcontroller.service - %else - /bin/systemctl daemon-reload >/dev/null 2>&1 || : - %endif -%endif +%service_del_postun_without_restart openvswitch-testcontroller -%postun -n %{ovs_lname} -p /sbin/ldconfig +%postun -n %{lname} -p /sbin/ldconfig %posttrans # Save the "enabled" state across the transition of ownership @@ -863,7 +508,7 @@ fi # Use .conf.db.~lock~ instead of conf.db as conf.db might have been moved # to a backup on a previous run attempt. if [ -z "$ovsuserid" -a -n "$ovsdbdir" -a -f "$ovsdbdir/.conf.db.~lock~" ]; then - ovsuserid=$(stat -c "%U:%G" "$ovsdbdir/.conf.db.~lock~") + ovsuserid=$(stat -c "%{U}:%G" "$ovsdbdir/.conf.db.~lock~") if [ "$ovsuserid" = "root:root" ]; then sed -i -e '1{r /dev/stdin' -e 'N}' "%{_sysconfdir}/sysconfig/openvswitch" << EOF @@ -877,203 +522,6 @@ EOF fi fi -%pre -n ovn-central -%if 0%{?suse_version} -%service_add_pre ovn-northd.service -%endif -# Save the "enabled" state across the transition of -# ownership of ovn-northd.service from openvswitch-ovn-central to -# ovn-central. -if [ "$1" -ge 1 ]; then - if [ x$(systemctl is-enabled ovn-northd.service 2>/dev/null ||:) = "xenabled" ]; then - touch %{rpmstate}ovn-northd - fi -fi - -%pre -n ovn-host -%if 0%{?suse_version} -%service_add_pre ovn-controller.service -%endif -# Save the "enabled" state across the transition of -# ownership of ovn-controller.service from openvswitch-ovn-host to -# ovn-host. -if [ "$1" -ge 1 ]; then - if [ x$(systemctl is-enabled ovn-controller.service 2>/dev/null ||:) = "xenabled" ]; then - touch %{rpmstate}ovn-controller - fi -fi - -%pre -n ovn-vtep -%if 0%{?suse_version} -%service_add_pre ovn-controller-vtep.service -%endif -# Save the "enabled" state across the transition of -# ownership of ovn-controller-vtep.service from openvswitch-ovn-vtep to -# ovn-vtep. -if [ "$1" -ge 1 ]; then - if [ x$(systemctl is-enabled ovn-controller-vtep.service 2>/dev/null ||:) = "xenabled" ]; then - touch %{rpmstate}ovn-controller-vtep - fi -fi - -%preun -n ovn-central -%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 -n ovn-host -%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 -n ovn-vtep -%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 - -%post -n ovn -if [ $1 -eq 1 ]; then - # Follow the upstream strategy that no running openvswitch - # configuration is changed on upgrade so use fillup only for new installs. - %{?suse_version: %fillup_only -n ovn} -fi - -%post -n 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 -n 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 -n 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 - -%post -n %{ovn_lname} -p /sbin/ldconfig - -%postun -n ovn-central -%if 0%{?suse_version} - %service_del_postun_without_restart 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 - -%postun -n ovn-host -%if 0%{?suse_version} - %service_del_postun_without_restart 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 -n ovn-vtep -%if 0%{?suse_version} - %service_del_postun_without_restart 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 - -%postun -n %{ovn_lname} -p /sbin/ldconfig - -%posttrans -n ovn-central -# Save the "enabled" state across the transition of -# ownership of ovn-northd.service from openvswitch-ovn-central to -# ovn-central. -if [ -e %{rpmstate}ovn-northd ]; then - rm %{rpmstate}ovn-northd - systemctl enable ovn-northd.service -fi - -%posttrans -n ovn-host -# Save the "enabled" state across the transition of -# ownership of ovn-northd.service from openvswitch-ovn-central to -# ovn-central. -if [ -e %{rpmstate}ovn-controller ]; then - rm %{rpmstate}ovn-controller - systemctl enable ovn-controller.service -fi - -%posttrans -n ovn-vtep -# Save the "enabled" state across the transition of -# ownership of ovn-controller.service from openvswitch-ovn-host to -# ovn-host. -if [ -e %{rpmstate}ovn-controller-vtep ]; then - rm %{rpmstate}ovn-controller-vtep - systemctl enable ovn-controller-vtep.service -fi - %files %defattr(-,root,openvswitch, 775) %dir %{_sysconfdir}/openvswitch @@ -1083,7 +531,6 @@ fi # This is no longer the DB path for new installs but we still need this for # upgrades that preserve the old DB path. %ghost %{_sysconfdir}/openvswitch/.conf.db.~lock~ -%defattr(-,root,root) %config(noreplace) %{_sysconfdir}/openvswitch/default.conf %{_bindir}/ovs-appctl %{_bindir}/ovs-docker @@ -1136,22 +583,14 @@ fi %{_unitdir}/ovs-vswitchd.service %{_unitdir}/ovsdb-server.service %{_unitdir}/ovs-delete-transient-ports.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 %ghost %attr(755,root,root) %{_rundir}/openvswitch %ghost %attr(644,root,root) %{_rundir}/openvswitch.useropts %exclude %{_docdir}/%{name} -%doc %ovs_dir/AUTHORS.rst %ovs_dir/CONTRIBUTING.rst %ovs_dir/NEWS %ovs_dir/README.rst -%license %ovs_dir/LICENSE %ovs_dir/NOTICE +%doc AUTHORS.rst CONTRIBUTING.rst NEWS README.rst +%license LICENSE NOTICE %files doc %exclude %{_docdir}/%{name}/AUTHORS.rst @@ -1160,7 +599,7 @@ fi %exclude %{_docdir}/%{name}/README.rst %{_docdir}/%{name}/ -%files -n %{ovs_lname} +%files -n %{lname} %{_libdir}/libofproto-2*.so.* %{_libdir}/libopenvswitch-2*.so.* %{_libdir}/libovsdb-2*.so.* @@ -1183,10 +622,6 @@ fi %{_sbindir}/rcopenvswitch-ipsec %{_unitdir}/openvswitch-ipsec.service -%files -n python3-ovs -%{python3_sitearch}/ovs/ -%{python3_sitearch}/ovs-*.egg-info - %files test %{_bindir}/ovs-l3ping %{_bindir}/ovs-pcap @@ -1213,98 +648,16 @@ fi %{_includedir}/openflow/ %{_includedir}/openvswitch/ %{_libdir}/pkgconfig/*.pc +# Devel tools required for OVN +%{_bindir}/ovsdb-idlc +%{_mandir}/man1/ovsdb-idlc.1%{?ext_man} +%dir %{_datadir}/openvswitch/ovsdb +%{_datadir}/openvswitch/ovsdb/ovsdb-doc +%{_datadir}/openvswitch/ovsdb/ovsdb-dot -%files -n ovn -%defattr(-,openvswitch,openvswitch) -%dir %{_localstatedir}/log/ovn -%defattr(-,root,root) -%if 0%{?suse_version} -%{_fillupdir}/sysconfig.ovn -%else -%config(noreplace) %{_sysconfdir}/sysconfig/ovn -%endif -%{_bindir}/ovn-nbctl -%{_bindir}/ovn-sbctl -%{_bindir}/ovn-trace -%{_bindir}/ovn-detrace -%{_bindir}/ovn-appctl -%{_bindir}/ovn-ic-nbctl -%{_bindir}/ovn-ic-sbctl -%dir %{_datadir}/ovn -%dir %{_datadir}/ovn/scripts -%{_datadir}/ovn/scripts/ovn-ctl -%{_datadir}/ovn/scripts/ovn-lib -%{_datadir}/ovn/scripts/ovndb-servers.ocf -%{_datadir}/ovn/scripts/ovn-bugtool-nbctl-show -%{_datadir}/ovn/scripts/ovn-bugtool-sbctl-lflow-list -%{_datadir}/ovn/scripts/ovn-bugtool-sbctl-show -%{_mandir}/man5/ovn-nb.5%{?ext_man} -%{_mandir}/man5/ovn-sb.5%{?ext_man} -%{_mandir}/man8/ovn-ic-nbctl.8%{?ext_man} -%{_mandir}/man8/ovn-ic-sbctl.8%{?ext_man} -%{_mandir}/man8/ovn-ic.8%{?ext_man} -%{_mandir}/man5/ovn-ic-nb.5%{?ext_man} -%{_mandir}/man5/ovn-ic-sb.5%{?ext_man} -%{_mandir}/man1/ovn-detrace.1%{?ext_man} -%{_mandir}/man8/ovn-appctl.8%{?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} -%config(noreplace) %{_sysconfdir}/logrotate.d/ovn -%doc %ovn_dir/AUTHORS.rst %ovn_dir/CONTRIBUTING.rst %ovn_dir/NEWS %ovn_dir/README.rst -%license %ovn_dir/LICENSE %ovn_dir/NOTICE - -%files -n ovn-docker -%{_bindir}/ovn-docker-overlay-driver -%{_bindir}/ovn-docker-underlay-driver - -%files -n 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 -%{_bindir}/ovn-ic -%{_mandir}/man8/ovn-northd.8%{?ext_man} -%{_datadir}/ovn/ovn-nb.ovsschema -%{_datadir}/ovn/ovn-sb.ovsschema -%{_datadir}/ovn/ovn-ic-nb.ovsschema -%{_datadir}/ovn/ovn-ic-sb.ovsschema -%{_unitdir}/ovn-northd.service -%{_sbindir}/rcovn-northd -%{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml - -%files -n 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 -n ovn-vtep -%{_bindir}/ovn-controller-vtep -%{_mandir}/man8/ovn-controller-vtep.8%{?ext_man} -%{_unitdir}/ovn-controller-vtep.service -%{_sbindir}/rcovn-controller-vtep - -%files -n ovn-doc -%exclude %{_docdir}/ovn/AUTHORS.rst -%exclude %{_docdir}/ovn/CONTRIBUTING.rst -%exclude %{_docdir}/ovn/NEWS -%exclude %{_docdir}/ovn/README.rst -%{_docdir}/ovn/ - -%files -n %{ovn_lname} -%{_libdir}/libovn-*.so.* - -%files -n ovn-devel -%{_libdir}/libovn.so -%{_includedir}/ovn/ +%files %{python_files ovs} +%license LICENSE NOTICE +%{python_sitearch}/ovs +%{python_sitearch}/ovs-%{version}* %changelog diff --git a/ovn-20.06.2.tar.gz b/ovn-20.06.2.tar.gz deleted file mode 100644 index cc59a4e..0000000 --- a/ovn-20.06.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fe15215392fc110af3e5203c808ca2c1396864e14f986957b1846ddd60eafffd -size 1114006 From d8bcd28d64d8cc60a586d225032ebf004839bbe4dc8f65d060cb1e7d29c40ce5 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 7 Mar 2022 12:05:07 +0000 Subject: [PATCH 2/2] - fix python3 requires (bsc#1196758) OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=218 --- openvswitch.changes | 5 +++++ openvswitch.spec | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openvswitch.changes b/openvswitch.changes index deb395a..ad4af05 100644 --- a/openvswitch.changes +++ b/openvswitch.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Mar 7 12:04:30 UTC 2022 - Dirk Müller + +- fix python3 requires (bsc#1196758) + ------------------------------------------------------------------- Sun Feb 27 19:24:57 UTC 2022 - Ferdinand Thiessen diff --git a/openvswitch.spec b/openvswitch.spec index 3077524..a7b7a53 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -191,7 +191,7 @@ Group: Productivity/Networking/System Requires: %{name} = %{version} Requires: %{name}-switch = %{version} # Since openvswitch/scripts/ovs-vtep requires various ovs python modules. -Requires: python3-openvswitch = %{version} +Requires: python3-ovs = %{version} Provides: %{name}-dpdk-vtep = %{version} Obsoletes: %{name}-dpdk-vtep < 2.7.0 @@ -206,7 +206,7 @@ Summary: Open vSwitch IPsec tunneling support License: Apache-2.0 Group: Productivity/Networking/System Requires: %{name} = %{version} -Requires: python3-openvswitch = %{version} +Requires: python3-ovs = %{version} Requires: strongswan %description ipsec