diff --git a/installation-images.changes b/installation-images.changes index 1c63ce1..45f9fdd 100644 --- a/installation-images.changes +++ b/installation-images.changes @@ -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 diff --git a/installation-images.spec b/installation-images.spec index b86ea8b..ba71454 100644 --- a/installation-images.spec +++ b/installation-images.spec @@ -22,7 +22,6 @@ ExclusiveArch: do_not_build %endif -# xxx %global flavor @BUILD_FLAVOR@%nil %define with_vbox 0 @@ -33,30 +32,47 @@ ExclusiveArch: do_not_build %bcond_with xen %bcond_with xenkmp -# === sort out branding === +# === sort out which flavor to build === + +%if "%flavor" == "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 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_systemd openSUSE %define branding_plymouth openSUSE @@ -67,28 +83,33 @@ BuildRequires: openSUSE-release BuildRequires: xf86-input-libinput %endif %endif -%else -%if 0%{?is_susecaasp} -%if "%flavor" != "CAASP" -ExclusiveArch: do_not_build -%endif -%define theme CAASP -%define product_nameX %{theme}-%{_target_cpu} + +%if "%theme" == "Kubic" %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 +%endif + +%if "%theme" == "SLED" +%define branding_skelcd SLED +%define branding_systemd SLE %define branding_plymouth SLE %define branding_grub2 SLE %define branding_gfxboot SLE -%define config_bootmenu_no_upgrade 1 -BuildRequires: caasp-release -BuildRequires: caasp-release-DVD -%else -%if "%flavor" != "SLES" && "%flavor" != "SLED" -ExclusiveArch: do_not_build +BuildRequires: sled-release +BuildRequires: sled-release-DVD +%if 0%{?sle_version} != 0150000 +BuildRequires: sle12-desktop-migration %endif -%if "%flavor" == "SLES" -%define theme SLES -%define product_nameX %{theme}-%{_target_cpu} +%endif + +%if "%theme" == "SLES" %define branding_skelcd SLES %define branding_systemd SLE %define branding_plymouth SLE @@ -103,27 +124,24 @@ BuildRequires: sap-installation-wizard %endif %endif %endif -%if "%flavor" == "SLED" -# SLED is x86_64 only -ExclusiveArch: x86_64 -%define theme SLED -%define product_nameX %{theme}-%{_target_cpu} -%define branding_skelcd SLED -%define branding_systemd SLE + +%if "%theme" == "CAASP" +%define branding_skelcd CAASP +%define branding_systemd CAASP %define branding_plymouth SLE %define branding_grub2 SLE %define branding_gfxboot SLE -BuildRequires: sled-release -BuildRequires: sled-release-DVD -%if 0%{?sle_version} != 0150000 -BuildRequires: sle12-desktop-migration -%endif -%endif -%endif +%define config_bootmenu_no_upgrade 1 +BuildRequires: caasp-release +BuildRequires: caasp-release-DVD %endif +# === set product string (based on required packages) === + %global product_name %(bash %_sourcedir/product_name)-%{_target_cpu} +# === branding specific packages === + BuildRequires: skelcd-control-%branding_skelcd BuildRequires: systemd-presets-branding-%branding_systemd %if %with_plymouth @@ -135,6 +153,7 @@ BuildRequires: gfxboot-branding-%branding_gfxboot %ifarch %ix86 x86_64 aarch64 BuildRequires: grub2-branding-%branding_grub2 %endif + # === branding end === # no i586 in Leap