[calamares] Automatically generate the branding to use by default

Kevin Kofler kkofler at fedoraproject.org
Thu Nov 20 03:32:59 UTC 2014


commit d99ca50f8cac0177429964ccddb7e7f0feb17f23
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date:   Thu Nov 20 04:32:42 2014 +0100

    Automatically generate the branding to use by default
    
    * Thu Nov 20 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 0-0.16.20141119git01c3244396f35
    - Automatically generate the branding to use by default (new "auto" branding)
    - Remove README.branding, no longer needed

 README.branding                  |   44 ---------------------------
 calamares-default-settings.patch |   42 +++++++++++++++-----------
 calamares.spec                   |   61 ++++++++++++++++++++++++++++++++++----
 3 files changed, 79 insertions(+), 68 deletions(-)
---
diff --git a/calamares-default-settings.patch b/calamares-default-settings.patch
index 44226fe..e9796a1 100644
--- a/calamares-default-settings.patch
+++ b/calamares-default-settings.patch
@@ -1,6 +1,6 @@
-diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/settings.conf calamares-default-settings/settings.conf
---- calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/settings.conf	2014-11-15 04:44:09.000000000 +0100
-+++ calamares-default-settings/settings.conf	2014-11-15 04:36:58.000000000 +0100
+diff -ur calamares-01c3244396f3510467f405719ce7ec17403d2d83/settings.conf calamares-default-settings/settings.conf
+--- calamares-01c3244396f3510467f405719ce7ec17403d2d83/settings.conf	2014-11-19 17:20:06.000000000 +0100
++++ calamares-default-settings/settings.conf	2014-11-20 04:20:00.000000000 +0100
 @@ -4,7 +4,7 @@
  # Modules can be job modules (with different interfaces) and QtWidgets view modules.
  # They could all be placed in a number of different paths.
@@ -29,9 +29,15 @@ diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/settings.conf calama
  #- initramfs
  - grubcfg
  - grub
-diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/displaymanager/displaymanager.conf calamares-default-settings/src/modules/displaymanager/displaymanager.conf
---- calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/displaymanager/displaymanager.conf	2014-11-15 04:44:09.000000000 +0100
-+++ calamares-default-settings/src/modules/displaymanager/displaymanager.conf	2014-11-15 04:48:36.000000000 +0100
+@@ -66,4 +66,4 @@
+ # paths relative to the current directory.
+ # Only the name of the branding component (directory) should be specified here, Calamares
+ # then takes care of finding it and loading the contents.
+-branding: default
++branding: auto
+diff -ur calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/displaymanager/displaymanager.conf calamares-default-settings/src/modules/displaymanager/displaymanager.conf
+--- calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/displaymanager/displaymanager.conf	2014-11-19 17:20:06.000000000 +0100
++++ calamares-default-settings/src/modules/displaymanager/displaymanager.conf	2014-11-20 04:19:38.000000000 +0100
 @@ -3,10 +3,4 @@
  #It also sets up autologin, if the feature is enabled in globalstorage.
  #The displaymanagers list can also be set in globalstorage, and in that case it overrides anything set up here.
@@ -43,9 +49,9 @@ diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/displaym
 -  - mdm
 -  - lxdm
 -  - kdm
-diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/grub/grub.conf calamares-default-settings/src/modules/grub/grub.conf
---- calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/grub/grub.conf	2014-11-15 04:44:09.000000000 +0100
-+++ calamares-default-settings/src/modules/grub/grub.conf	2014-11-15 04:48:36.000000000 +0100
+diff -ur calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/grub/grub.conf calamares-default-settings/src/modules/grub/grub.conf
+--- calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/grub/grub.conf	2014-11-19 17:20:06.000000000 +0100
++++ calamares-default-settings/src/modules/grub/grub.conf	2014-11-20 04:19:38.000000000 +0100
 @@ -1,6 +1,6 @@
  ---
  # GRUB 2 binary names and boot directory
