From 2af2b96f33fdb4fc06b4506b70d18d54f2502e4e Mon Sep 17 00:00:00 2001 From: tigro Date: Sun, 30 Jul 2023 23:29:38 +0200 Subject: [PATCH] Create separate packages for Server and ARM --- SPECS/sphere-release.spec | 135 ++++++++++++++++++++++++++++++++++---- 1 file changed, 122 insertions(+), 13 deletions(-) diff --git a/SPECS/sphere-release.spec b/SPECS/sphere-release.spec index a5f7ff4..bfc9d76 100644 --- a/SPECS/sphere-release.spec +++ b/SPECS/sphere-release.spec @@ -1,11 +1,12 @@ %global distro MSVSphere -%global release_name Inferit +# define MSVSphere products +%global release_name Server ARM %global major 9 %global minor 2 Name: sphere-release Version: %{major}.%{minor} -Release: 1.3%{?dist} +Release: 1.4%{?dist} Summary: %{distro} release files License: GPLv2 URL: https://msvsphere.ru @@ -28,6 +29,7 @@ Provides: system-release(releasever) = %{major} # required by libdnf # https://github.com/rpm-software-management/libdnf/blob/0.48.0/libdnf/module/ModulePackage.cpp#L472 Provides: base-module(platform:el%{major}) +Requires: sphere-release-common = %{version}-%{release} Source100: RPM-GPG-KEY-MSVSphere-9 @@ -64,6 +66,91 @@ Source508: msvsphere-resilientstorage.repo %{distro} release files. +%package common +Summary: MSVSphere release files + + +Requires: sphere-release-variant = %{version}-%{release} +Suggests: sphere-release + +Requires: sphere-repos(%{version}) +Requires: sphere-release-identity = %{version}-%{release} + +%description common +Release files common to all Editions and Spins of MSVSphere + + +%package server +Summary: Base package for MSVSphere Server-specific default configurations + +RemovePathPostfixes: .Server +Provides: sphere-release = %{version}-%{release} +Provides: sphere-release-variant = %{version}-%{release} +Provides: system-release +Provides: system-release(%{version}) +Provides: base-module(platform:f%{version}) +Requires: sphere-release-common = %{version}-%{release} + +# sphere-release-common Requires: sphere-release-identity, so at least one +# package must provide it. This Recommends: pulls in +# sphere-release-identity-server if nothing else is already doing so. +Recommends: sphere-release-identity-server + + +%description server +Provides a base package for MSVSphere Server-specific configuration files to +depend on. + + +%package identity-server +Summary: Package providing the identity for MSVSphere Server Edition + +RemovePathPostfixes: .Server +Provides: sphere-release-identity = %{version}-%{release} +Conflicts: sphere-release-identity +Requires(meta): sphere-release-server = %{version}-%{release} + + +%description identity-server +Provides the necessary files for a MSVSphere installation that is identifying +itself as MSVSphere Server Edition. + +%package arm +Summary: Base package for MSVSphere ARM-specific default configurations + +RemovePathPostfixes: .ARM +Provides: sphere-release = %{version}-%{release} +Provides: sphere-release-variant = %{version}-%{release} +Provides: system-release +Provides: system-release(%{version}) +Provides: base-module(platform:f%{version}) +Requires: sphere-release-common = %{version}-%{release} +Provides: system-release-product + +# sphere-release-common Requires: sphere-release-identity, so at least one +# package must provide it. This Recommends: pulls in +# sphere-release-identity-workstation if nothing else is already doing so. +Recommends: sphere-release-identity-arm + + +%description arm +Provides a base package for MSVSphere ARM-specific configuration files to +depend on. + + +%package identity-arm +Summary: Package providing the identity for MSVSPhere ARM Edition + +RemovePathPostfixes: .ARM +Provides: sphere-release-identity = %{version}-%{release} +Conflicts: sphere-release-identity +Requires(meta): sphere-release-arm = %{version}-%{release} + + +%description identity-arm +Provides the necessary files for a MSVSphere installation that is identifying +itself as MSVSphere ARM Edition. + %package -n sphere-sb-certs Summary: %{distro} public secureboot certificates Group: System Environment/Base @@ -78,6 +165,7 @@ Provides: redhat-sb-certs = %{version}-%{release} Summary: %{distro} package repositories Requires: sphere-release = %{version}-%{release} Requires: sphere-gpg-keys = %{version}-%{release} +Provides: sphere-repos(%{version}) %description -n sphere-repos This package provides the package repository files for %{distro}. @@ -104,22 +192,20 @@ This package provides the RPM signature keys for %{distro}. mkdir -p ./docs cp %{SOURCE200} ./docs -# create /etc/sphere-release, /etc/system-release and /etc/redhat-release files -install -d -m 0755 %{buildroot}%{_sysconfdir} -echo "%{distro} release %{major}.%{minor}%{?beta: %{beta}} (%{release_name})" > %{buildroot}%{_sysconfdir}/sphere-release -ln -s sphere-release %{buildroot}%{_sysconfdir}/system-release -ln -s sphere-release %{buildroot}%{_sysconfdir}/redhat-release - # generate /usr/lib/os-release file install -d -m 0755 %{buildroot}%{_prefix}/lib -cat > %{buildroot}%{_prefix}/lib/os-release << EOF + +for variant in %{release_name}; do +echo "%{distro} release %{major}.%{minor}%{?beta: %{beta}} (${variant})" > %{buildroot}%{_prefix}/lib/sphere-release.$variant + +cat > %{buildroot}%{_prefix}/lib/os-release.$variant << EOF NAME="%{distro}" -VERSION="%{major}.%{minor}%{?beta: %{beta}} (%{release_name})" +VERSION="%{major}.%{minor}%{?beta: %{beta}} (${variant})" ID="msvsphere" ID_LIKE="rhel centos fedora" VERSION_ID="%{major}.%{minor}" PLATFORM_ID="platform:el%{major}" -PRETTY_NAME="%{distro} %{major}.%{minor}%{?beta: %{beta}} (%{release_name})" +PRETTY_NAME="%{distro} %{major}.%{minor}%{?beta: %{beta}} (${variant})" ANSI_COLOR="0;34" LOGO="fedora-logo-icon" CPE_NAME="cpe:/o:ncsd:msvsphere:%{major}::baseos" @@ -131,10 +217,18 @@ MSVSPHERE_MANTISBT_PROJECT_VERSION="%{major}.%{minor}" REDHAT_SUPPORT_PRODUCT="%{distro}" REDHAT_SUPPORT_PRODUCT_VERSION="%{major}.%{minor}%{?beta: %{beta}}" EOF +done +install -d -m 0755 %{buildroot}%{_sysconfdir} # create symlink for /etc/os-release ln -s ../usr/lib/os-release %{buildroot}%{_sysconfdir}/os-release +# create symlink for /etc/system-release +ln -s ../usr/lib/sphere-release %{buildroot}%{_sysconfdir}/sphere-release +# create /etc/sphere-release, /etc/system-release and /etc/redhat-release files +ln -s sphere-release %{buildroot}%{_sysconfdir}/system-release +ln -s sphere-release %{buildroot}%{_sysconfdir}/redhat-release + # generate /etc/system-release-cpe echo "cpe:/o:ncsd:msvsphere:%{major}::baseos" > %{buildroot}%{_sysconfdir}/system-release-cpe @@ -220,15 +314,15 @@ install -p -m 0644 %{SOURCE508} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/rpm-gpg install -p -m 0644 %{SOURCE100} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ - %files + +%files common %license docs/LICENSE %{_sysconfdir}/sphere-release %{_sysconfdir}/redhat-release %{_sysconfdir}/system-release %config %{_sysconfdir}/system-release-cpe %config(noreplace) %{_sysconfdir}/os-release -%{_prefix}/lib/os-release %config(noreplace) %{_sysconfdir}/issue %config(noreplace) %{_sysconfdir}/issue.net %dir %{_sysconfdir}/issue.d @@ -239,6 +333,18 @@ install -p -m 0644 %{SOURCE100} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ %{_prefix}/lib/systemd/user-preset/* %{_prefix}/lib/sysctl.d/50-redhat.conf + +%files server +%files identity-server +%{_prefix}/lib/os-release.Server +%{_prefix}/lib/sphere-release.Server + + +%files arm +%files identity-arm +%{_prefix}/lib/os-release.ARM +%{_prefix}/lib/sphere-release.ARM + %files -n sphere-sb-certs # Note to future packagers: # resetting the symlinks in /etc/pki/sb-certs on upgrade is the intended behavior here @@ -266,6 +372,9 @@ install -p -m 0644 %{SOURCE100} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ %changelog +* Sun Jul 30 2023 Arkady L. Shane - 9.2-1.4 +- Create separate packages for Server and ARM + * Mon Jul 17 2023 Arkady L. Shane - 9.2-1.3 - Disable optional repos