# # ovirt-release -- repo files for oVirt projects # Copyright (C) 2014-2023 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # SPDX-License-Identifier: LGPL-2.1-or-later %global package_version 4.5.6_master %global package_name ovirt-release-master %global package_short_version 4.5.6 %global ovirt_version master Name: %{package_name} Version: 4.5.6 Release: 0.0.master.20240220072858.git443caad%{?dist} Summary: The oVirt repository configuration License: ASL 2.0 URL: https://www.ovirt.org # Source is taken from https://github.com/oVirt/ovirt-release.git # master branch has no releases, it's built within automation for testing purposes only. Source0: %{package_name}-%{package_version}.tar.gz BuildArch: noarch BuildRequires: automake BuildRequires: autoconf Requires: system-release Requires: tar Requires: python3 Requires(post): python3-dnf-plugins-core %description This package contains the yum configuration for oVirt repositories %prep %setup -q -n "%{package_name}-%{package_version}" %build %configure make "%{?_smp_mflags}" %install rm -rf "%{buildroot}" %make_install #Allow ghost files install -d 755 "%{buildroot}%{_sysconfdir}/yum.repos.d" touch "%{buildroot}%{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-snapshot.repo" touch "%{buildroot}%{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-dependencies.repo" rm -f "%{buildroot}/usr/lib/systemd/system-preset/98-ovirt-host-node.preset" rm -rf "%{buildroot}/usr/share/ovirt-release-host-node" rm -f "%{buildroot}/usr/share/ovirt-release-master/node-optional.el8.repo" rm -f "%{buildroot}/usr/share/ovirt-release-master/node-optional.el9.repo" %post DISTVER="$(rpm --eval "%%dist"|cut -c2-)" ARCH="$(rpm --eval "%%_arch")" ID="$(source /etc/os-release && echo $ID)" if rpm --eval "%%dist" | grep -qFi 'el'; then DIST=el else echo "Unsupported distribution: ${DISTVER}" exit 1 fi if [[ "${DISTVER::3}" == "el8" ]] ; then if [ -f /etc/dnf/vars/stream ] ; then install -m 644 "%{_datadir}/%{package_name}/ovirt-el8-stream-${ARCH}-deps.repo" "%{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-dependencies.repo" else install -m 644 "%{_datadir}/%{package_name}/ovirt-el8-${ARCH}-deps.repo" "%{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-dependencies.repo" fi if [ -f /etc/yum.repos.d/CentOS-PowerTools.repo ] ; then sed -i "s:enabled=0:enabled=1:" /etc/yum.repos.d/CentOS-PowerTools.repo fi if [ -f /etc/yum.repos.d/CentOS-Linux-PowerTools.repo ] ; then sed -i "s:enabled=0:enabled=1:" /etc/yum.repos.d/CentOS-Linux-PowerTools.repo fi if [ -f /etc/yum.repos.d/CentOS-Stream-PowerTools.repo ] ; then sed -i "s:enabled=0:enabled=1:" /etc/yum.repos.d/CentOS-Stream-PowerTools.repo fi if [ -f /etc/yum.repos.d/almalinux-powertools.repo ] ; then dnf config-manager --set-enabled powertools fi if [ -f /etc/yum.repos.d/Rocky-PowerTools.repo ] ; then dnf config-manager --set-enabled powertools fi fi if [[ "${DISTVER::3}" == "el9" ]] ; then install -m 644 "%{_datadir}/%{package_name}/ovirt-el9-stream-${ARCH}-deps.repo" "%{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-dependencies.repo" if [ $(rpm --eval "%%centos") == 9 ] then # centos macro is defined on centos-like distributions # Ensuring crb repository is enabled dnf config-manager --set-enabled crb # Ensuring resilientstorage repository is enabled dnf config-manager --set-enabled resilientstorage fi fi install -m 644 "%{_datadir}/%{package_name}/ovirt-snapshot.repo" "%{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-snapshot.repo" %files %{_datadir}/%{package_name}/ovirt* # We do not know what distribution we are installed at, # we copy the actual files at post, but still wants this package to own them. # ghost in this case solves that issue %ghost %config(noreplace) %{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-dependencies.repo %ghost %config(noreplace) %{_sysconfdir}/yum.repos.d/ovirt-%{ovirt_version}-snapshot.repo %doc README.md %license LICENSE-2.0.txt %changelog * Wed Nov 29 2023 Sandro Bonazzola - 4.5.6 - Bumped version to 4.5.6 * Fri Jan 13 2023 Sandro Bonazzola - 4.5.5 - Bumped version to 4.5.5 * Mon Jun 27 2022 Sandro Bonazzola - 4.5.2 - Bumped version to 4.5.2 * Thu May 26 2022 Sandro Bonazzola - 4.5.1 - Bumped version to 4.5.1 * Tue Sep 07 2021 Sandro Bonazzola - 4.5.0-0.0.master - Bumped version to 4.5.0