- rewrite spec file to simplify building different flavors (bsc#1039285)

OBS-URL: https://build.opensuse.org/package/show/system:install:head/installation-images?expand=0&rev=1026
This commit is contained in:
Steffen Winterfeldt 2017-05-29 08:18:00 +00:00 committed by Git OBS Bridge
parent c62485dbdf
commit 26153273cf
2 changed files with 77 additions and 53 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon May 29 10:16:28 CEST 2017 - snwint@suse.de
- rewrite spec file to simplify building different flavors (bsc#1039285)
------------------------------------------------------------------- -------------------------------------------------------------------
Tue May 16 10:28:55 CEST 2017 - snwint@suse.de Tue May 16 10:28:55 CEST 2017 - snwint@suse.de

View File

@ -22,7 +22,6 @@
ExclusiveArch: do_not_build ExclusiveArch: do_not_build
%endif %endif
# xxx
%global flavor @BUILD_FLAVOR@%nil %global flavor @BUILD_FLAVOR@%nil
%define with_vbox 0 %define with_vbox 0
@ -33,30 +32,47 @@ ExclusiveArch: do_not_build
%bcond_with xen %bcond_with xen
%bcond_with xenkmp %bcond_with xenkmp
# === sort out branding === # === sort out which flavor to build ===
%if "%flavor" == "openSUSE"
%if 0%{?is_opensuse} %if 0%{?is_opensuse}
%if "%flavor" == "Kubic"
%if 0%{?sle_version}
# don't build on Leap for now
ExclusiveArch: do_not_build
%endif
%define theme Kubic
%define product_nameX %{theme}-%{_target_cpu}
%define branding_skelcd CAASP
%define branding_systemd CAASP
%define branding_plymouth openSUSE
%define branding_grub2 openSUSE
%define branding_gfxboot openSUSE
BuildRequires: openSUSE-Kubic-release
%ifnarch s390x
BuildRequires: xf86-input-libinput
%endif
%else
%if "%flavor" != "openSUSE"
ExclusiveArch: do_not_build
%endif
%define theme openSUSE %define theme openSUSE
%define product_nameX %{theme}-%{_target_cpu} %endif
%endif
%if "%flavor" == "Kubic"
# don't build on Leap for now
%if 0%{?is_opensuse} && !0%{?sle_version}
%define theme Kubic
%endif
%endif
%if "%flavor" == "SLED"
# build SLED only on x86_64
%if "%{_target_cpu}" == "x86_64" && 0%{?sle_version} && !0%{?is_opensuse}
%define theme SLED
%endif
%endif
%if "%flavor" == "SLES"
%if 0%{?sle_version} && !0%{?is_opensuse}
%define theme SLES
%endif
%endif
%if "%flavor" == "CAASP"
%if 0%{?is_susecaasp}
%define theme CAASP
%endif
%endif
# === define each theme ===
%if "%{?theme}" == ""
ExclusiveArch: do_not_build
%endif
%if "%theme" == "openSUSE"
%define branding_skelcd openSUSE %define branding_skelcd openSUSE
%define branding_systemd openSUSE %define branding_systemd openSUSE
%define branding_plymouth openSUSE %define branding_plymouth openSUSE
@ -67,28 +83,33 @@ BuildRequires: openSUSE-release
BuildRequires: xf86-input-libinput BuildRequires: xf86-input-libinput
%endif %endif
%endif %endif
%else
%if 0%{?is_susecaasp} %if "%theme" == "Kubic"
%if "%flavor" != "CAASP"
ExclusiveArch: do_not_build
%endif
%define theme CAASP
%define product_nameX %{theme}-%{_target_cpu}
%define branding_skelcd CAASP %define branding_skelcd CAASP
%define branding_systemd CAASP %define branding_systemd CAASP
%define branding_plymouth openSUSE
%define branding_grub2 openSUSE
%define branding_gfxboot openSUSE
BuildRequires: openSUSE-Kubic-release
%ifnarch s390x
BuildRequires: xf86-input-libinput
%endif
%endif
%if "%theme" == "SLED"
%define branding_skelcd SLED
%define branding_systemd SLE
%define branding_plymouth SLE %define branding_plymouth SLE
%define branding_grub2 SLE %define branding_grub2 SLE
%define branding_gfxboot SLE %define branding_gfxboot SLE
%define config_bootmenu_no_upgrade 1 BuildRequires: sled-release
BuildRequires: caasp-release BuildRequires: sled-release-DVD
BuildRequires: caasp-release-DVD %if 0%{?sle_version} != 0150000
%else BuildRequires: sle12-desktop-migration
%if "%flavor" != "SLES" && "%flavor" != "SLED"
ExclusiveArch: do_not_build
%endif %endif
%if "%flavor" == "SLES" %endif
%define theme SLES
%define product_nameX %{theme}-%{_target_cpu} %if "%theme" == "SLES"
%define branding_skelcd SLES %define branding_skelcd SLES
%define branding_systemd SLE %define branding_systemd SLE
%define branding_plymouth SLE %define branding_plymouth SLE
@ -103,27 +124,24 @@ BuildRequires: sap-installation-wizard
%endif %endif
%endif %endif
%endif %endif
%if "%flavor" == "SLED"
# SLED is x86_64 only %if "%theme" == "CAASP"
ExclusiveArch: x86_64 %define branding_skelcd CAASP
%define theme SLED %define branding_systemd CAASP
%define product_nameX %{theme}-%{_target_cpu}
%define branding_skelcd SLED
%define branding_systemd SLE
%define branding_plymouth SLE %define branding_plymouth SLE
%define branding_grub2 SLE %define branding_grub2 SLE
%define branding_gfxboot SLE %define branding_gfxboot SLE
BuildRequires: sled-release %define config_bootmenu_no_upgrade 1
BuildRequires: sled-release-DVD BuildRequires: caasp-release
%if 0%{?sle_version} != 0150000 BuildRequires: caasp-release-DVD
BuildRequires: sle12-desktop-migration
%endif
%endif
%endif
%endif %endif
# === set product string (based on required packages) ===
%global product_name %(bash %_sourcedir/product_name)-%{_target_cpu} %global product_name %(bash %_sourcedir/product_name)-%{_target_cpu}
# === branding specific packages ===
BuildRequires: skelcd-control-%branding_skelcd BuildRequires: skelcd-control-%branding_skelcd
BuildRequires: systemd-presets-branding-%branding_systemd BuildRequires: systemd-presets-branding-%branding_systemd
%if %with_plymouth %if %with_plymouth
@ -135,6 +153,7 @@ BuildRequires: gfxboot-branding-%branding_gfxboot
%ifarch %ix86 x86_64 aarch64 %ifarch %ix86 x86_64 aarch64
BuildRequires: grub2-branding-%branding_grub2 BuildRequires: grub2-branding-%branding_grub2
%endif %endif
# === branding end === # === branding end ===
# no i586 in Leap # no i586 in Leap