Blame ALP-release.spec

Adrian Schröter c6aa47
#
Adrian Schröter c6aa47
# spec file for package openSUSE-ALP-release.spec
Adrian Schröter c6aa47
#
Adrian Schröter c6aa47
# Copyright (c) 2020 SUSE LLC
Adrian Schröter c6aa47
#
Adrian Schröter c6aa47
# All modifications and additions to the file contributed by third parties
Adrian Schröter c6aa47
# remain the property of their copyright owners, unless otherwise agreed
Adrian Schröter c6aa47
# upon. The license for this file, and modifications and additions to the
Adrian Schröter c6aa47
# file, is the same license as for the pristine package itself (unless the
Adrian Schröter c6aa47
# license for the pristine package is not an Open Source License, in which
Adrian Schröter c6aa47
# case the license is the MIT License). An "Open Source License" is a
Adrian Schröter c6aa47
# license that conforms to the Open Source Definition (Version 1.9)
Adrian Schröter c6aa47
# published by the Open Source Initiative.
Adrian Schröter c6aa47
Adrian Schröter c6aa47
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Adrian Schröter c6aa47
#
Adrian Schröter c6aa47
Adrian Schröter c6aa47
Adrian Schröter e38391
%define product ALP
Adrian Schröter e38391
%define betaversion %{nil}
Adrian Schröter e38391
%define codename %{nil}
Adrian Schröter c6aa47
Name:           ALP-release
Adrian Schröter c6aa47
Version:        0.1
Adrian Schröter c6aa47
Release:        0
Adrian Schröter e38391
# 0 is the product release, not the build release of this package
Adrian Schröter c6aa47
Summary:        Adaptable Linux Platform 
Adrian Schröter c6aa47
License:        GPL-2.0-or-later
Adrian Schröter c6aa47
Group:          System/Fhs
Adrian Schröter c6aa47
Source100:      weakremovers.inc
Adrian Schröter e38391
BuildRequires:  skelcd-control-ALP
Adrian Schröter 73139d
BuildRequires:  skelcd-ALP
Adrian Schröter c6aa47
Suggests:       branding-openSUSE
Adrian Schröter c6aa47
Suggests:       distribution-logos-openSUSE-ALP
Adrian Schröter e38391
Suggests:       java-11-openjdk
Adrian Schröter e38391
Suggests:       mariadb
Adrian Schröter e38391
Suggests:       mariadb-client
Adrian Schröter c6aa47
Suggests:       openSUSE-build-key
Adrian Schröter e38391
Suggests:       openssl-1_1
Adrian Schröter e38391
Conflicts:      core-release <= 10
Adrian Schröter c6aa47
Conflicts:      distribution-release
Adrian Schröter c6aa47
Provides:       distribution-release
Adrian Schröter c6aa47
# ALP is a SUSE Linux type distribution
Adrian Schröter c6aa47
Provides:       suse-release = %{version}-%{release}
Adrian Schröter c6aa47
Provides:       suse-release-oss = %{version}-%{release}
Adrian Schröter c6aa47
# Build using microos patterns
Adrian Schröter c6aa47
Provides:	MicroOS-release
Adrian Schröter c6aa47
Obsoletes:	MicroOS-release
Adrian Schröter c6aa47
# Give zypp a hint that this product must be kept up-to-date using zypper dup, not up (boo#1061384)
Adrian Schröter c6aa47
Provides:       product-update() = dup
Adrian Schröter c6aa47
# With more than one product in the FTP tree, yast needs to know which products are installable
Adrian Schröter c6aa47
# The name is referenced by the control file as well
Adrian Schröter c6aa47
Provides:       system-installation() = ALP
Adrian Schröter e38391
Adrian Schröter c6aa47
# this package should only be available for the "basearchs" of a product
Adrian Schröter c6aa47
ExclusiveArch:  %ix86 x86_64 ppc64le s390x aarch64 %arm
Adrian Schröter c6aa47
%include %{SOURCE100}
Adrian Schröter c6aa47
Provides:       %name-%version
Adrian Schröter c6aa47
Provides:       product() = ALP
Adrian Schröter c6aa47
Provides:       product(ALP) = 0.1-0
Adrian Schröter c6aa47
Provides:       product-label() = ALP
Adrian Schröter c6aa47
Provides:       product-cpeid() = cpe%3A%2Fo%3Asuse%3Aalp%3A0.1
Adrian Schröter 73139d
Provides:       product-url(repository) = http%3A%2F%2Fdownload.opensuse.org%2Frepositories%2FSUSE%3A%2FALP%3A%2Fstandard%2F
Adrian Schröter c6aa47
Provides:       product-endoflife()
Adrian Schröter c6aa47
Adrian Schröter c6aa47
Adrian Schröter c6aa47
%description
Adrian Schröter c6aa47
Adrian Schröter c6aa47
Adrian Schröter c6aa47
Adrian Schröter c6aa47
Adrian Schröter c6aa47
%prep
Adrian Schröter e38391
%setup -qcT
Adrian Schröter e38391
mkdir license
Adrian Schröter e38391
if [ -f /CD1/license.tar.gz ]; then
Adrian Schröter e38391
  tar -C license -xzf /CD1/license.tar.gz
