SHA256
1
0
forked from openSUSE/Leap

Add Leap release package

This commit is contained in:
Lubos Kocman 2024-05-22 11:21:19 +02:00
parent c22ed7a716
commit 55f60f5c80

View File

@ -0,0 +1,253 @@
#
# spec file for package SUSE-MicroOS-release
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# old location was /etc/YaST2/licenses/, see jsc#SLE-3067
%define product_license_dir /usr/share/licenses/product/
Name: Leap-release
Summary: openSUSE Leap 16.0 Alpha
License: MIT
Group: System/Fhs
Version: 6.0
Release: 0
#BuildRequires: skelcd-EULA-SMO
BuildRequires: skelcd-openSUSE
#BuildRequires: skelcd-control-SMO
Recommends: branding
# in rare cases, 'ln' is not found...
Requires(post): coreutils
Recommends: issue-generator
# bsc#1078737#c7
Recommends: release-notes-leap-micro
Provides: distribution-release
Provides: product(Leap-Micro) = %{version}-%{release}
#Provides: product(SUSE_SLE-SP) = %{version}-%{release}
Provides: system-installation() = Leap-Micro
# relaxes openSUSE/SUSE vendor change in zypper dup bsc#1182629
Provides: dup-vendor-relax(suse)
# bsc#1055299
Conflicts: otherproviders(distribution-release)
Provides: %name-%version
Provides: product() = Leap
Provides: product(Leap-Micro) = 16.0-1
%ifarch x86_64
Provides: product-register-target() = openSUSE%2DLeap%2DMicro%2D6.0%2Dx86_64
%endif
%ifarch aarch64
Provides: product-register-target() = openSUSE%2DLeap%2DMicro%2D6.0%2Daarch64
%endif
Provides: product-label() = openSUSE%20Leap%20Micro
Provides: product-cpeid() = cpe%3A%2Fo%3Aopensuse%3Aleap%2Dmicro%3A6.0
Provides: product-url(releasenotes) = https%3A%2F%2Fdoc.opensuse.org%2Frelease%2Dnotes%2F%{_target_cpu}%2FopenSUSE%2FLeapMicro%2F6.0%2Frelease%2Dnotes%2Dleap%2Dmicro.rpm
Provides: product-url(repository) = https%3A%2F%2Fdownload.opensuse.org%2Fdistribution%2Fleap%2Dmicro%2F6.0%2Fproduct%2Frepo%2FLeap%2DMicro%2D6.0%2Dx86_64%2DMedia1%2F
Provides: product-url(repository) = https%3A%2F%2Fdownload.opensuse.org%2Fdistribution%2Fleap%2Dmicro%2F6.0%2Fproduct%2Frepo%2FLeap%2DMicro%2D6.0%2Daarch64%2DMedia1%2F
Provides: product-url(repository) = http%3A%2F%2Fdownload.opensuse.org%2Fupdate%2Fleap%2Dmicro%2F6.0%2Fsle%2F
Provides: product-updates-repoid() = obsrepository%3A%2F%2Fbuild.opensuse.org%2FSUSE%3AUpdates%3AopenSUSE%2DLeap%2DMicro%3A6.0%2Fstandard
Provides: product-endoflife() = 2025%2D05%2D31
# Make sure we are at SLES15 level
# TBD
PreReq: glibc >= 2.22
Conflicts: kernel < 4.4
Conflicts: perl-Bootloader < 0.904
# help packagelist generator to pick -default flavor instead of vanilla, when in doubt
Suggests: kernel-default
Suggests: openSUSE-repos-LeapMicro
# old package obsoletes removed. If we support 11 SP4 migration to 15, we may
# need to re-add some.
# ./.
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# this package should only be available for the "basearchs" of a product
# i586 added as installation-images-SLES reequires it.
ExclusiveArch: x86_64 ppc64le s390x aarch64
Source100: weakremovers.inc
%include %{SOURCE100}
%description
openSUSE Leap Micro 6.0
%prep
%setup -qcT
mkdir license
tar -C license -xzf %{_prefix}/lib/skelcd/CD1/license.tar.gz
%build
%install
mkdir -p $RPM_BUILD_ROOT/etc
mkdir -p $RPM_BUILD_ROOT/usr/lib/issue.d
# Create set-up for issue-generator
echo -e "\nWelcome to openSUSE Leap Micro 6.0 Alpha (%{_target_cpu}) - Kernel \\\r (\\\l).\n" > $RPM_BUILD_ROOT/usr/lib/issue.d/10-SUSE
echo -e "\n" > $RPM_BUILD_ROOT/usr/lib/issue.d/90-SUSE
# create /etc/SuSE-release - deprecated, FATE#316268
# no longer build, in case you wonder
touch $RPM_BUILD_ROOT/etc/motd
# Setup rpm macros
# XXX this wrong. Needs to be in rpm-config-SUSE
mkdir -p $RPM_BUILD_ROOT/etc/rpm/
echo "#" > $RPM_BUILD_ROOT/etc/rpm/macros.sle
echo "# RPM macros to identify SLE distribution" >> $RPM_BUILD_ROOT/etc/rpm/macros.sle
echo "#" >> $RPM_BUILD_ROOT/etc/rpm/macros.sle
echo "#==================================================" >> $RPM_BUILD_ROOT/etc/rpm/macros.sle
echo "" >> $RPM_BUILD_ROOT/etc/rpm/macros.sle
echo "%%sle_version %sle_version" >> $RPM_BUILD_ROOT/etc/rpm/macros.sle
mkdir -p %{buildroot}%{_prefix}/lib
cat > %{buildroot}%{_prefix}/lib/os-release <<EOF
NAME="openSUSE Leap Micro"
VERSION="%{version}%{?betaversion:%{betaversion}}"
ID="opensuse-leap-micro"
ID_LIKE="suse opensuse opensuse-leap suse-microos"
VERSION_ID="%{version}"
PRETTY_NAME="openSUSE Leap Micro %{version}%{?betaversion:%{betaversion}}"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap-micro:%{version}"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:LeapMicro"
LOGO="distributor-logo-LeapMicro"
EOF
ln -s ..%{_prefix}/lib/os-release %{buildroot}%{_sysconfdir}/os-release
#mv $RPM_BUILD_ROOT/etc/os-release $RPM_BUILD_ROOT/usr/lib/os-release
install -D -d -m 755 "%{buildroot}%{_datadir}/licenses/product/base"
install -D -d -m 755 "%{buildroot}%{_defaultlicensedir}"
cp -a license "%{buildroot}%{_defaultlicensedir}/%{name}"
pushd license
# SLE compat
for i in *; do
ln -s "%{_defaultlicensedir}/%{name}/$i" %{buildroot}%{_datadir}/licenses/product/base/$i
done
mkdir -p %{buildroot}%{_sysconfdir}/products.d
cat >%{buildroot}%{_sysconfdir}/products.d/Leap-Micro.prod << EOF
<?xml version="1.0" encoding="UTF-8"?>
<product schemeversion="0">
<vendor>openSUSE</vendor>
<name>Leap-Micro</name>
<version>6.0</version>
<release>1</release>
<endoflife>2025-05-31</endoflife>
<arch>%{_target_cpu}</arch>
<cpeid>cpe:/o:opensuse:leap-micro:6.0</cpeid>
<productline>Leap</productline>
<codestream>
<name>openSUSE Leap Micro 6.0</name>
<endoflife>2026-10-31</endoflife>
</codestream>
<register>
<pool>
<repository url="https://download.opensuse.org/distribution/leap-micro/6.0/product/repo/Leap-Micro-6.0-x86_64-Media1/" arch="x86_64">
<zypp name="openSUSE-Leap-Micro-6.0-Pool" alias="openSUSE-Leap-Micro-6.0-Pool"/>
</repository>
<repository url="https://download.opensuse.org/distribution/leap-micro/6.0/product/repo/Leap-Micro-6.0-aarch64-Media1/" arch="aarch64">
<zypp name="openSUSE-Leap-Micro-6.0-Pool" alias="openSUSE-Leap-Micro-6.0-Pool"/>
</repository>
</pool>
<updates>
<distrotarget arch="x86_64">openSUSE-Leap-Micro-6.0-x86_64</distrotarget>
<distrotarget arch="aarch64">openSUSE-Leap-Micro-6.0-aarch64</distrotarget>
<repository project="SUSE:Updates:openSUSE-Leap-Micro:6.0" name="standard">
<zypp name="openSUSE-Leap-Micro-6.0-Updates" alias="openSUSE-Leap-Micro-6.0-Updates"/>
</repository>
</updates>
</register>
<repositories>
<repository type="update" repoid="obsrepository://build.opensuse.org/SUSE:Updates:openSUSE-Leap-Micro:6.0/standard"/>
</repositories>
<summary>openSUSE Leap Micro 6.0</summary>
<shortsummary>openSUSE Leap Micro</shortsummary>
<description>openSUSE Leap Micro 6.0</description>
<linguas>
<language>en</language>
</linguas>
<urls>
<url name="releasenotes">https://doc.opensuse.org/release-notes/%{_target_cpu}/openSUSE/LeapMicro/6.0/release-notes-leap-micro.rpm</url>
<url name="repository" arch="x86_64">https://download.opensuse.org/distribution/leap-micro/6.0/product/repo/Leap-Micro-6.0-x86_64-Media1/</url>
<url name="repository" arch="aarch64">https://download.opensuse.org/distribution/leap-micro/6.0/product/repo/Leap-Micro-6.0-aarch64-Media1/</url>
<url name="repository">http://download.opensuse.org/update/leap-micro/6.0/sle/</url>
</urls>
<buildconfig>
<producttheme>Leap-Micro</producttheme>
<betaversion>Alpha</betaversion>
</buildconfig>
<installconfig>
<defaultlang>en_US</defaultlang>
<releasepackage name="%{name}" flag="EQ" version="%{version}" release="%{release}"/>
<distribution>openSUSE</distribution>
</installconfig>
<runtimeconfig/>
</product>
EOF
# enable vendor change openSUSE,SUSE
mkdir -p %{buildroot}%{_sysconfdir}/zypp/vendors.d
echo -e "[main]\nvendors=openSUSE,SUSE,SUSE LLC <https://www.suse.com/>\n" > %{buildroot}%{_sysconfdir}/zypp/vendors.d/00-openSUSE.conf
%post
# this is a base product, create symlink bsc#1091952
if [ ! -L %{_sysconfdir}/products.d/baseproduct ]; then
ln -sf Leap-Micro.prod %{_sysconfdir}/products.d/baseproduct
fi
%files
%defattr(644,root,root,755)
%{_sysconfdir}/os-release
%{_prefix}/lib/os-release
# Bug 404141 - /etc/YaST/control.xml should be owned by some package
# No control file for the time being
# %dir %{_sysconfdir}/YaST2/
# %config %{_sysconfdir}/YaST2/control.xml
%dir %{_sysconfdir}/zypp
%dir %{_sysconfdir}/zypp/vendors.d
%config(noreplace) %{_sysconfdir}/zypp/vendors.d/00-openSUSE.conf
%dir /etc/products.d
%ghost /etc/products.d/baseproduct
/etc/products.d/*
%config /etc/rpm/macros.sle
%config(noreplace) /etc/motd
%dir /usr/lib/issue.d/
/usr/lib/issue.d/*-SUSE
%dir %{product_license_dir}
%{product_license_dir}/base
%license license/*
%changelog