@@ -56,9 +62,9 @@ diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/grub/gru
 +grubInstall: "grub2-install"
 +grubMkconfig: "grub2-mkconfig"
 +grubCfg: "/boot/grub2/grub.cfg"
-diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/locale/locale.conf calamares-default-settings/src/modules/locale/locale.conf
---- calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/locale/locale.conf	2014-11-15 04:44:09.000000000 +0100
-+++ calamares-default-settings/src/modules/locale/locale.conf	2014-11-15 04:48:36.000000000 +0100
+diff -ur calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/locale/locale.conf calamares-default-settings/src/modules/locale/locale.conf
+--- calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/locale/locale.conf	2014-11-19 17:20:06.000000000 +0100
++++ calamares-default-settings/src/modules/locale/locale.conf	2014-11-20 04:19:38.000000000 +0100
 @@ -1,3 +1,4 @@
  ---
 -region:     "Europe"
@@ -66,9 +72,9 @@ diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/locale/l
 +# default to UTC
 +region:     "Atlantic"
 +zone:       "Reykjavik"
-diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/unpackfs/unpackfs.conf calamares-default-settings/src/modules/unpackfs/unpackfs.conf
---- calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/unpackfs/unpackfs.conf	2014-11-15 04:44:09.000000000 +0100
-+++ calamares-default-settings/src/modules/unpackfs/unpackfs.conf	2014-11-15 04:48:36.000000000 +0100
+diff -ur calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/unpackfs/unpackfs.conf calamares-default-settings/src/modules/unpackfs/unpackfs.conf
+--- calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/unpackfs/unpackfs.conf	2014-11-19 17:20:06.000000000 +0100
++++ calamares-default-settings/src/modules/unpackfs/unpackfs.conf	2014-11-20 04:19:38.000000000 +0100
 @@ -1,8 +1,5 @@
  ---
  unpack:
@@ -79,9 +85,9 @@ diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/unpackfs
 -    -   source: "/path/to/another/filesystem.sqfs"
 -        sourcefs: "squashfs"
 -        destination: ""
-diff -ur calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/users/users.conf calamares-default-settings/src/modules/users/users.conf
---- calamares-6b2ccfb442defc1ffeb9359edd892aae5335b838/src/modules/users/users.conf	2014-11-15 04:44:09.000000000 +0100
-+++ calamares-default-settings/src/modules/users/users.conf	2014-11-15 04:48:36.000000000 +0100
+diff -ur calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/users/users.conf calamares-default-settings/src/modules/users/users.conf
+--- calamares-01c3244396f3510467f405719ce7ec17403d2d83/src/modules/users/users.conf	2014-11-19 17:20:06.000000000 +0100
++++ calamares-default-settings/src/modules/users/users.conf	2014-11-20 04:19:38.000000000 +0100
 @@ -3,8 +3,7 @@
  defaultGroups:
      - lp
diff --git a/calamares.spec b/calamares.spec
index 5533f0c..b80f461 100644
--- a/calamares.spec
+++ b/calamares.spec
@@ -4,15 +4,13 @@
 
 Name:           calamares
 Version:        0
-Release:        0.15.%{snapdate}git%(echo %{snaphash} | cut -c -13)%{?dist}
+Release:        0.16.%{snapdate}git%(echo %{snaphash} | cut -c -13)%{?dist}
 Summary:        Installer from a live CD/DVD/USB to disk
 
 License:        GPLv3+
 URL:            http://calamares.github.io/
 Source0:        https://github.com/calamares/calamares/archive/%{snaphash}/calamares-%{snaphash}.tar.gz
 Source1:        https://github.com/calamares/partitionmanager/archive/%{partitionmanagerhash}/calamares-partitionmanager-%{partitionmanagerhash}.tar.gz
-# documentation file describing how to rebrand Calamares
-Source2:        README.branding
 
 # adjust some default settings (default shipped .conf files)
 Patch0:         calamares-default-settings.patch