Adrian Schröter e38391
elif [ -f %{_prefix}/lib/skelcd/CD1/license.tar.gz ]; then
Adrian Schröter e38391
  tar -C license -xzf %{_prefix}/lib/skelcd/CD1/license.tar.gz
Adrian Schröter e38391
fi
Adrian Schröter c6aa47
Adrian Schröter c6aa47
%build
Adrian Schröter c6aa47
Adrian Schröter c6aa47
%install
Adrian Schröter e38391
mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_prefix}/lib/issue.d %{buildroot}/run
Adrian Schröter c6aa47
Adrian Schröter e38391
echo -e 'Welcome to %{product} %{codename} %{version}%{?betaversion: %{betaversion}} - Kernel \\r (\\l).\n' > %{buildroot}%{_prefix}/lib/issue.d/10-ALP.conf
Adrian Schröter 73139d
echo -e "This is an early sneak preview release  not intended for production environment.\n" > %{buildroot}%{_prefix}/lib/issue.d/90-ALP.conf
Adrian Schröter e38391
echo    'Welcome to %{product} %{codename} %{version}%{?betaversion: %{betaversion}} - Kernel %%r (%%t).' > %{buildroot}%{_sysconfdir}/issue.net
Adrian Schröter c6aa47
Adrian Schröter c6aa47
VERSION_ID=`echo %{version}|tr '[:upper:]' '[:lower:]'|sed -e 's/ //g;'`
Adrian Schröter c6aa47
# note: VERSION is an optional field and has no meaning other than informative on a rolling distro
Adrian Schröter c6aa47
# We do thus not add it to the os-release file
Adrian Schröter c6aa47
cat > %{buildroot}%{_prefix}/lib/os-release <
Adrian Schröter c6aa47
NAME="ALP"
Adrian Schröter c6aa47
# VERSION="%{version}%{?betaversion: %{betaversion}}"
Adrian Schröter c6aa47
ID="alp"
Adrian Schröter c6aa47
ID_LIKE="suse opensuse opensuse-tumbleweed"
Adrian Schröter c6aa47
VERSION_ID="$VERSION_ID"
Adrian Schröter c6aa47
PRETTY_NAME="ALP"
Adrian Schröter c6aa47
ANSI_COLOR="0;32"
Adrian Schröter c6aa47
CPE_NAME="cpe:/o:suse:alp:%{version}"
Adrian Schröter c6aa47
BUG_REPORT_URL="https://bugs.opensuse.org"
Adrian Schröter c6aa47
HOME_URL="https://www.opensuse.org/"
Adrian Schröter c6aa47
# DOCUMENTATION_URL="https://en.opensuse.org/Portal:ALP"
Adrian Schröter c6aa47
LOGO="distributor-logo"
Adrian Schröter c6aa47
EOF
Adrian Schröter c6aa47
ln -s ..%{_prefix}/lib/os-release %{buildroot}%{_sysconfdir}/os-release
Adrian Schröter c6aa47
Adrian Schröter e38391
mkdir -p %{buildroot}%{_prefix}/lib/motd.d/
Adrian Schröter e38391
echo "Have a lot of fun..." > %{buildroot}%{_prefix}/lib/motd.d/welcome
Adrian Schröter e38391
# Bug 404141 - /etc/YaST/control.xml should be owned by some package
Adrian Schröter e38391
mkdir -p %{buildroot}%{_sysconfdir}/YaST2/
Adrian Schröter e38391
echo %{buildroot}
Adrian Schröter e38391
if [ -f /CD1/control.xml ]; then
Adrian Schröter e38391
  install -m 644 /CD1/control.xml %{buildroot}%{_sysconfdir}/YaST2/
