%global distro MSVSphere # define MSVSphere products %global release_name Server ARM %global major 8 %global minor 8 Name: sphere-release Version: %{major}.%{minor} Release: 1.0%{?dist} Summary: %{distro} release files License: GPLv2 URL: https://msvsphere.ru Provides: centos-release = %{version}-%{release} # Required for a lorax run (to generate install media) Requires: sphere-repos = %{version}-%{release} Provides: centos-release-eula Provides: redhat-release-eula # required by epel-release Provides: redhat-release = %{version}-%{release} # required by dnf # https://github.com/rpm-software-management/dnf/blob/4.2.23/dnf/const.py.in#L26 Provides: system-release = %{version}-%{release} 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-8 Source200: LICENSE Source201: EULA Source300: 85-display-manager.preset Source301: 90-default.preset Source302: 90-default-user.preset Source303: 99-default-disable.preset Source304: 50-redhat.conf # secureboot CA certificate Source400: spheresecurebootca.cer # kernel signing certificate Source401: spheresecureboot001.cer # grub2 signing certificate Source402: spheresecureboot001.cer # Fwupd signing certificate Source403: spheresecureboot001.cer # repository configuration files Source500: msvsphere-baseos.repo Source501: msvsphere-appstream.repo Source502: msvsphere-crb.repo Source503: msvsphere-extras.repo Source504: msvsphere-devel.repo Source505: msvsphere-rt.repo Source506: msvsphere-nfv.repo Source507: msvsphere-highavailability.repo Source508: msvsphere-resilientstorage.repo %description %{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: 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: 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 Provides: system-sb-certs = %{version}-%{release} Provides: redhat-sb-certs = %{version}-%{release} %description -n sphere-sb-certs %{distro} secureboot certificates. %package -n sphere-repos 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}. %package -n sphere-repos-extra Summary: %{distro} extra package repositories Requires: sphere-release = %{version}-%{release} Requires: sphere-gpg-keys = %{version}-%{release} %description -n sphere-repos-extra This package provides extra package repository files for %{distro}, like Devel. %package -n sphere-gpg-keys Summary: %{distro} RPM keys %description -n sphere-gpg-keys This package provides the RPM signature keys for %{distro}. %install mkdir -p ./docs cp %{SOURCE200} ./docs # generate /usr/lib/os-release file install -d -m 0755 %{buildroot}%{_prefix}/lib 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}} (${variant})" ID="msvsphere" ID_LIKE="rhel centos fedora" VERSION_ID="%{major}.%{minor}" PLATFORM_ID="platform:el%{major}" PRETTY_NAME="%{distro} %{major}.%{minor}%{?beta: %{beta}} (${variant})" ANSI_COLOR="0;34" LOGO="fedora-logo-icon" CPE_NAME="cpe:/o:ncsd:msvsphere:%{major}::baseos" HOME_URL="https://msvsphere.ru/" BUG_REPORT_URL="https://bugs.msvsphere.ru/" MSVSPHERE_MANTISBT_PROJECT="%{distro}-%{major}" 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 # create /etc/issue, /etc/issue.net and /etc/issue.d echo '\S' > %{buildroot}%{_sysconfdir}/issue echo 'Kernel \r on an \m' >> %{buildroot}%{_sysconfdir}/issue cp %{buildroot}%{_sysconfdir}/issue{,.net} echo >> %{buildroot}%{_sysconfdir}/issue mkdir -p %{buildroot}%{_sysconfdir}/issue.d # set up the dist tag macros mkdir -p %{buildroot}%{_rpmmacrodir} cat > %{buildroot}%{_rpmmacrodir}/macros.dist << EOF # dist macros. %%__bootstrap ~bootstrap %%msvsphere_ver %{major} %%msvsphere %{major} %%centos_ver %{major} %%centos %{major} %%rhel %{major} %%dist %%{!?distprefix0:%%{?distprefix}}%%{expand:%%{lua:for i=0,9999 do print("%%{?distprefix" .. i .."}") end}}.el%{major}%%{?with_bootstrap:%{__bootstrap}} %%el%{major} 1 EOF # copy EULA install -d -m 0755 %{buildroot}%{_datadir}/sphere-release ln -s sphere-release %{buildroot}%{_datadir}/redhat-release install -p -m 0644 %{SOURCE201} %{buildroot}%{_datadir}/sphere-release/ # copy systemd presets install -d -m 0755 %{buildroot}%{_prefix}/lib/systemd/system-preset/ install -d -m 0755 %{buildroot}%{_prefix}/lib/systemd/user-preset install -p -m 0644 %{SOURCE300} %{buildroot}%{_prefix}/lib/systemd/system-preset/ install -p -m 0644 %{SOURCE301} %{buildroot}%{_prefix}/lib/systemd/system-preset/ install -p -m 0644 %{SOURCE302} %{buildroot}%{_prefix}/lib/systemd/user-preset/ # installing the same file for both system and user presets to set the same behavior for both install -p -m 0644 %{SOURCE303} %{buildroot}%{_prefix}/lib/systemd/system-preset/ install -p -m 0644 %{SOURCE303} %{buildroot}%{_prefix}/lib/systemd/user-preset/ # copy sysctl presets mkdir -p %{buildroot}/%{_prefix}/lib/sysctl.d/ install -m 0644 %{SOURCE304} %{buildroot}/%{_prefix}/lib/sysctl.d/ # dnf variables install -d -m 0755 %{buildroot}%{_sysconfdir}/dnf/vars echo "%{major}-stream" > %{buildroot}%{_sysconfdir}/dnf/vars/stream # create secureboot certificate directories install -d -m 0755 %{buildroot}%{_sysconfdir}/pki/sb-certs/ install -d -m 0755 %{buildroot}%{_datadir}/pki/sb-certs/ # install x86_64 secureboot certificates install -m 644 %{SOURCE400} %{buildroot}%{_datadir}/pki/sb-certs/secureboot-ca-x86_64.cer install -m 644 %{SOURCE401} %{buildroot}%{_datadir}/pki/sb-certs/secureboot-kernel-x86_64.cer install -m 644 %{SOURCE402} %{buildroot}%{_datadir}/pki/sb-certs/secureboot-grub2-x86_64.cer install -m 644 %{SOURCE403} %{buildroot}%{_datadir}/pki/sb-certs/secureboot-fwupd-x86_64.cer # link x86_64 secureboot certificates ln -sr %{buildroot}%{_datadir}/pki/sb-certs/secureboot-ca-x86_64.cer \ %{buildroot}%{_sysconfdir}/pki/sb-certs/secureboot-ca-x86_64.cer ln -sr %{buildroot}%{_datadir}/pki/sb-certs/secureboot-kernel-x86_64.cer \ %{buildroot}%{_sysconfdir}/pki/sb-certs/secureboot-kernel-x86_64.cer ln -sr %{buildroot}%{_datadir}/pki/sb-certs/secureboot-grub2-x86_64.cer \ %{buildroot}%{_sysconfdir}/pki/sb-certs/secureboot-grub2-x86_64.cer ln -sr %{buildroot}%{_datadir}/pki/sb-certs/secureboot-fwupd-x86_64.cer \ %{buildroot}%{_sysconfdir}/pki/sb-certs/secureboot-fwupd-x86_64.cer # copy DNF repositories install -d -m 0755 %{buildroot}%{_sysconfdir}/yum.repos.d install -p -m 0644 %{SOURCE500} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE501} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE502} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE503} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE504} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE505} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE506} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE507} %{buildroot}%{_sysconfdir}/yum.repos.d/ install -p -m 0644 %{SOURCE508} %{buildroot}%{_sysconfdir}/yum.repos.d/ # copy GPG keys 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 %config(noreplace) %{_sysconfdir}/issue %config(noreplace) %{_sysconfdir}/issue.net %dir %{_sysconfdir}/issue.d %{_rpmmacrodir}/macros.dist %{_datadir}/redhat-release %{_datadir}/sphere-release %{_prefix}/lib/systemd/system-preset/* %{_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 %dir %{_sysconfdir}/pki/sb-certs %dir %{_datadir}/pki/sb-certs/ %{_sysconfdir}/pki/sb-certs/*.cer %{_datadir}/pki/sb-certs/*.cer %files -n sphere-repos %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-baseos.repo %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-appstream.repo %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-crb.repo %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-extras.repo %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-rt.repo %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-nfv.repo %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-highavailability.repo %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-resilientstorage.repo %config(noreplace) %{_sysconfdir}/dnf/vars/stream %files -n sphere-repos-extra %config(noreplace) %{_sysconfdir}/yum.repos.d/msvsphere-devel.repo %files -n sphere-gpg-keys %{_sysconfdir}/pki/rpm-gpg %changelog * Mon Aug 14 2023 Sergey Cherevko - 8.8-1.0 - Rebuilt for MSVSphere 8.8 * 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 * Mon Jul 17 2023 Arkady L. Shane - 9.2-1.2 - added rt, nfv, highavailabilit, resilientstorage repos - fix debug and sources url in repo files - added separate extra package for devel repo * Thu Jul 6 2023 Sergey Cherevko - 9.2-1.1 - Enable CRB by default (INF-387) * Thu May 25 2023 Sergey Cherevko - 9.2-1.0 - Update to MSVSphere 9.2 * Thu Apr 20 2023 Eugene Zamriy - 9.1-1.6 - Disabled CRB repo by default - Added Extras repository config * Mon Apr 10 2023 Eugene Zamriy - 9.1-1.5 - Added EULA * Mon Apr 03 2023 Eugene Zamriy - 9.1-1.4 - Added BaseOS, AppStream and CRB repository configs * Tue Mar 28 2023 Eugene Zamriy - 9.1-1.3 - Public key edit: added SHA256 digest * Mon Mar 27 2023 Eugene Zamriy - 9.1-1.2 - Added MSVSPHERE_MANTISBT_PROJECT* variables for libreport plugin * Mon Mar 27 2023 Eugene Zamriy - 9.1-1.1 - Added MSVSphere secureboot certificates * Fri Feb 17 2023 Eugene Zamriy - 9.1-1.0 - Initial release for MSVSphere 9.1 beta