File glib2-branding-openSUSE.spec of Package glib2-branding-openSUSE
#
# spec file for package glib2-branding-openSUSE
#
# Copyright (c) 2012 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/
#
%define build_for_openSUSE 1
%if %{build_for_openSUSE}
%define build_for_SLE 0
%else
%define build_for_SLE 1
%endif
%if %{build_for_openSUSE}
%define wallpaper_file openSUSE-default.xml
%endif
%if %{build_for_SLE}
%define desktop_data SLED
%define desktop_data_ver 11
%define wallpaper_file SLED110-1600x1200.png
%endif
Name: glib2-branding-openSUSE
Version: 12.2
Release: 0
Summary: General-Purpose Utility Library -- openSUSE default configuration
License: BSD-3-Clause
Group: System/GUI/GNOME
Url: http://www.gtk.org/
Source: %{name}-gnome_defaults.conf
Source1: %{name}-COPYING
Source2: glib2-branding.gschema.override.in
%if %{build_for_openSUSE}
BuildRequires: wallpaper-branding-openSUSE
%endif
%if %{build_for_SLE}
BuildRequires: desktop-data-%{desktop_data}
%endif
BuildRequires: glib2-devel
# We need glib2-branding-upstream else, the call to SuSEconfig.glib2 fails
BuildRequires: glib2-branding-upstream
%define gio_real_package %(rpm -q --qf '%%{name}' --whatprovides gio)
%define gio_version %(rpm -q --qf '%%{version}' %{gio_real_package})
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This package provides openSUSE defaults for settings stored with
GSettings and applications used by the MIME system.
%if %{build_for_openSUSE}
%package -n gio-branding-openSUSE
Summary: openSUSE definitions of default settings and applications
Group: System/GUI/GNOME
# For wallpaper
Requires: wallpaper-branding-openSUSE
Provides: glib2-branding-openSUSE = %{version}
Obsoletes: glib2-branding-openSUSE < %{version}
Requires: %{gio_real_package} = %{gio_version}
Provides: gio-branding = %{gio_version}
Conflicts: otherproviders(gio-branding)
Supplements: packageand(%{gio_real_package}:branding-openSUSE)
%glib2_gsettings_schema_requires
%description -n gio-branding-openSUSE
This package provides openSUSE defaults for settings stored with
GSettings and applications used by the MIME system.
%endif
%if %{build_for_SLE}
%package -n gio-branding-SLED
Summary: SLED definitions of default settings and applications
Group: System/GUI/GNOME
# For wallpaper
Requires: desktop-data-%{desktop_data} = %{desktop_data_ver}
Provides: glib2-branding-SLED = %{version}
Obsoletes: glib2-branding-SLED < %{version}
Requires: %{gio_real_package} = %{gio_version}
Provides: gio-branding = %{gio_version}
Conflicts: otherproviders(gio-branding)
Supplements: packageand(%{gio_real_package}:branding-SLED)
%glib2_gsettings_schema_requires
%description -n gio-branding-SLED
This package provides SLED defaults for settings stored with
GSettings and applications used by the MIME system.
%package -n gio-branding-SLES
Summary: SLES definitions of default settings and applications
Group: System/GUI/GNOME
# For wallpaper
Requires: desktop-data-%{desktop_data} = %{desktop_data_ver}
Provides: glib2-branding-SLES = %{version}
Obsoletes: glib2-branding-SLES < %{version}
Requires: %{gio_real_package} = %{gio_version}
Provides: gio-branding = %{gio_version}
Conflicts: otherproviders(gio-branding)
Supplements: packageand(%{gio_real_package}:branding-SLES)
%glib2_gsettings_schema_requires
%description -n gio-branding-SLES
This package provides SLES defaults for settings stored with
GSettings and applications used by the MIME system.
%endif
%prep
%setup -q -T -c %{name}-%{version}
cp -a %{SOURCE0} gnome_defaults.conf
cp -a %{SOURCE1} COPYING
cp -a %{SOURCE2} glib2-branding.gschema.override.in
%build
test -f %{_datadir}/wallpapers/%{wallpaper_file}
sed "s,@@WALLPAPER_URI@@,file:///usr/share/wallpapers/%{wallpaper_file}," glib2-branding.gschema.override.in > glib2-branding.gschema.override
#for sound theme
%if %{build_for_openSUSE}
sed "s:@@IF_openSUSE@@::g" < glib2-branding.gschema.override | grep -v ^@@IF_ > openSUSE-branding.gschema.override
%endif
%if %{build_for_SLE}
sed "s:@@IF_SLE@@::g;s:@@IF_SLED@@::g" < glib2-branding.gschema.override | grep -v ^@@IF_ > SLED-branding.gschema.override
sed "s:@@IF_SLE@@::g;s:@@IF_SLES@@::g" < glib2-branding.gschema.override | grep -v ^@@IF_ > SLES-branding.gschema.override
%endif
%install
install -d %{buildroot}%{_sysconfdir}
install -m0644 gnome_defaults.conf %{buildroot}%{_sysconfdir}/
install -d %{buildroot}%{_datadir}/glib-2.0/schemas
%if %{build_for_openSUSE}
install -m0644 openSUSE-branding.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/
%endif
%if %{build_for_SLE}
install -m0644 SLED-branding.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/
install -m0644 SLES-branding.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/
%endif
%clean
rm -rf %{buildroot}
%if %{build_for_openSUSE}
%post -n gio-branding-openSUSE
%glib2_gsettings_schema_post
%postun -n gio-branding-openSUSE
%glib2_gsettings_schema_postun
%endif
%if %{build_for_SLE}
%post -n gio-branding-SLED
%glib2_gsettings_schema_post
%postun -n gio-branding-SLED
%glib2_gsettings_schema_postun
%post -n gio-branding-SLES
%glib2_gsettings_schema_post
%postun -n gio-branding-SLES
%glib2_gsettings_schema_postun
%endif
%if %{build_for_openSUSE}
%files -n gio-branding-openSUSE
%defattr (-, root, root)
%doc COPYING
%config (noreplace) %{_sysconfdir}/gnome_defaults.conf
%{_datadir}/glib-2.0/schemas/openSUSE-branding.gschema.override
%endif
%if %{build_for_SLE}
%files -n gio-branding-SLED
%defattr (-, root, root)
%doc COPYING
%config (noreplace) %{_sysconfdir}/gnome_defaults.conf
%{_datadir}/glib-2.0/schemas/SLED-branding.gschema.override
%files -n gio-branding-SLES
%defattr (-, root, root)
%doc COPYING
%config (noreplace) %{_sysconfdir}/gnome_defaults.conf
%{_datadir}/glib-2.0/schemas/SLES-branding.gschema.override
%endif
%changelog