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