Sisyphus repository
Last update: 6 august 2020 | SRPMs: 17676 | Visits: 19010722
en ru br
ALT Linux repos

Group :: Graphical desktop/KDE
RPM: alt-customize-branding

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define rname alt-customize-branding

Name: %rname
Version: 1.1.0
Release: alt1
%K5init altplace

#Group: Graphics

Group: Graphical desktop/KDE
Summary: Customize branding tool
License: GPL-3.0-or-later
Source: %rname-%version.tar

ExcludeArch: armh

BuildRequires(pre): rpm-build-kf5

BuildRequires: extra-cmake-modules
BuildRequires: qt5-base-devel
BuildRequires: libImageMagick-devel
BuildRequires: kf5-kcmutils-devel
BuildRequires: kf5-ki18n-devel
BuildRequires: kf5-kio-devel
BuildRequires: qt5-tools
BuildRequires: kf5-kwindowsystem-devel
Requires: qt5-translations convert
Requires: %rname-backend

The ALT tool for KDE to customize branding

%package backend
Summary: Customize branding tool backend
License: GPL-3.0-or-later
Group: System/Configuration/Boot and Init
%description backend
The ALT tool backend for KDE to customize branding

%setup -n %rname-%version

lrelease-qt5 translations/alt-customize-branding_ru_RU.ts


# translations

mkdir -p %buildroot/%_qt5_translationdir/
install -m 0644 translations/*.qm %buildroot/%_qt5_translationdir/

# branding_helper script

install -m 0755 altcusbranding_helper_script %buildroot/%_K5libexecdir/kauth/

# alt-customize-branding-settings.ini

mkdir -p %buildroot%_localstatedir/%rname
#install -m 0644 %%rname-settings.ini %%buildroot%%_localstatedir/%%rname/

# alternatives

mkdir -p %buildroot%_altdir
install -m 0644 %rname %buildroot%_altdir/

# branding directories

mkdir -p %buildroot/boot/grub/themes/%rname
mkdir -p %buildroot%_datadir/design/%rname
mkdir -p %buildroot%_datadir/plymouth/themes/%rname

%find_lang --with-qt --all-name %rname

%postun backend
if [ $1 -eq 0 ] ; then
   %define configFile alt-customize-branding-settings.ini
   %define configDir /var/lib
   if [ -f %configDir/%rname/%configFile ] ; then
       previousThemeName=$(awk -F "=" '/ThemeName/ {print $2}' %configDir/%rname/%configFile)
       echo Previous theme name: $previousThemeName
# Change /etc/sysconfig/grub2 and run
       . shell-config
       shell_config_set /etc/sysconfig/grub2 GRUB_THEME /boot/grub/themes/$previousThemeName/theme.txt
       shell_config_set /etc/sysconfig/grub2 GRUB_BACKGROUND /boot/grub/themes/$previousThemeName/grub.png
       shell_config_set /etc/sysconfig/grub2 GRUB_WALLPAPER /boot/grub/themes/$previousThemeName/grub.png
# generate file "/boot/grub/grub.cfg"
       /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg
# Change theme name in file 'plymouthd.conf':
       sed -i "s/Theme=.*/Theme=$previousThemeName/" /etc/plymouth/plymouthd.conf
# Remove directories
#rm -R %%_localstatedir/%%rname
   if [ -d "/usr/share/design/%rname" ]; then
       rm -R /usr/share/design/%rname
   if [ -d "/boot/grub/themes/%rname" ]; then
       rm -R /boot/grub/themes/%rname
   if [ -d "/usr/share/plymouth/themes/%rname" ]; then
       rm -R /usr/share/plymouth/themes/%rname
   if [ -d "/tmp/%rname" ]; then
       rm -R /tmp/%rname
# Toggle/repair alternatives

%files -f %rname.lang

%files backend


#%%doc README


Full changelog you can see here

design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin