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