Blob Blame History Raw
# spec file for package openSUSE-ALP-release.spec
# Copyright (c) 2020 SUSE LLC
# 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

%define product ALP
%define betaversion %{nil}
%define codename %{nil}
Name:           ALP-release
Version:        0.1
Release:        0
# 0 is the product release, not the build release of this package
Summary:        Adaptable Linux Platform 
License:        GPL-2.0-or-later
Group:          System/Fhs
BuildRequires:  skelcd-control-ALP
BuildRequires:  skelcd-ALP
Suggests:       branding-openSUSE
Suggests:       distribution-logos-openSUSE-ALP
Suggests:       java-11-openjdk
Suggests:       mariadb
Suggests:       mariadb-client
Suggests:       openSUSE-build-key
Suggests:       openssl-1_1
Conflicts:      core-release <= 10
Conflicts:      distribution-release
Provides:       distribution-release
# ALP is a SUSE Linux type distribution
Provides:       suse-release = %{version}-%{release}
Provides:       suse-release-oss = %{version}-%{release}
# Build using microos patterns
Provides:	MicroOS-release
Obsoletes:	MicroOS-release
# Give zypp a hint that this product must be kept up-to-date using zypper dup, not up (boo#1061384)
Provides:       product-update() = dup
# With more than one product in the FTP tree, yast needs to know which products are installable
# The name is referenced by the control file as well
Provides:       system-installation() = ALP

# this package should only be available for the "basearchs" of a product
ExclusiveArch:  %ix86 x86_64 ppc64le s390x aarch64 %arm
%include %{SOURCE100}
Provides:       %name-%version
Provides:       product() = ALP
Provides:       product(ALP) = 0.1-0
Provides:       product-label() = ALP
Provides:       product-cpeid() = cpe%3A%2Fo%3Asuse%3Aalp%3A0.1
Provides:       product-url(repository) =
Provides:       product-endoflife()


%setup -qcT
mkdir license
if [ -f /CD1/license.tar.gz ]; then
  tar -C license -xzf /CD1/license.tar.gz
elif [ -f %{_prefix}/lib/skelcd/CD1/license.tar.gz ]; then
  tar -C license -xzf %{_prefix}/lib/skelcd/CD1/license.tar.gz


mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_prefix}/lib/issue.d %{buildroot}/run

echo -e 'Welcome to %{product} %{codename} %{version}%{?betaversion: %{betaversion}} - Kernel \\r (\\l).\n' > %{buildroot}%{_prefix}/lib/issue.d/10-ALP.conf
echo -e "This is an early sneak preview release  not intended for production environment.\n" > %{buildroot}%{_prefix}/lib/issue.d/90-ALP.conf
echo    'Welcome to %{product} %{codename} %{version}%{?betaversion: %{betaversion}} - Kernel %%r (%%t).' > %{buildroot}%{_sysconfdir}/

VERSION_ID=`echo %{version}|tr '[:upper:]' '[:lower:]'|sed -e 's/ //g;'`
# note: VERSION is an optional field and has no meaning other than informative on a rolling distro
# We do thus not add it to the os-release file
cat > %{buildroot}%{_prefix}/lib/os-release <<EOF
# VERSION="%{version}%{?betaversion: %{betaversion}}"
ID_LIKE="suse opensuse opensuse-tumbleweed"
ln -s ..%{_prefix}/lib/os-release %{buildroot}%{_sysconfdir}/os-release

mkdir -p %{buildroot}%{_prefix}/lib/motd.d/
echo "Have a lot of fun..." > %{buildroot}%{_prefix}/lib/motd.d/welcome
# Bug 404141 - /etc/YaST/control.xml should be owned by some package
mkdir -p %{buildroot}%{_sysconfdir}/YaST2/
echo %{buildroot}
if [ -f /CD1/control.xml ]; then
  install -m 644 /CD1/control.xml %{buildroot}%{_sysconfdir}/YaST2/
elif [ -f %{_prefix}/lib/skelcd/CD1/control.xml ]; then
  install -m 644 %{_prefix}/lib/skelcd/CD1/control.xml %{buildroot}%{_sysconfdir}/YaST2/

# enable vendor change openSUSE,SUSE for DUP from 15.3 to TW (boo#1198332)
mkdir -p %{buildroot}%{_sysconfdir}/zypp/vendors.d
echo -e "[main]\nvendors=openSUSE,SUSE,SUSE LLC <>\n" > %{buildroot}%{_sysconfdir}/zypp/vendors.d/00-openSUSE.conf

# fate#319341, make openSUSE-release own YaST license files. TODO:
# get rid of /etc/YaST2/licenses
install -D -d -m 755 "%{buildroot}%_defaultlicensedir/product/base"
install -D -d -m 755 "%{buildroot}%_defaultlicensedir"
cp -a license "%{buildroot}%_defaultlicensedir/%name"
pushd license
for i in *; do
	ln -s "%_defaultlicensedir/%name/$i" %{buildroot}%_defaultlicensedir/product/base/$i

mkdir -p %{buildroot}%{_sysconfdir}/products.d
cat >%{buildroot}%{_sysconfdir}/products.d/ << EOF
<?xml version="1.0" encoding="UTF-8"?>
<product schemeversion="0">
  <summary>Adaptable Linux Platform</summary>
    <url name="repository"></url>
    <releasepackage name="%{name}" flag="EQ" version="%{version}" release="%{release}"/>


# this is a base product, create symlink
ln -s %{buildroot}%{_sysconfdir}/products.d/baseproduct

# Launch the issue-generator: we have a new config file in /usr/lib/issue.d that needs to be represented
if [ -x %{_sbindir}/issue-generator ]; then
    if [ -x %{_bindir}/systemd-tmpfiles ]; then
      %{_bindir}/systemd-tmpfiles --create issue-generator.conf || :
    %{_sbindir}/issue-generator || :

%dir %_defaultlicensedir/product
%license license/*
# Bug 404141 - /etc/YaST/control.xml should be owned by some package
%dir %{_sysconfdir}/YaST2/
%config %{_sysconfdir}/YaST2/control.xml
%dir %{_sysconfdir}/zypp
%dir %{_sysconfdir}/zypp/vendors.d
%config %{_sysconfdir}/zypp/vendors.d/00-openSUSE.conf
%dir %{_prefix}/lib/issue.d/
%config(noreplace) %{_sysconfdir}/