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

#
# spec file for package kde-branding-openSUSE
#
# Copyright (c) 2016 SUSE LINUX 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:           kde-branding-openSUSE
Version:        13.2
Release:        0
Url:            http://github.com/openSUSE/branding
Source0:        openSUSE.tar.xz
Source21:       sysconfig.displaymanager-kdm
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        openSUSE Brand File
License:        BSD-3-Clause
Group:          System/Fhs
BuildRequires:  fribidi
BuildRequires:  kde4-filesystem
BuildRequires:  kdelibs4-branding-upstream
BuildRequires:  update-desktop-files
BuildRequires:  wallpaper-branding-openSUSE
BuildArch:      noarch

%description
This package contains the file /etc/SUSE-brand, and its name is used as
a trigger for installation of correct vendor brand packages.

%define theme_name openSUSE

%package -n kdelibs4-branding-openSUSE
Summary:        openSUSE branding for KDE
Group:          System/GUI/KDE
Requires:       kdelibs4
Supplements:    packageand(kdelibs4:branding-openSUSE)
Provides:       kdelibs4-branding = %{_kde_branding_version}
Conflicts:      otherproviders(kdelibs4-branding)
BuildArch:      noarch

%description -n kdelibs4-branding-openSUSE
openSUSE branding for KDE workspace

%package -n ksplashx-branding-openSUSE
Summary:        openSUSE branding for KDE splash
Group:          System/Fhs
Provides:       ksplashx-branding = %{version}
Conflicts:      otherproviders(ksplashx-branding)
Supplements:    packageand(kdebase4-workspace:branding-openSUSE)
BuildArch:      noarch
# links its images
Requires:       wallpaper-branding-openSUSE

%description -n ksplashx-branding-openSUSE
openSUSE branding for KDE splash (splashx engine)

%package -n ksplash-qml-branding-openSUSE
Summary:        openSUSE branding for KDE splash QML
Group:          System/Fhs
Provides:       ksplash-qml-branding = %{version}
Conflicts:      otherproviders(ksplash-qml-branding)
Supplements:    packageand(kdebase4-workspace:branding-openSUSE)
BuildArch:      noarch
# links its images
Requires:       wallpaper-branding-openSUSE

%description -n ksplash-qml-branding-openSUSE
openSUSE branding for KDE splash (QML engine)

%package -n susegreeter-branding-openSUSE
Summary:        openSUSE branding for the KDE greeter
Group:          System/Fhs
Provides:       susegreeter-branding = %{version}
Conflicts:      otherproviders(susegreeter-branding)
BuildArch:      noarch

%description -n susegreeter-branding-openSUSE
openSUSE %{version} branding for the KDE greeter welcome screen

%package -n kdm-branding-openSUSE
Summary:        openSUSE branding for KDE login and display manager
Group:          System/GUI/KDE
PreReq:         %fillup_prereq
Supplements:    packageand(kdm:branding-openSUSE)
Provides:       kde4-kdm-branding-openSUSE = %{version}
Provides:       kdm-branding = %{_kde_branding_version}
Obsoletes:      kde4-kdm-branding-openSUSE < %{version}
Conflicts:      otherproviders(kdm-branding)
BuildArch:      noarch
Requires:       wallpaper-branding-openSUSE
Requires(post):	kdm

%description -n kdm-branding-openSUSE
This package contains openSUSE %{version} branding for kdm, the login and session manager for KDE.

%prep
%setup -q -c
cp -a openSUSE/LICENSE COPYING 

%build
mkdir about
cp /usr/share/kde4/apps/kdeui/about/kde_infopage.css about/
cp /usr/share/kde4/apps/kdeui/about/kde_infopage_rtl.css about/
pushd about/
# need to have latest kdelibs4 in factory
patch -p0 < ../openSUSE/kdelibs/css.diff
popd

%install
mkdir -p %{buildroot}/var/adm/fillup-templates
cp %{SOURCE21} %{buildroot}/var/adm/fillup-templates/

mkdir -p %{buildroot}%{_kde4_appsdir}/kdeui/about
cp -a about/* %{buildroot}%{_kde4_appsdir}/kdeui/about

make -C openSUSE install DESTDIR=%{buildroot}
%suse_update_desktop_file  %{buildroot}/usr/share/kde4/apps/ksplash/Themes/ksplashx-suse/Theme.rc
%suse_update_desktop_file  %{buildroot}/usr/share/kde4/apps/ksplash/Themes/ksplash-qml-openSUSE/Theme.rc

rm -rf %{buildroot}/usr/share/{YaST2,backgrounds,gnome-background-properties,grub2,gimp,pixmaps,plymouth,wallpapers}

%post -n kdm-branding-openSUSE
%{fillup_only -n displaymanager -s kdm}
if [ -f /usr/share/kde4/config/kdm/kdmrc ]; then
    sed -i -e 's/elarun/openSUSE/g' /usr/share/kde4/config/kdm/kdmrc
fi

%postun -n kdm-branding-openSUSE
if [ $1 -eq 0 -a -f /usr/share/kde4/config/kdm/kdmrc ]; then
   sed -i -e 's/openSUSE/elarun/g' /usr/share/kde4/config/kdm/kdmrc
fi

%files -n kdelibs4-branding-openSUSE
%defattr(-,root,root)
%doc COPYING
%{_kde4_appsdir}/kdeui
%dir %{_kde4_appsdir}/ksplash
%dir %{_kde4_appsdir}/ksplash/Themes

%files -n ksplashx-branding-openSUSE
%defattr(-,root,root)
%{_kde4_appsdir}/ksplash/Themes/ksplashx-suse

%files -n ksplash-qml-branding-openSUSE
%defattr(-,root,root)
%dir %{_kde4_appsdir}/ksplash/Themes/ksplash-qml-openSUSE
%{_kde4_appsdir}/ksplash/Themes/ksplash-qml-openSUSE

%files -n kdm-branding-openSUSE
%defattr(-,root,root)
%doc COPYING
%{_kde4_appsdir}/kdm
%{_localstatedir}/adm/fillup-templates/sysconfig.displaymanager-kdm

%files -n susegreeter-branding-openSUSE
%defattr(-,root,root)
/usr/share/kde4/apps/SUSEgreeter

%changelog
openSUSE Build Service is sponsored by