From 6b7226cc562d3983b34d0de9f5ff94e8c0d8554b Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Jun 09 2021 11:08:10 +0000 Subject: Add support for CentOS Stream 8 repos This patch makes that CentOS Stream 8 systems use repositories under 8-stream in Virt SIG instead of 8 ones. Signed-off-by: Sandro Bonazzola --- diff --git a/SOURCES/CentOS-Advanced-Virtualization.repo b/SOURCES/CentOS-Advanced-Virtualization.repo index e978c4f..719762e 100644 --- a/SOURCES/CentOS-Advanced-Virtualization.repo +++ b/SOURCES/CentOS-Advanced-Virtualization.repo @@ -5,8 +5,8 @@ [centos-advanced-virtualization] name=CentOS-$releasever - Advanced Virtualization -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=virt-advanced-virtualization -#baseurl=http://mirror.centos.org/$contentdir/$releasever/virt/$basearch/advanced-virtualization/ +mirrorlist=http://mirrorlist.centos.org/?release=$avstream&arch=$basearch&repo=virt-$avdir +#baseurl=http://mirror.centos.org/$contentdir/$avstream/virt/$basearch/$avdir/ gpgcheck=1 enabled=1 module_hotfixes=1 @@ -14,21 +14,21 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization [centos-advanced-virtualization-test] name=CentOS-$releasever - Advanced Virtualization Testing -baseurl=http://buildlogs.centos.org/centos/$releasever/virt/$basearch/advanced-virtualization/ +baseurl=http://buildlogs.centos.org/centos/$avstream/virt/$basearch/$avdir/ gpgcheck=0 enabled=0 module_hotfixes=1 [centos-advanced-virtualization-debuginfo] name=CentOS-$releasever - Advanced Virtualization Debug -baseurl=http://debuginfo.centos.org/centos/$releasever/virt/$basearch/ +baseurl=http://debuginfo.centos.org/centos/$avstream/virt/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization [centos-advanced-virtualization-source] name=CentOS-$releasever - Advanced Virtualization Source -baseurl=http://vault.centos.org/centos/$releasever/virt/Source/advanced-virtualization/ +baseurl=http://vault.centos.org/centos/$avstream/virt/Source/$avdir/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization diff --git a/SPECS/centos-release-advanced-virtualization.spec b/SPECS/centos-release-advanced-virtualization.spec index 3599a73..3d80450 100644 --- a/SPECS/centos-release-advanced-virtualization.spec +++ b/SPECS/centos-release-advanced-virtualization.spec @@ -1,7 +1,7 @@ Summary: Advanced Virtualization packages from the CentOS Virtualization SIG repository Name: centos-release-advanced-virtualization Version: 1.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 URL: http://wiki.centos.org/SpecialInterestGroup/Virtualization Source0: CentOS-Advanced-Virtualization.repo @@ -11,6 +11,7 @@ BuildArch: noarch Requires: centos-release-virt-common Requires: centos-release +Requires(post): centos-release %description yum configuration and basic docs for Advanced Virtualization packages as delivered via the @@ -22,6 +23,22 @@ cp %{SOURCE1} . %install install -D -m 644 %{SOURCE0} %{buildroot}%{_sysconfdir}/yum.repos.d/CentOS-Advanced-Virtualization.repo +%post +source /etc/os-release +if [[ $ID == 'centos' && $NAME == *'Stream' ]] || [ $ID != 'centos' ]; then + echo "8-stream" > /etc/dnf/vars/avstream + echo "advancedvirt-common" > /etc/dnf/vars/avdir +else + echo "8" > /etc/dnf/vars/avstream + echo "advanced-virtualization" > /etc/dnf/vars/avdir +fi + +%postun +if [ $1 -eq 0 ] ; then + rm -f /etc/dnf/vars/avstream + rm -f /etc/dnf/vars/avdir +fi + %files %defattr(-,root,root) @@ -29,6 +46,9 @@ install -D -m 644 %{SOURCE0} %{buildroot}%{_sysconfdir}/yum.repos.d/CentOS-Advan %license COPYING %changelog +* Wed Jun 09 2021 Sandro Bonazzola - 1.0-3 +- Add support for CentOS Stream 8 repos + * Wed Sep 02 2020 Sandro Bonazzola - 1.0-2 - Set module_hotfixes=1 for advanced virtualization repos