Create separate packages for Server and ARM

i8-beta 9.2-1.4
Arkady L. Shane 1 year ago
parent b7621711de
commit 2af2b96f33
Signed by: tigro
GPG Key ID: 9C7900103E1C4F8B

@ -1,11 +1,12 @@
%global distro MSVSphere %global distro MSVSphere
%global release_name Inferit # define MSVSphere products
%global release_name Server ARM
%global major 9 %global major 9
%global minor 2 %global minor 2
Name: sphere-release Name: sphere-release
Version: %{major}.%{minor} Version: %{major}.%{minor}
Release: 1.3%{?dist} Release: 1.4%{?dist}
Summary: %{distro} release files Summary: %{distro} release files
License: GPLv2 License: GPLv2
URL: https://msvsphere.ru URL: https://msvsphere.ru
@ -28,6 +29,7 @@ Provides: system-release(releasever) = %{major}
# required by libdnf # required by libdnf
# https://github.com/rpm-software-management/libdnf/blob/0.48.0/libdnf/module/ModulePackage.cpp#L472 # https://github.com/rpm-software-management/libdnf/blob/0.48.0/libdnf/module/ModulePackage.cpp#L472
Provides: base-module(platform:el%{major}) Provides: base-module(platform:el%{major})
Requires: sphere-release-common = %{version}-%{release}
Source100: RPM-GPG-KEY-MSVSphere-9 Source100: RPM-GPG-KEY-MSVSphere-9
@ -64,6 +66,91 @@ Source508: msvsphere-resilientstorage.repo
%{distro} release files. %{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 %package -n sphere-sb-certs
Summary: %{distro} public secureboot certificates Summary: %{distro} public secureboot certificates
Group: System Environment/Base Group: System Environment/Base
@ -78,6 +165,7 @@ Provides: redhat-sb-certs = %{version}-%{release}
Summary: %{distro} package repositories Summary: %{distro} package repositories
Requires: sphere-release = %{version}-%{release} Requires: sphere-release = %{version}-%{release}
Requires: sphere-gpg-keys = %{version}-%{release} Requires: sphere-gpg-keys = %{version}-%{release}
Provides: sphere-repos(%{version})
%description -n sphere-repos %description -n sphere-repos
This package provides the package repository files for %{distro}. 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 mkdir -p ./docs
cp %{SOURCE200} ./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 # generate /usr/lib/os-release file
install -d -m 0755 %{buildroot}%{_prefix}/lib 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}" NAME="%{distro}"
VERSION="%{major}.%{minor}%{?beta: %{beta}} (%{release_name})" VERSION="%{major}.%{minor}%{?beta: %{beta}} (${variant})"
ID="msvsphere" ID="msvsphere"
ID_LIKE="rhel centos fedora" ID_LIKE="rhel centos fedora"
VERSION_ID="%{major}.%{minor}" VERSION_ID="%{major}.%{minor}"
PLATFORM_ID="platform:el%{major}" 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" ANSI_COLOR="0;34"
LOGO="fedora-logo-icon" LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:ncsd:msvsphere:%{major}::baseos" 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="%{distro}"
REDHAT_SUPPORT_PRODUCT_VERSION="%{major}.%{minor}%{?beta: %{beta}}" REDHAT_SUPPORT_PRODUCT_VERSION="%{major}.%{minor}%{?beta: %{beta}}"
EOF EOF
done
install -d -m 0755 %{buildroot}%{_sysconfdir}
# create symlink for /etc/os-release # create symlink for /etc/os-release
ln -s ../usr/lib/os-release %{buildroot}%{_sysconfdir}/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 # generate /etc/system-release-cpe
echo "cpe:/o:ncsd:msvsphere:%{major}::baseos" > %{buildroot}%{_sysconfdir}/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 -d -m 0755 %{buildroot}%{_sysconfdir}/pki/rpm-gpg
install -p -m 0644 %{SOURCE100} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ install -p -m 0644 %{SOURCE100} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/
%files %files
%files common
%license docs/LICENSE %license docs/LICENSE
%{_sysconfdir}/sphere-release %{_sysconfdir}/sphere-release
%{_sysconfdir}/redhat-release %{_sysconfdir}/redhat-release
%{_sysconfdir}/system-release %{_sysconfdir}/system-release
%config %{_sysconfdir}/system-release-cpe %config %{_sysconfdir}/system-release-cpe
%config(noreplace) %{_sysconfdir}/os-release %config(noreplace) %{_sysconfdir}/os-release
%{_prefix}/lib/os-release
%config(noreplace) %{_sysconfdir}/issue %config(noreplace) %{_sysconfdir}/issue
%config(noreplace) %{_sysconfdir}/issue.net %config(noreplace) %{_sysconfdir}/issue.net
%dir %{_sysconfdir}/issue.d %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/systemd/user-preset/*
%{_prefix}/lib/sysctl.d/50-redhat.conf %{_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 %files -n sphere-sb-certs
# Note to future packagers: # Note to future packagers:
# resetting the symlinks in /etc/pki/sb-certs on upgrade is the intended behavior here # 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 %changelog
* Sun Jul 30 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 9.2-1.4
- Create separate packages for Server and ARM
* Mon Jul 17 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 9.2-1.3 * Mon Jul 17 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 9.2-1.3
- Disable optional repos - Disable optional repos

Loading…
Cancel
Save