File skelcd-sap-apl.spec of Package skelcd-sap-apl

#
# spec file for package skelcd-sap-apl
#
# Copyright (c) 2017 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 SLES_SAP
%define product sap-apl

# 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}
AutoReqProv:    off
Version:        2019.07.05
Release:        0
Summary:        CD Skeleton for SLES SAP Applications
License:        GPL-2.0-only
Group:          SUSE internal
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         skelcd.tar.bz2

%description
CD skeleton for SLES_SAP containing:
* Beta EULA;
* Final EULA;
Obs: The sap-control.xml that defines the installation steps of SLES for SAP was moved 
for the new package skelcd-control-SLES4SAP.

Authors:
--------
    varkoly@suse.de
    dakechi@suse.de

%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}/
cp %license_dir/*    $RPM_BUILD_ROOT/%{skelcd1_path}/
mkdir $RPM_BUILD_ROOT/%{skelcd1_path}/lic
mv    $RPM_BUILD_ROOT/%{skelcd1_path}/license*txt $RPM_BUILD_ROOT/%{skelcd1_path}/lic
pushd $RPM_BUILD_ROOT/%{skelcd1_path}/lic
ls -1 > directory.yast
tar cvzf $RPM_BUILD_ROOT/%{skelcd1_path}/license-%{PRODUCT}.tar.gz --owner=root --group=root *txt directory.yast
popd
rm -rf $RPM_BUILD_ROOT/%{skelcd1_path}/lic

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%exclude /%{skelcd1_path}/license-%{PRODUCT}.tar.gz
%dir /usr/lib/skelcd/
/%{skelcd1_path}

%files -n skelcd-EULA-%{product}
%defattr(644,root,root,755)
/%{skelcd1_path}/license-%{PRODUCT}.tar.gz

%changelog
openSUSE Build Service is sponsored by