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