rdobuilder c02fb5
# Current version of OVS that this package requires
rdobuilder c02fb5
%define ovs_version 2.17
rdobuilder c02fb5
rdobuilder c02fb5
# Comma-separated (no spaces) e.g. 2.10,2.9 ... of prior fast-datapath
rdobuilder c02fb5
# openvswitch and ovn packages we need to obsolete
rdobuilder c02fb5
%define obsolete_ovs_versions 2.10,2.11,2.12,2.13,2.15
rdobuilder c02fb5
rdobuilder c02fb5
# Same as above, but enable ovs/ovn to be separate
rdobuilder 526e32
%define ovn_version 22.09
rdobuilder 526e32
%define obsolete_ovn_versions 2.10,2.11,2.12,2.13,-2021,22.03,22.06
rdobuilder c02fb5
rdobuilder c02fb5
# Lua macro to create a bunch of Obsoletes by splitting up the above
rdobuilder c02fb5
# definition and substituting where there's an asterisk
rdobuilder c02fb5
%{lua:
rdobuilder c02fb5
function rdo_obsoletes(package, ver, obsoletes)
rdobuilder c02fb5
  local s
rdobuilder c02fb5
  local pkg
rdobuilder c02fb5
  pkg = string.gsub(package, "*", "")
rdobuilder c02fb5
  print("Obsoletes: "..pkg.." < "..ver.."\n")
rdobuilder c02fb5
  for s in string.gmatch(obsoletes, "[^,]+") do
rdobuilder c02fb5
    pkg = string.gsub(package, "*", s)
rdobuilder c02fb5
    print("Obsoletes: "..pkg.." < "..ver.."\n")
rdobuilder c02fb5
  end
rdobuilder c02fb5
end
rdobuilder c02fb5
rdobuilder c02fb5
function ovs_obsoletes(package)
rdobuilder c02fb5
  rdo_obsoletes(package, rpm.expand("%ovs_version"), rpm.expand("%obsolete_ovs_versions"))
rdobuilder c02fb5
end
rdobuilder c02fb5
rdobuilder c02fb5
function ovn_obsoletes(package)
rdobuilder c02fb5
  rdo_obsoletes(package, rpm.expand("%ovn_version"), rpm.expand("%obsolete_ovn_versions"))
rdobuilder c02fb5
end}
rdobuilder c02fb5
rdobuilder c02fb5
######## OPENVSWITCH PACKAGING ########
rdobuilder c02fb5
rdobuilder c02fb5
Name:           rdo-openvswitch
rdobuilder c02fb5
Epoch:          2
rdobuilder c02fb5
Version:        %{ovs_version}
rdobuilder 526e32
Release:        4%{?dist}
rdobuilder c02fb5
Summary:        Wrapper rpm to allow installing OVS with new versioning schemes
rdobuilder c02fb5
rdobuilder c02fb5
Group:          System Environment/Daemons
rdobuilder c02fb5
License:        Public domain
rdobuilder c02fb5
URL:            http://www.openvswitch.org
rdobuilder c02fb5
BuildArch:      noarch
rdobuilder c02fb5
rdobuilder c02fb5
Requires:       openvswitch%{ovs_version}
rdobuilder c02fb5
Requires:       network-scripts-openvswitch%{ovs_version}
rdobuilder c02fb5
Provides:       openvswitch = %{?epoch:%{epoch}:}%{ovs_version}
rdobuilder c02fb5
Provides:       rdo-openvswitch = %{?epoch:%{epoch}:}%{ovs_version}
rdobuilder c02fb5
Provides:       rhosp-openvswitch = %{?epoch:%{epoch}:}%{ovs_version}
rdobuilder c02fb5
%{lua:ovs_obsoletes("openvswitch*")}
rdobuilder c02fb5
%{lua:ovs_obsoletes("network-scripts-openvswitch*")}
rdobuilder c02fb5
rdobuilder c02fb5
%description
rdobuilder c02fb5
Wrapper rpm for the base openvswitch package
rdobuilder c02fb5
rdobuilder c02fb5
%package -n python3-rdo-openvswitch
rdobuilder c02fb5
Summary:    wrapper for python-openvswitch rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Requires:   python3-openvswitch%{ovs_version}
rdobuilder c02fb5
Provides:   python3-openvswitch = %{?epoch:%{epoch}:}%{ovs_version}
rdobuilder c02fb5
%{lua:ovs_obsoletes("python3-openvswitch*")}
rdobuilder c02fb5
%{lua:ovs_obsoletes("python2-openvswitch*")}
rdobuilder c02fb5
%{lua:ovs_obsoletes("python-openvswitch*")}
rdobuilder c02fb5
rdobuilder c02fb5
%description -n python3-rdo-openvswitch
rdobuilder c02fb5
Wrapper rpm for the base python3-openvswitch package
rdobuilder c02fb5
rdobuilder c02fb5
%package devel
rdobuilder c02fb5
Summary:    wrapper for openvswitch-devel rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Requires:   openvswitch%{ovs_version}-devel
rdobuilder c02fb5
Provides:   openvswitch-devel = %{?epoch:%{epoch}:}%{ovs_version}
rdobuilder c02fb5
%{lua:ovs_obsoletes("openvswitch*-devel")}
rdobuilder c02fb5
rdobuilder c02fb5
%description devel
rdobuilder c02fb5
Wrapper rpm for the base openvswitch-devel package
rdobuilder c02fb5
rdobuilder c02fb5
%package test
rdobuilder c02fb5
Summary:    wrapper for openvswitch-test rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   python3-rdo-openvswitch = %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Requires:   openvswitch%{ovs_version}-test
rdobuilder c02fb5
Provides:   openvswitch-test = %{?epoch:%{epoch}:}%{ovs_version}
rdobuilder c02fb5
%{lua:ovs_obsoletes("openvswitch*-test")}
rdobuilder c02fb5
rdobuilder c02fb5
%description test
rdobuilder c02fb5
Wrapper rpm for the base openvswitch-test package
rdobuilder c02fb5
rdobuilder c02fb5
%package -n rdo-network-scripts-openvswitch
rdobuilder c02fb5
Summary:    wrapper for network-scripts-openvswitch rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   network-scripts-openvswitch%{ovs_version}
rdobuilder c02fb5
Provides:   network-scripts-openvswitch = %{?epoch:%{epoch}:}%{ovs_version}
rdobuilder c02fb5
%{lua:ovs_obsoletes("network-scripts-openvswitch*")}
rdobuilder c02fb5
rdobuilder c02fb5
%description -n rdo-network-scripts-openvswitch
rdobuilder c02fb5
Wrapper rpm for the base network-scripts-openvswitch package
rdobuilder c02fb5
rdobuilder c02fb5
rdobuilder c02fb5
######## OVN PACKAGING ########
rdobuilder c02fb5
rdobuilder c02fb5
%package -n rdo-ovn
rdobuilder c02fb5
Version:    %{ovn_version}
rdobuilder c02fb5
Summary:    wrapper for ovn rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   openvswitch
rdobuilder c02fb5
Requires:   ovn%{ovn_version}
rdobuilder c02fb5
Provides:   ovn = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   openvswitch-ovn-common = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   %{name}-ovn-common = %{?epoch:%{epoch}:}%{version}
rdobuilder c02fb5
Obsoletes:  %{name}-ovn-common < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Provides:   rdo-ovn-common = %{?epoch:%{epoch}:}%{version}
rdobuilder c02fb5
Obsoletes:  rdo-ovn-common < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Obsoletes:  ovn < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
# OVN packaging should do this, but doesn't?
rdobuilder c02fb5
# Obsoletes: openvswitch-ovn-common < ...
rdobuilder c02fb5
%{lua:ovn_obsoletes("ovn*")}
rdobuilder c02fb5
rdobuilder c02fb5
%description -n rdo-ovn
rdobuilder c02fb5
Wrapper rpm for the base ovn package
rdobuilder c02fb5
rdobuilder c02fb5
%package -n rdo-ovn-central
rdobuilder c02fb5
Version:    %{ovn_version}
rdobuilder c02fb5
Summary:    wrapper for openvswitch-ovn-central rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   rdo-ovn = %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Requires:   ovn%{ovn_version}-central
rdobuilder c02fb5
Provides:   openvswitch-ovn-central = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  openvswitch-ovn-central < %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   ovn-central = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  ovn-central < %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   %{name}-ovn-central = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  %{name}-ovn-central < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Obsoletes:  ovn-central < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
# OVN packaging should do this, but doesn't?
rdobuilder c02fb5
%{lua:ovn_obsoletes("openvswitch*-ovn-central")}
rdobuilder c02fb5
%{lua:ovn_obsoletes("ovn*-central")}
rdobuilder c02fb5
rdobuilder c02fb5
%description -n rdo-ovn-central
rdobuilder c02fb5
Wrapper rpm for the base openvswitch-ovn-central package
rdobuilder c02fb5
rdobuilder c02fb5
%package -n rdo-ovn-host
rdobuilder c02fb5
Version:    %{ovn_version}
rdobuilder c02fb5
Summary:    wrapper for openvswitch-ovn-host rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   rdo-ovn = %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Requires:   ovn%{ovn_version}-host
rdobuilder c02fb5
Provides:   openvswitch-ovn-host = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  openvswitch-ovn-host < %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   ovn-host = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  ovn-host < %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   %{name}-ovn-host = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  %{name}-ovn-host < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Obsoletes:  ovn-host < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
%{lua:ovn_obsoletes("openvswitch*-ovn-host")}
rdobuilder c02fb5
%{lua:ovn_obsoletes("ovn*-host")}
rdobuilder c02fb5
rdobuilder c02fb5
%description -n rdo-ovn-host
rdobuilder c02fb5
Wrapper rpm for the base openvswitch-ovn-host package
rdobuilder c02fb5
rdobuilder c02fb5
%package -n rdo-ovn-vtep
rdobuilder c02fb5
Version:    %{ovn_version}
rdobuilder c02fb5
Summary:    wrapper for openvswitch-ovn-vtep rpm
rdobuilder c02fb5
License:    Public domain
rdobuilder c02fb5
Requires:   rdo-ovn = %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Requires:   ovn%{ovn_version}-vtep
rdobuilder c02fb5
Provides:   openvswitch-ovn-vtep = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  openvswitch-ovn-vtep < %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   ovn-vtep = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  ovn-vtep < %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Provides:   %{name}-ovn-vtep = %{?epoch:%{epoch}:}%{ovn_version}
rdobuilder c02fb5
Obsoletes:  %{name}-ovn-vtep < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
Obsoletes:  ovn-vtep < %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder c02fb5
%{lua:ovn_obsoletes("openvswitch*-ovn-vtep")}
rdobuilder c02fb5
%{lua:ovn_obsoletes("ovn*-vtep")}
rdobuilder c02fb5
rdobuilder c02fb5
%description -n rdo-ovn-vtep
rdobuilder c02fb5
Wrapper rpm for the base ovn-vtep package
rdobuilder c02fb5
rdobuilder c02fb5
%setup -q
rdobuilder c02fb5
rdobuilder c02fb5
%build
rdobuilder c02fb5
rdobuilder c02fb5
%files -n rdo-openvswitch
rdobuilder c02fb5
%files -n python3-rdo-openvswitch
rdobuilder c02fb5
%files devel
rdobuilder c02fb5
%files test
rdobuilder c02fb5
%files -n rdo-network-scripts-openvswitch
rdobuilder c02fb5
%files -n rdo-ovn
rdobuilder c02fb5
%files -n rdo-ovn-central
rdobuilder c02fb5
%files -n rdo-ovn-host
rdobuilder c02fb5
%files -n rdo-ovn-vtep
rdobuilder c02fb5
rdobuilder c02fb5
%changelog
rdobuilder 526e32
* Fri Nov 25 2022 Alfredo Moralejo <amoralej@redhat.com> - 2.17.4
rdobuilder 526e32
- Update to ovn22.09
rdobuilder 526e32
rdobuilder c02fb5
* Wed Sep 14 2022 Alfredo Moralejo <amoralej@redhat.com> - 2.17-3
rdobuilder c02fb5
- Obsolete network-scripts-openvswitch lower than 2.17
rdobuilder c02fb5
rdobuilder c02fb5
* Tue Jul 19 2022 Alfredo Moralejo <amoralej@redhat.com> - 2.17-2
rdobuilder c02fb5
- Update to ovn22.06
rdobuilder c02fb5
rdobuilder c02fb5
* Fri Jun 24 2022 Alfredo Moralejo <amoralej@redhat.com> - 2.17-1
rdobuilder c02fb5
- Update to openvswitch2.17 and ovn22.03
rdobuilder c02fb5
rdobuilder c02fb5
* Fri Oct 01 2021 Alfredo Moralejo <amoralej@redhat.com> - 2.15-2
rdobuilder c02fb5
- Re-add network-scripts-openvswitch2.15 as dependency for rdo-openvswitch.
rdobuilder c02fb5
rdobuilder c02fb5
* Tue May 25 2021 Yatin Karel <ykarel@redhat.com> - 2.15-1
rdobuilder c02fb5
- Update to ovs 2.15 and ovn 2021
rdobuilder c02fb5
rdobuilder c02fb5
* Fri Oct 09 2020 Alfredo Moralejo <amoralej@redhat.xom> - 2.13-2
rdobuilder c02fb5
- Adds wrapper subpackage for network-scripts-openvswitch
rdobuilder c02fb5
rdobuilder c02fb5
* Mon Sep 14 2020 Yatin Karel <ykarel@redhat.com> - 2.13-1
rdobuilder c02fb5
- RDO Wrapper for OVS/OVN 2.13 builds from Fast DataPath
rdobuilder c02fb5