Adrian Schröter e38391
elif [ -f %{_prefix}/lib/skelcd/CD1/control.xml ]; then
Adrian Schröter e38391
  install -m 644 %{_prefix}/lib/skelcd/CD1/control.xml %{buildroot}%{_sysconfdir}/YaST2/
Adrian Schröter e38391
fi
Adrian Schröter e38391
Adrian Schröter e38391
# enable vendor change openSUSE,SUSE for DUP from 15.3 to TW (boo#1198332)
Adrian Schröter e38391
mkdir -p %{buildroot}%{_sysconfdir}/zypp/vendors.d
Adrian Schröter e38391
echo -e "[main]\nvendors=openSUSE,SUSE,SUSE LLC <https://www.suse.com/>\n" > %{buildroot}%{_sysconfdir}/zypp/vendors.d/00-openSUSE.conf
Adrian Schröter e38391
Adrian Schröter e38391
Adrian Schröter e38391
# fate#319341, make openSUSE-release own YaST license files. TODO:
Adrian Schröter e38391
# get rid of /etc/YaST2/licenses
Adrian Schröter e38391
install -D -d -m 755 "%{buildroot}%_defaultlicensedir/product/base"
Adrian Schröter e38391
install -D -d -m 755 "%{buildroot}%_defaultlicensedir"
Adrian Schröter e38391
cp -a license "%{buildroot}%_defaultlicensedir/%name"
Adrian Schröter e38391
pushd license
Adrian Schröter e38391
for i in *; do
Adrian Schröter e38391
	ln -s "%_defaultlicensedir/%name/$i" %{buildroot}%_defaultlicensedir/product/base/$i
Adrian Schröter e38391
done
Adrian Schröter e38391
Adrian Schröter c6aa47
mkdir -p %{buildroot}%{_sysconfdir}/products.d
Adrian Schröter c6aa47
cat >%{buildroot}%{_sysconfdir}/products.d/ALP.prod << EOF
Adrian Schröter c6aa47
Adrian Schröter c6aa47
<product schemeversion="0">
Adrian Schröter c6aa47
  <vendor>SUSE</vendor>
Adrian Schröter c6aa47
  <name>ALP</name>
Adrian Schröter c6aa47
  <version>0.1</version>
Adrian Schröter c6aa47
  <release>0</release>
Adrian Schröter c6aa47
  <endoflife></endoflife>
Adrian Schröter c6aa47
  <arch>%{_target_cpu}</arch>
Adrian Schröter c6aa47
  <cpeid>cpe:/o:suse:alp:0.1</cpeid>
Adrian Schröter c6aa47
  <productline>ALP</productline>
Adrian Schröter c6aa47
  <register>
Adrian Schröter c6aa47
    <pool>
Adrian Schröter c6aa47
    </pool>
Adrian Schröter c6aa47
    <updates>
Adrian Schröter c6aa47
    </updates>
Adrian Schröter c6aa47
  </register>
Adrian Schröter c6aa47
  <repositories>
Adrian Schröter c6aa47
  </repositories>
Adrian Schröter c6aa47
  <summary>Adaptable Linux Platform</summary>
Adrian Schröter c6aa47
  <shortsummary>ALP</shortsummary>
Adrian Schröter c6aa47
  <description/>
Adrian Schröter c6aa47
  <linguas>
Adrian Schröter c6aa47
    <language>en_US</language>
