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

#
# spec file for package kde-branding-openSUSE
#
# Copyright (c) 2018 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/
#


#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
  %define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
Name:           kde-branding-openSUSE
Version:        13.2
Release:        0
Summary:        openSUSE Brand File
License:        BSD-3-Clause
Group:          System/Fhs
URL:            http://github.com/openSUSE/branding
Source0:        openSUSE.tar.xz
Source21:       sysconfig.displaymanager-kdm
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 %{_sysconfdir}/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)
Conflicts:      kdelibs4-branding
Provides:       kdelibs4-branding = %{_kde_branding_version}
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
# links its images
Requires:       wallpaper-branding-openSUSE
Supplements:    packageand(kdebase4-workspace:branding-openSUSE)
Conflicts:      ksplashx-branding
Provides:       ksplashx-branding = %{version}
BuildArch:      noarch

%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
# links its images
Requires:       wallpaper-branding-openSUSE
Supplements:    packageand(kdebase4-workspace:branding-openSUSE)
Conflicts:      ksplash-qml-branding
Provides:       ksplash-qml-branding = %{version}
BuildArch:      noarch

%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
Conflicts:      susegreeter-branding
Provides:       susegreeter-branding = %{version}
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
Requires:       wallpaper-branding-openSUSE
PreReq:         %fillup_prereq
Requires(post): kdm
Supplements:    packageand(kdm:branding-openSUSE)
Conflicts:      kdm-branding
Provides:       kde4-kdm-branding-openSUSE = %{version}
Provides:       kdm-branding = %{_kde_branding_version}
Obsoletes:      kde4-kdm-branding-openSUSE < %{version}
BuildArch:      noarch

%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 %{_datadir}/kde4/apps/kdeui/about/kde_infopage.css about/
cp %{_datadir}/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}%{_fillupdir}
cp %{SOURCE21} %{buildroot}%{_fillupdir}/

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}%{_datadir}/kde4/apps/ksplash/Themes/ksplashx-suse/Theme.rc
%suse_update_desktop_file  %{buildroot}%{_datadir}/kde4/apps/ksplash/Themes/ksplash-qml-openSUSE/Theme.rc

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

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

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

%files -n kdelibs4-branding-openSUSE
%defattr(-,root,root)
%license 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)
%license COPYING

%{_kde4_appsdir}/kdm
%{_fillupdir}/sysconfig.displaymanager-kdm

%files -n susegreeter-branding-openSUSE
%defattr(-,root,root)
%{_datadir}/kde4/apps/SUSEgreeter

%changelog
openSUSE Build Service is sponsored by