%define debug_package %{nil} # Product information %define product_family Rocky Linux %define variant_titlecase Server %define variant_lowercase server # Distribution Name and Version %define distro Rocky Linux %define major 8 %define minor 3 %define rocky_rel 5 %define upstream_rel %{major}.%{minor} %define upstream_rel_long %{upstream_rel}-1 %define base_release_version %{major} %define full_release_version %{major} %define dist_release_version %{major} %ifarch ppc64le %define tuned_profile :server %endif # Avoids a weird anaconda problem %global __requires_exclude_from %{_libexecdir} Name: rocky-release Version: %{major}.%{minor} Release: %{rocky_rel}%{?dist} Summary: %{distro} release files License: GPLv2 URL: https://rockylinux.org BuildArch: noarch # What do we provide? Provides: rocky-release = %{version}-%{release} Provides: rocky-release(upstream) = %{upstream_rel} Provides: redhat-release = %{upstream_rel_long} Provides: system-release = %{upstream_rel_long} Provides: system-release(releasever) = %{major} ## Required by libdnf Provides: base-module(platform:el%{major}) ## This makes lorax/pungi/anaconda happy Provides: rocky-release-eula Provides: redhat-release-eula # What are our requirements? Requires: rocky-repos(%{base_release_version}) # GPG Keys Source101: RPM-GPG-KEY-rockyofficial Source102: RPM-GPG-KEY-rockytesting # Release Sources Source200: EULA Source201: LICENSE Source202: Contributors Source300: 85-display-manager.preset Source301: 90-default.preset Source302: 99-default-disable.preset # Repo Sources Source1200: Rocky-BaseOS.repo Source1201: Rocky-AppStream.repo Source1202: Rocky-PowerTools.repo Source1203: Rocky-Extras.repo # Rocky Add-ons Source1210: Rocky-HighAvailability.repo Source1211: Rocky-ResilientStorage.repo # Rocky Special Stuff Source1220: Rocky-Media.repo #Source1221: Rocky-Debuginfo.repo Source1222: Rocky-Sources.repo Source1223: Rocky-Devel.repo #Source1224: Rocky-ContinuousRelease.repo #Source1225: Rocky-FastTrack.repo #Source1226: Rocky-Plus.repo %description %{distro} release files. %package -n rocky-repos Summary: %{distro} Package Repositories License: GPLv2 BuildArch: noarch Provides: rocky-repos(%{major}) = %{upstream_rel} Requires: system-release = %{upstream_rel} Requires: rocky-gpg-keys Conflicts: ${name} < 8.0 %description -n rocky-repos %{distro} package repository files for yum/dnf %package -n rocky-gpg-keys Summary: Rocky RPM GPG Keys Conflicts: %{name} < 8.0 BuildArch: noarch %description -n rocky-gpg-keys This package provides the RPM signature keys for Rocky. %prep echo Good. %build echo Good. %install # copy license and contributors doc here for %%license and %%doc macros cp %{SOURCE201} %{SOURCE202} . # create /etc/system-release and /etc/redhat-release install -d -m 0755 %{buildroot}%{_sysconfdir} echo "%{distro} release %{version}" > %{buildroot}%{_sysconfdir}/rocky-release echo "Derived from Red Hat Enterprise Linux %{version}" > %{buildroot}%{_sysconfdir}/rocky-release-upstream ln -s rocky-release %{buildroot}%{_sysconfdir}/system-release ln -s rocky-release %{buildroot}%{_sysconfdir}/redhat-release # Create the os-release file install -d -m 0755 %{buildroot}%{_prefix}/lib cat > %{buildroot}%{_prefix}/lib/os-release << EOF NAME="%{distro}" VERSION="%{major}" ID="rocky" ID_LIKE="rhel fedora" VERSION_ID="%{major}" PLATFORM_ID="platform:el%{major}" PRETTY_NAME="%{distro} %{major}" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:rocky:rocky:%{major}" HOME_URL="https://rockylinux.org/" BUG_REPORT_URL="https://bugs.rockylinux.org/" CENTOS_MANTISBT_PROJECT="Rocky-%{major}" CENTOS_MANTISBT_PROJECT_VERSION="%{major}" EOF # Create the symlink for /etc/os-release ln -s ../usr/lib/os-release %{buildroot}%{_sysconfdir}/os-release # write cpe to /etc/system/release-cpe echo "cpe:/o:rocky:rocky:%{major}" > %{buildroot}%{_sysconfdir}/system-release-cpe # create /etc/issue and /etc/issue.net #echo '\S' > %{buildroot}%{_sysconfdir}/issue #echo 'Kernel \r on an \m' >> %{buildroot}%{_sysconfdir}/issue cat << EOF > %{buildroot}%{_sysconfdir}/issue `.-/+++++++++/-.` `-+++++++++++++++++-` .+++++++++++++++++++++. -+++++++++++++++++++++++. +++++++++++++++/-/+++++++ +++++++++++++/. ./+++++ +++++++++++:. ./+++ +++++++++:` `:/:` .:/ -++++++:` .:+++++:` .+++-` ./+++++++++:` `-` ./+++++++++++- -+++++++++:-.` WARNING: THIS RELEASE IS NOT FOR PRODUCTION. YOU CANNOT AND SHOULD NOT UPDATE FROM THIS INSTALLATION. THIS INSTALLATION IS NOT SUPPORTED. PLEASE REPORT ALL PRE-PRODUCTION BUGS OR ISSUES TO OUR BUG TRACKER AT: https://bugs.rockylinux.org \S -- TEST RELEASE -- EVALUATION ONLY Kernel \r on an \m EOF cp %{buildroot}%{_sysconfdir}/issue{,.net} echo >> %{buildroot}%{_sysconfdir}/issue # set up the dist tag macros install -d -m 0755 %{buildroot}%{_sysconfdir}/rpm cat > %{buildroot}%{_sysconfdir}/rpm/macros.dist << EOF # dist macros. %%rocky_ver %{major} %%rocky %{major} %%centos %{major} %%rhel %{major} %%dist .el%{major} %%el%{major} 1 EOF # use unbranded datadir install -d -m 0755 %{buildroot}%{_datadir}/rocky-release ln -s rocky-release %{buildroot}%{_datadir}/redhat-release install -p -m 0644 %{SOURCE200} %{buildroot}%{_datadir}/rocky-release/ # copy systemd presets install -d -m 0755 %{buildroot}%{_prefix}/lib/systemd/system-preset/ install -m 0644 %{SOURCE300} %{buildroot}/%{_prefix}/lib/systemd/system-preset/ install -m 0644 %{SOURCE301} %{buildroot}/%{_prefix}/lib/systemd/system-preset/ install -m 0644 %{SOURCE302} %{buildroot}/%{_prefix}/lib/systemd/system-preset/ # repo stuff install -d -m 0755 %{buildroot}%{_sysconfdir}/dnf/vars echo "stock" > %{buildroot}%{_sysconfdir}/dnf/vars/infra echo "rocky" > %{buildroot}%{_sysconfdir}/dnf/vars/contentdir # copy GPG keys install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/rpm-gpg install -p -m 0644 %{_sourcedir}/RPM-GPG-KEY-* %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ # copy yum repos install -d -m 0755 %{buildroot}%{_sysconfdir}/yum.repos.d install -p -m 0644 %{_sourcedir}/*.repo %{buildroot}%{_sysconfdir}/yum.repos.d/ %files %license LICENSE %doc Contributors %{_sysconfdir}/redhat-release %{_sysconfdir}/system-release %{_sysconfdir}/rocky-release %{_sysconfdir}/rocky-release-upstream %config(noreplace) %{_sysconfdir}/os-release %config %{_sysconfdir}/system-release-cpe %config(noreplace) %{_sysconfdir}/issue %config(noreplace) %{_sysconfdir}/issue.net %{_sysconfdir}/rpm/macros.dist %{_datadir}/redhat-release %{_datadir}/rocky-release %{_prefix}/lib/os-release %{_prefix}/lib/systemd/system-preset/* %files -n rocky-repos %license LICENSE %config(noreplace) %{_sysconfdir}/yum.repos.d/Rocky-*.repo %config(noreplace) %{_sysconfdir}/dnf/vars/contentdir %config(noreplace) %{_sysconfdir}/dnf/vars/infra %files -n rocky-gpg-keys %{_sysconfdir}/pki/rpm-gpg/ %changelog * Thu Apr 08 2021 Louis Abel - 8.3-5 - Combine release, repos, and keys together to simplify * Mon Feb 01 2021 Louis Abel - 8.3-4 - Initial Rocky Release 8.3 based on CentOS 8.3 - Keep centos rpm macro to reduce package modification burden - Update /etc/issue