File icewm-theme-branding.spec of Package icewm-theme-branding

#
# spec file for package icewm-theme-branding
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           icewm-theme-branding
Version:        1.0
Release:        1.0
Summary:        Icewm theme branding for SLES or openSUSE
License:        LGPL-2.1+ and GPL-3.0+
Group:          System/GUI/Other
Source:         zpaker.tar.bz2
Source1:        start.xpm.new
Source2:        theme
#Source3:        startup
Source4:        menu.new
Source5:        toolbar.new
Source6:        gnome-terminal_16x16.xpm
Source7:        gnome-terminal_32x32.xpm
#Source8:        org.gnome.desktop.background.gschema.override
Source9:        COPYING
Source10:       keys.new
Source11:       startup.new
Requires:       icewm
BuildRequires:  icewm
#BuildRequires:  gnome-shell
#BuildRequires:  gnome-common
#BuildRequires:  gobject-introspection
#BuildRequires:  intltool
#Requires:       dconf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package is made for SLE or openSUSE customization of icewm, including the system default theme,background etc.

%prep
%setup -q -n zpaker
cp -a %{S:1} %{_builddir}
cp -a %{S:2} %{_builddir}
#cp -a %{S:3} %{_builddir}
cp -a %{S:4} %{_builddir}
cp -a %{S:5} %{_builddir}
cp -a %{S:6} %{_builddir}
cp -a %{S:7} %{_builddir}
#cp -a %{S:8} %{_builddir}
cp -a %{S:9} %{_builddir}
cp -a %{S:10} %{_builddir}
cp -a %{S:11} %{_builddir}

%build

%install
# add a new theme into system and make it as a default one
install -d $RPM_BUILD_ROOT%{_datadir}/icewm/themes/zpaker
install -d $RPM_BUILD_ROOT%{_datadir}/icewm/themes/zpaker/icons/ $RPM_BUILD_ROOT%{_datadir}/icewm/themes/zpaker/mailbox/ $RPM_BUILD_ROOT%{_datadir}/icewm/themes/zpaker/taskbar/
cp -a  %{_builddir}/zpaker/  $RPM_BUILD_ROOT%{_datadir}/icewm/themes/

install -d $RPM_BUILD_ROOT%{_sysconfdir}/icewm/
install -m0644 %{_builddir}/theme $RPM_BUILD_ROOT%{_sysconfdir}/icewm/

# install the new start icon of openSUSE
install -d $RPM_BUILD_ROOT%{_datadir}/icewm/taskbar/
install -m0644 %{_builddir}/start.xpm.new $RPM_BUILD_ROOT%{_datadir}/icewm/taskbar/

# make desktop icon visible
#install -d $RPM_BUILD_ROOT%{_sysconfdir}/icewm
#install -m0755 %{_builddir}/startup $RPM_BUILD_ROOT%{_sysconfdir}/icewm/

#install -d $RPM_BUILD_ROOT%{_datadir}/glib-2.0/schemas/
#install -m0644 %{_builddir}/org.gnome.desktop.background.gschema.override $RPM_BUILD_ROOT%{_datadir}/glib-2.0/schemas/

# move the suse menu to the first level
#install -m0755 %{_builddir}/icewm-update-menu.conf $RPM_BUILD_ROOT%{_sysconfdir}/icewm/
install -m0644 %{_builddir}/menu.new $RPM_BUILD_ROOT%{_sysconfdir}/icewm/

# replace the xterm with gnome-terminal
install -m0644 %{_builddir}/toolbar.new $RPM_BUILD_ROOT%{_sysconfdir}/icewm/
install -m0644 %{_builddir}/keys.new $RPM_BUILD_ROOT%{_sysconfdir}/icewm/
install -m0755 %{_builddir}/startup.new $RPM_BUILD_ROOT%{_sysconfdir}/icewm/
install -d $RPM_BUILD_ROOT%{_datadir}/icewm/icons/
install -m0644 %{_builddir}/gnome-terminal_16x16.xpm $RPM_BUILD_ROOT%{_datadir}/icewm/icons/
install -m0644 %{_builddir}/gnome-terminal_32x32.xpm $RPM_BUILD_ROOT%{_datadir}/icewm/icons/

%pre

# set the gnome configuration for showing desktop icons, commentting this command for further study on handling the dconf
%post
#%glib2_gsettings_schema_post
# update menu,toolbar and start icon
cp -a %{_datadir}/icewm/taskbar/start.xpm %{_datadir}/icewm/taskbar/start.xpm.orig
cp -a %{_sysconfdir}/icewm/menu %{_sysconfdir}/icewm/menu.orig
cp -a %{_sysconfdir}/icewm/toolbar %{_sysconfdir}/icewm/toolbar.orig
cp -a %{_sysconfdir}/icewm/keys %{_sysconfdir}/icewm/keys.orig

cp -a %{_datadir}/icewm/taskbar/start.xpm.new %{_datadir}/icewm/taskbar/start.xpm
cp -a %{_sysconfdir}/icewm/menu.new %{_sysconfdir}/icewm/menu
cp -a %{_sysconfdir}/icewm/toolbar.new %{_sysconfdir}/icewm/toolbar
cp -a %{_sysconfdir}/icewm/keys.new %{_sysconfdir}/icewm/keys
cp -a %{_sysconfdir}/icewm/startup.new %{_sysconfdir}/icewm/startup

%postun
#%glib2_gsettings_schema_postun

%files
%defattr(-,root,root)
%doc COPYING
%dir %{_datadir}/icewm/themes/zpaker
%{_datadir}/icewm/themes/zpaker/*
%config %{_sysconfdir}/icewm/theme
#%config %{_sysconfdir}/icewm/startup
%{_datadir}/icewm/taskbar/start.xpm.new
#%{_datadir}/glib-2.0/schemas/org.gnome.desktop.background.gschema.override
%config %{_sysconfdir}/icewm/startup.new
%config %{_sysconfdir}/icewm/toolbar.new
%config %{_sysconfdir}/icewm/menu.new
%config %{_sysconfdir}/icewm/keys.new
%{_datadir}/icewm/icons/gnome-terminal_16x16.xpm
%{_datadir}/icewm/icons/gnome-terminal_32x32.xpm

%changelog