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/
#


# release is a beta
%define beta 0

Name:           skelcd-leanos
# 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
%if 0%{?beta} == 1
%define license_dir license.beta
%else
%define license_dir license.final
%endif
AutoReqProv:    off
Version:        2019.04.30
Release:        0
Summary:        CD skeleton
License:        GPL-2.0
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.



%prep
%setup -n skelcd -q

%build

%install
mkdir -p $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/boot
cp READMEs/* $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/
cp /usr/lib/rpm/gnupg/keys/* $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/
for i in README \
%if %{?beta} == 1
        README.BETA \
%endif
        ; do
  cp -pv $RPM_SOURCE_DIR/$i $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/$i
done
## The newest way to do it...
mkdir -p $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/media.1
pushd %license_dir
ls -1 > directory.yast # required to allow downloading of yast licenses from SCC
tar cvzf license.tar.gz --owner=root --group=root *txt directory.yast
cp license.tar.gz $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/
popd
#
#
# Install PDF documentation
#
mkdir -p $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/docu
cp -vp /usr/share/doc/manual/quickstarts/*.pdf $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/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/usr/lib/skelcd/CD1/docu/${i/NOTES/NOTES_${j}}
  done;
  popd
done

popd
pushd $RPM_BUILD_ROOT/usr/lib/skelcd/CD1/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/usr/lib/skelcd/CD1/.treeinfo
[header]
version = 1.0

[general]
arch = %{_arch}
family = SUSE Linux Enterprise
name = SUSE Linux Enterprise
version = 15 SP1
%ifarch x86_64
platforms = x86_64,xen
%else
platforms = %{_arch}
%endif

[release]
name = SUSE Linux Enterprise
short = sle
version = 15 SP1

[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 /usr/lib/skelcd/CD1/license.tar.gz
%dir /usr/lib/skelcd/
/usr/lib/skelcd/CD1

%package -n skelcd-EULA-leanos
Summary:        EULA for media
Group:          Metapackages

%description -n skelcd-EULA-leanos
Internal package only.


%files -n skelcd-EULA-leanos
%defattr(644,root,root,755)
/usr/lib/skelcd/CD1/license.tar.gz

%changelog
openSUSE Build Service is sponsored by