Adrian Schröter c6aa47
  </linguas>
Adrian Schröter c6aa47
  <urls>
Adrian Schröter 73139d
    <url name="repository">http://download.opensuse.org/repositories/SUSE:/ALP:/standard/</url>
Adrian Schröter c6aa47
  </urls>
Adrian Schröter c6aa47
  <buildconfig>
Adrian Schröter c6aa47
    <producttheme>ALP</producttheme>
Adrian Schröter c6aa47
    <create_flavors>false</create_flavors>
Adrian Schröter c6aa47
  </buildconfig>
Adrian Schröter c6aa47
  <installconfig>
Adrian Schröter c6aa47
    <defaultlang>en_US</defaultlang>
Adrian Schröter c6aa47
    <datadir>suse</datadir>
Adrian Schröter c6aa47
    <descriptiondir>suse/setup/descr</descriptiondir>
Adrian Schröter c6aa47
    <default_obs_repository_name>openSUSE_Tumbleweed</default_obs_repository_name>
Adrian Schröter c6aa47
    <default_obs_download_url>%{_download_url}</default_obs_download_url>
Adrian Schröter c6aa47
    <releasepackage name="%{name}" flag="EQ" version="%{version}" release="%{release}"/>
Adrian Schröter c6aa47
    <distribution>SUSE</distribution>
Adrian Schröter c6aa47
  </installconfig>
Adrian Schröter c6aa47
  <runtimeconfig/>
Adrian Schröter c6aa47
</product>
Adrian Schröter c6aa47
Adrian Schröter c6aa47
EOF
Adrian Schröter c6aa47
Adrian Schröter c6aa47
Adrian Schröter e38391
# this is a base product, create symlink
Adrian Schröter e38391
ln -s ALP.prod %{buildroot}%{_sysconfdir}/products.d/baseproduct
Adrian Schröter c6aa47
Adrian Schröter e38391
%posttrans
Adrian Schröter e38391
# Launch the issue-generator: we have a new config file in /usr/lib/issue.d that needs to be represented
Adrian Schröter e38391
if [ -x %{_sbindir}/issue-generator ]; then
Adrian Schröter e38391
    if [ -x %{_bindir}/systemd-tmpfiles ]; then
Adrian Schröter e38391
      %{_bindir}/systemd-tmpfiles --create issue-generator.conf || :
Adrian Schröter c6aa47
    fi
Adrian Schröter e38391
    %{_sbindir}/issue-generator || :
Adrian Schröter c6aa47
fi
Adrian Schröter c6aa47
Adrian Schröter c6aa47
%files
Adrian Schröter c6aa47
%defattr(644,root,root,755)
Adrian Schröter e38391
%dir %_defaultlicensedir/product
Adrian Schröter e38391
%_defaultlicensedir/product/base
Adrian Schröter e38391
%license license/*
Adrian Schröter c6aa47
%{_sysconfdir}/os-release
Adrian Schröter c6aa47
%{_prefix}/lib/os-release
Adrian Schröter e38391
# Bug 404141 - /etc/YaST/control.xml should be owned by some package
Adrian Schröter c6aa47
%dir %{_sysconfdir}/YaST2/
Adrian Schröter e38391
%config %{_sysconfdir}/YaST2/control.xml
Adrian Schröter e38391
%dir %{_sysconfdir}/zypp
Adrian Schröter e38391
%dir %{_sysconfdir}/zypp/vendors.d
Adrian Schröter e38391
%config %{_sysconfdir}/zypp/vendors.d/00-openSUSE.conf
Adrian Schröter e38391
%{_prefix}/lib/motd.d/welcome
Adrian Schröter e38391
%dir %{_prefix}/lib/issue.d/
Adrian Schröter e38391
%{_prefix}/lib/issue.d/10-ALP.conf
Adrian Schröter e38391
%{_prefix}/lib/issue.d/90-ALP.conf
Adrian Schröter e38391
%config(noreplace) %{_sysconfdir}/issue.net
Adrian Schröter e38391
%{_sysconfdir}/products.d
Adrian Schröter c6aa47
Adrian Schröter c6aa47
%changelog