Blob Blame History Raw
Summary: Config to enable the repository for the NFV SIG
Name: centos-release-nfv
Version: 1
Release: 4%{?dist}
License: GPLv2
Group: System Environment/Base
URL: http://wiki.centos.org/SpecialInterestGroup/NFV
Source0: RPM-GPG-KEY-CentOS-SIG-NFV
Source1: CentOS-NFV-OpenvSwitch.repo
Source2: CentOS-NFV-extras.repo

BuildArch: noarch

%description
yum configs for repositories as delivered by CentOS NFV SIG.

%package common
Summary: Common package to contain NFV SIG

Requires: centos-release
Requires: /etc/os-release

%description common
Common files for repositories as delivered by CentOS NFV SIG.

%package openvswitch
Summary: Common release file to establish shared metadata for CentOS NFV SIG

Requires: %{name}-common = %{version}-%{release}

%description openvswitch
yum configs for repositories as delivered by CentOS NFV SIG.

%package extras
Summary: Release file to establish repo config for NFV network extras repo

Requires: %{name}-common = %{version}-%{release}

%description extras
yum configs for repositories as delivered by CentOS NFV SIG.

%prep
%setup -q -n %{name} -T -c

%install
# gpg key
install -p -d %{buildroot}%{_sysconfdir}/pki/rpm-gpg
install -m 644 %{SOURCE0} %{buildroot}%{_sysconfdir}/pki/rpm-gpg
# openvswitch repo
install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/yum.repos.d/CentOS-NFV-OpenvSwitch.repo
install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/yum.repos.d/CentOS-NFV-extras.repo

%post common
if [ -f /etc/os-release ]; then
    source /etc/os-release
fi
if [[ $ID == 'centos' && $NAME == *'Stream' ]]; then
    echo "8-stream" > /etc/dnf/vars/nfvsigdist
else
    echo "8" > /etc/dnf/vars/nfvsigdist
fi

%postun common
if [ $1 -eq 0 ] ; then
    rm -f /etc/dnf/vars/nfvsigdist
fi

%files common
%defattr(-,root,root)
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-NFV

%files openvswitch
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/yum.repos.d/CentOS-NFV-OpenvSwitch.repo

%files extras
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/yum.repos.d/CentOS-NFV-extras.repo

%changelog
* Mon Nov 08 2021 Neil Hanlon <neil@resf.org> - 1-4
- Fix logic for dnf vars to detect non-Stream installations

* Thu Apr 15 2021 Alfredo Moralejo <amoralej@redhat.com> - 1-3
- Use different repos for CentOS Linux 8 and CentOS Stream 8

* Wed Sep 30 2020 Alfredo Moralejo <amoralej@redhat.com> - 1-2
- Added centos-release-nfv-extras subpackage

* Thu Sep 10 2020 Yatin Karel <ykarel@redhat.com> - 1-1
- Initial release rpm NFV SIG