File skelcd-leanos.spec of Package skelcd-leanos
#
# spec file for package skelcd-leanos
#
# Copyright (c) 2016 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/
#
%define product leanos
# release is a beta
%define beta 0
%if 0%{?beta} == 1
%define license_dir license.beta
%else
%define license_dir license.final
%endif
# SLE15 uses different paths
%if 0%{?suse_version} > 1320
%define skelcd1_path usr/lib/skelcd/CD1
%else
%define skelcd1_path CD1
%endif
Name: skelcd-%{product}
# We put the RN for the base products on the installer media
BuildRequires: release-notes-sles
BuildRequires: release-notes-sled
BuildRequires: release-notes-sles-for-sap
BuildRequires: release-notes-sle_hpc
BuildRequires: sle_quickstarts
BuildRequires: suse-build-key
BuildRequires: w3m
AutoReqProv: off
Version: 2019.07.05
Release: 0
Summary: CD skeleton
License: GPL-2.0-only
Group: Metapackages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: skelcd.tar.bz2
Source2: README
Source3: README.BETA
Source4: README.manual
# please repo-checker (bsc#1089174)
Provides: skelcd = %{version}
Conflicts: otherproviders(skelcd)
%description
Internal package only.
%package -n skelcd-EULA-%{product}
Summary: EULA for media
Group: Metapackages
%description -n skelcd-EULA-%{product}
Internal package only.
%prep
%setup -n skelcd -q
%build
%install
mkdir -p $RPM_BUILD_ROOT/%{skelcd1_path}/boot
cp READMEs/* $RPM_BUILD_ROOT/%{skelcd1_path}/
cp /usr/lib/rpm/gnupg/keys/* $RPM_BUILD_ROOT/%{skelcd1_path}/
for i in README \
%if %{?beta} == 1
README.BETA \
%endif
; do
cp -pv $RPM_SOURCE_DIR/$i $RPM_BUILD_ROOT/%{skelcd1_path}/$i
done
## The new way to do it...
mkdir -p $RPM_BUILD_ROOT/%{skelcd1_path}/media.1
pushd %license_dir
ls -1 > directory.yast # required for downloading of EULAs from SCC
tar cvzf license.tar.gz --owner=root --group=root *txt directory.yast
cp license.tar.gz $RPM_BUILD_ROOT/%{skelcd1_path}/
popd
#
#
# Install PDF documentation
#
mkdir -p $RPM_BUILD_ROOT/%{skelcd1_path}/docu
cp -vp /usr/share/doc/manual/quickstarts/*.pdf $RPM_BUILD_ROOT/%{skelcd1_path}/docu/
# Install release notes as HTML pages
#
# pushd /usr/share/doc/release-notes/SUSE_Linux_Enterprise_Server_15/
pushd /usr/share/doc/release-notes/
for j in `ls`; do
pushd $j
for i in RELEASE-NOTES.en.*; do
cp -vp ${i} $RPM_BUILD_ROOT/%{skelcd1_path}/docu/${i/NOTES/NOTES_${j}}
done;
popd
done
popd
pushd $RPM_BUILD_ROOT/%{skelcd1_path}/docu/
for i in *.en.html; do
w3m -dump $i > ${i/html/txt}
done;
popd
#
# Create .treeinfo for virt-manager
#
cat << EOF > $RPM_BUILD_ROOT/%{skelcd1_path}/.treeinfo
[header]
version = 1.0
[general]
arch = %{_arch}
family = SUSE Linux Enterprise
name = SUSE Linux Enterprise
version = 15 SP2
%ifarch x86_64
platforms = x86_64,xen
%else
platforms = %{_arch}
%endif
[release]
name = SUSE Linux Enterprise
short = sle
version = 15 SP2
[images-%{_arch}]
%ifnarch x86_64
kernel = boot/%{_arch}/linux
initrd = boot/%{_arch}/initrd
%else
kernel = boot/%{_arch}/loader/linux
initrd = boot/%{_arch}/loader/initrd
[images-xen]
kernel = boot/x86_64/loader/linux
initrd = boot/x86_64/loader/initrd
%endif
EOF
%files
%defattr(644,root,root,755)
%exclude /%{skelcd1_path}/license.tar.gz
%dir /usr/lib/skelcd/
/%{skelcd1_path}
%files -n skelcd-EULA-%{product}
%defattr(644,root,root,755)
/%{skelcd1_path}/license.tar.gz
%changelog