File mate-branding-openSUSE.spec of Package mate-branding-openSUSE

#
# spec file for package mate-branding-openSUSE
#
# 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/
#

%define mate_panel_version %(rpm -q --queryformat '%%{VERSION}' mate-panel)
%define mate_session_manager_version %(rpm -q --queryformat '%%{VERSION}' mate-session-manager)
%define mate_control_center_version %(rpm -q --queryformat '%%{VERSION}' mate-control-center)
%define mate_menus_version %(rpm -q --queryformat '%%{VERSION}' mate-menus)

Name:           mate-branding-openSUSE
Version:        13.2
Release:        0
Summary:        openSUSE Branding of the Mate Desktop Environment
License:        MIT
Group:          System/GUI/Other
Url:            http://www.mate-desktop.org/
Source1:        mate-session-branding-openSUSE-mate_defaults.conf
Source2:        mate-session-branding.gschema.override.in
Source4:        mate-panel-branding.gschema.override.in
Patch0:         mate-control-center-branding-add-YaST.patch
# PATCH-FIX-OPENSUSE mate-menus-branding-remove-X-SuSE-ControlCenter.patch vuntz@opensuse.org -- Remove the desktop files with X-SuSE-YaST category from the Applications menu and explicitly add YaST launcher
Patch1:         mate-menus-branding-remove-X-SuSE-ControlCenter.patch
BuildRequires:  fdupes
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  mate-control-center-branding-upstream
BuildRequires:  mate-menus-branding-upstream
BuildRequires:  mate-panel-branding-upstream
BuildRequires:  mate-session-manager-branding-upstream
BuildRequires:  wallpaper-branding-openSUSE
BuildArch:      noarch

%description
This package provides the openSUSE look and feel for the Mate desktop environment.

%package -n mate-control-center-branding-openSUSE
Summary:        openSUSE Branding of mate-control-center
License:        GPL-2.0+
Group:          System/GUI/Other
Requires:       mate-control-center = %{mate_control_center_version}
Conflicts:      otherproviders(mate-control-center-branding)
Provides:       mate-control-center-branding = %{mate_control_center_version}
Supplements:    packageand(mate-control-center:branding-openSUSE)

%description -n mate-control-center-branding-openSUSE
This package provides the openSUSE definition of what appears in the
control center.

%package -n mate-panel-branding-openSUSE
Summary:        openSUSE Branding of mate-panel
License:        GPL-2.0+
Group:          System/GUI/Other
Requires:       mate-panel = %{mate_panel_version}
Conflicts:      otherproviders(mate-panel-branding)
Provides:       mate-panel-branding = %{mate_panel_version}
Supplements:    packageand(mate-panel:branding-openSUSE)

%description -n mate-panel-branding-openSUSE
This package provides the openSUSE look and feel for the Mate Panel.

%package -n mate-menus-branding-openSUSE
Summary:        openSUSE Branding of mate-menus
License:        GPL-2.0+
Group:          System/GUI/Other
Requires:       mate-menus = %{mate_menus_version}
Conflicts:      otherproviders(mate-menus-branding)
Provides:       mate-menus-branding = %{mate_menus_version}
Supplements:    packageand(mate-menus:branding-openSUSE)

%description -n mate-menus-branding-openSUSE
This package provides the openSUSE definitions for menus.

%package -n mate-session-manager-branding-openSUSE
Summary:        openSUSE Branding of mate-session-manager
License:        GPL-2.0+
Group:          System/GUI/Other
Requires:       gtk3-metatheme-adwaita
Requires:       gtk2-metatheme-adwaita
Requires:       mate-session-manager = %{mate_session_manager_version}
Requires:       wallpaper-branding-openSUSE
Requires:       mate-icon-theme
Conflicts:      otherproviders(mate-session-manager-branding)
Provides:       mate-session-manager-branding = %{mate_session_manager_version}
Supplements:    packageand(mate-session-manager:branding-openSUSE)
%glib2_gsettings_schema_requires

%description -n mate-session-manager-branding-openSUSE
This package provides the openSUSE look and feel for the Mate Session Manager.

%prep
%setup -q -T -c %{name}-%{version}
# Mate Control Center branding part
# We will base the shell content on upstream content:
cp -a %{_sysconfdir}/xdg/menus/*.menu .
%patch0 -p0
# Mate Menus branding part
%patch1 -p0
# Mate Session Manager branding part
cp -a %{SOURCE1} mate_defaults.conf
cp -a %{SOURCE2} mate-session-branding.gschema.override.in
# Mate Panel branding part
cp -a %{SOURCE4} zz-mate-panel-openSUSE-branding.gschema.override

%build
# Mate session manager branding part
test -f %{_datadir}/wallpapers/openSUSE-default.xml
sed "s,@@WALLPAPER_URI@@,%{_datadir}/wallpapers/openSUSEdefault/contents/images/1920x1200.jpg," mate-session-branding.gschema.override.in > mate-session-branding.gschema.override
#for sound theme
sed "s:@@IF_openSUSE@@::g" < mate-session-branding.gschema.override | grep -v ^@@IF_ > zz-mate-session-openSUSE-branding.gschema.override

%install
# Mate Control Center branding part
install -d %{buildroot}%{_sysconfdir}/xdg/menus
install -m0644 *.menu %{buildroot}%{_sysconfdir}/xdg/menus/
# Mate Panel branding part
install -d %{buildroot}%{_datadir}/glib-2.0/schemas
install -m0644 zz-mate-panel-openSUSE-branding.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/
# Mate Session Manager branding part
install -d %{buildroot}%{_sysconfdir}
install -m0644 mate_defaults.conf %{buildroot}%{_sysconfdir}/
install -m0644 zz-mate-session-openSUSE-branding.gschema.override %{buildroot}%{_datadir}/glib-2.0/schemas/
# Remove unwanted menu file
rm -r %{buildroot}%{_sysconfdir}/xdg/menus/mate-settings.menu

%files -n mate-control-center-branding-openSUSE
%defattr (-, root, root)
%config %{_sysconfdir}/xdg/menus/matecc.menu

%files -n mate-menus-branding-openSUSE
%defattr(-,root,root)
%config %{_sysconfdir}/xdg/menus/mate-applications.menu

%files -n mate-panel-branding-openSUSE
%defattr(-,root,root)
%{_datadir}/glib-2.0/schemas/zz-mate-panel-openSUSE-branding.gschema.override

%files -n mate-session-manager-branding-openSUSE
%defattr(-,root,root)
%config (noreplace) %{_sysconfdir}/mate_defaults.conf
%{_datadir}/glib-2.0/schemas/zz-mate-session-openSUSE-branding.gschema.override

%changelog
openSUSE Build Service is sponsored by