@@ -48,6 +46,11 @@ BuildRequires:  parted-devel
 
 BuildRequires:  desktop-file-utils
 
+# for automatic branding setup
+Requires(post): system-release
+Requires(post): system-logos
+Requires:       system-logos
+
 Requires:       coreutils
 Requires:       util-linux
 Requires:       sddm
@@ -98,7 +101,6 @@ developing custom modules for Calamares.
 %setup -q -n %{name}-%{snaphash} -a 1
 rmdir src/modules/partition/partitionmanager
 mv -f partitionmanager-%{partitionmanagerhash} src/modules/partition/partitionmanager
-cp -pf %{SOURCE2} .
 %patch0 -p1 -b .default-settings
 %patch1 -p1 -b .desktop-file
 # delete backup files so they don't get installed
@@ -114,6 +116,9 @@ make %{?_smp_mflags} -C %{_target_platform}
 
 %install
 make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
+# own the auto branding directory
+mkdir -p %{buildroot}%{_datadir}/calamares/branding/auto
+touch %{buildroot}%{_datadir}/calamares/branding/auto/branding.desc
 # own the local settings directories
 mkdir -p %{buildroot}%{_sysconfdir}/calamares/modules
 mkdir -p %{buildroot}%{_sysconfdir}/calamares/branding
@@ -122,10 +127,50 @@ mkdir -p %{buildroot}%{_sysconfdir}/calamares/branding
 # validate the .desktop file
 desktop-file-validate %{buildroot}%{_datadir}/applications/calamares.desktop
 
+%post
+# generate the "auto" branding
+. %{_sysconfdir}/os-release
+
+LOGO=%{_datadir}/pixmaps/fedora-logo.png
+
+if [ -e %{_datadir}/pixmaps/fedora-logo-sprite.png ] ; then
+  SPRITE="%{_datadir}/pixmaps/fedora-logo-sprite.png"
+else
+  SPRITE="%{_datadir}/calamares/branding/default/squid.png"
+fi
+
+cat >%{_datadir}/calamares/branding/auto/branding.desc <<EOF
+# THIS FILE IS AUTOMATICALLY GENERATED! ANY CHANGES TO THIS FILE WILL BE LOST!
+---
+componentName:  auto
+
+strings:
+    productName:         "$NAME"
+    shortProductName:    "$NAME"
+    version:             "$VERSION"
+    shortVersion:        "$VERSION_ID"
+    versionedName:       "$NAME $VERSION"
+    shortVersionedName:  "$NAME $VERSION_ID"
+    bootloaderEntryName: "$NAME"
+
+images:
+    productLogo:         "$LOGO"
+    productIcon:         "$SPRITE"
+
+slideshow:
+    - "$LOGO"
+EOF
+
 %files
-%doc LICENSE AUTHORS README.branding
+%doc LICENSE AUTHORS
 %{_bindir}/calamares
-%{_datadir}/calamares/
+%dir %{_datadir}/calamares/
+%{_datadir}/calamares/settings.conf
+%dir %{_datadir}/calamares/branding/
+%{_datadir}/calamares/branding/default/
+%dir %{_datadir}/calamares/branding/auto/
+%ghost %{_datadir}/calamares/branding/auto/branding.desc
+%{_datadir}/calamares/modules/
 %{_datadir}/applications/calamares.desktop
 %{_datadir}/polkit-1/actions/com.github.calamares.calamares.policy
 %{_sysconfdir}/calamares/
@@ -148,6 +193,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/calamares.desktop
 
 
 %changelog
+* Thu Nov 20 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 0-0.16.20141119git01c3244396f35
+- Automatically generate the branding to use by default (new "auto" branding)
+- Remove README.branding, no longer needed
+
 * Thu Nov 20 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 0-0.15.20141119git01c3244396f35
 - New snapshot, creates /etc/default/grub if missing (calamares#128)
 - README.branding: Mention new bootloaderEntryName setting


More information about the scm-commits mailing list