rocky-release/SPECS/rocky-release.spec
2021-04-25 10:24:34 -07:00

250 lines
7.7 KiB
RPMSpec

%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 9
%define upstream_rel %{major}.%{minor}
%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 = %{version}-%{release}
Provides: system-release = %{version}-%{release}
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
Source203: COMMUNITY-CHARTER
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
# Remove once testing is done
Source4000: Rocky-issue
%description
%{distro} release files.
%package -n rocky-repos
Summary: %{distro} Package Repositories
License: GPLv2
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
%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} %{SOURCE203} .
# 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/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_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
#cp %{buildroot}%{_sysconfdir}/issue{,.net}
# Remove these once we are no longer testing
install -m 0644 %{SOURCE4000} %{buildroot}%{_sysconfdir}/issue
install -m 0644 %{SOURCE4000} %{buildroot}%{_sysconfdir}/issue.net
# End
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
# Data directory
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/
# 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/
# dnf stuff
install -d -m 0755 %{buildroot}%{_sysconfdir}/dnf/vars
echo "stock" > %{buildroot}%{_sysconfdir}/dnf/vars/infra
echo "rocky" > %{buildroot}%{_sysconfdir}/dnf/vars/contentdir
# Copy out GPG keys
install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/rpm-gpg
install -p -m 0644 %{SOURCE101} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/
install -p -m 0644 %{SOURCE102} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/
# Copy our yum repos
install -d -m 0755 %{buildroot}%{_sysconfdir}/yum.repos.d
install -p -m 0644 %{SOURCE1200} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1201} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1202} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1203} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1210} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1211} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1220} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1222} %{buildroot}%{_sysconfdir}/yum.repos.d/
install -p -m 0644 %{SOURCE1223} %{buildroot}%{_sysconfdir}/yum.repos.d/
%files
%license LICENSE
%doc Contributors COMMUNITY-CHARTER
%{_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
* Sun Apr 25 2021 Louis Abel <label@rockylinux.org> - 8.3-9
- Remove and add os-release references
* Sun Apr 18 2021 Louis Abel <label@rockylinux.org> - 8.3-8
- Emphasize that this is not a production ready release
- rpmlint
* Wed Apr 14 2021 Louis Abel <label@rockylinux.org> - 8.3-7
- Fix mantis links
* Thu Apr 08 2021 Louis Abel <label@rockylinux.org> - 8.3-5
- Combine release, repos, and keys together to simplify
* Mon Feb 01 2021 Louis Abel <label@rockylinux.org> - 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