File plasma5-openSUSE.spec of Package plasma5-openSUSE

#
# spec file for package plasma5-openSUSE
#
# Copyright (c) 2015 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/
#


# the greeter is currently not built by default, see boo#950863
%bcond_with greeter

%define plasma_version 5.4.2
%if %suse_version == 1315 && %is_opensuse
%define suse_branding_version 42.1
%else
%define suse_branding_version 13.2
%endif
Name:           plasma5-openSUSE
Version:        13.2
Release:        0
Summary:        openSUSE KDE Extension
License:        GPL-2.0+
Group:          System/GUI/KDE
# git clone git://github.com/openSUSE/kdebase-opensuse.git
Url:            http://www.opensuse.org/
Source:         plasma5-openSUSE-13.2.tar.xz
Source2:        oS.diff
Source3:        plasma-change-defaults.diff
BuildRequires:  extra-cmake-modules
BuildRequires:  kdelibs4support-devel
BuildRequires:  kf5-filesystem
BuildRequires:  oxygen-icon-theme
BuildRequires:  plasma5-desktop >= %plasma_version
BuildRequires:  plasma5-desktop-branding-upstream >= %plasma_version
BuildRequires:  plasma5-workspace >= %plasma_version
BuildRequires:  plasma5-workspace-branding-upstream >= %plasma_version
BuildRequires:  update-desktop-files
BuildRequires:  wallpaper-branding-openSUSE
Requires:       plasma5-desktop-branding-openSUSE
Requires:       plasma5-workspace-branding-openSUSE
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package contains the standard openSUSE desktop and extensions.

%package -n plasma5-desktop-branding-openSUSE
Summary:        openSUSE KDE Extension
Group:          System/GUI/KDE
PreReq:         %fillup_prereq
Requires:       plasma5-desktop >= %plasma_version
Requires:       plasma5-workspace-branding-openSUSE = %{version}
Requires:       plasma5-workspace-branding-openSUSE = %{version}
%if %{with greeter}
Requires:       susegreeter-branding-openSUSE = %{suse_branding_version}
%endif
Requires:       wallpaper-branding-openSUSE = %{suse_branding_version}
Supplements:    packageand(plasma5-desktop:branding-openSUSE)
Provides:       plasma5-desktop-branding = %plasma_version
Conflicts:      otherproviders(plasma5-desktop-branding)

%description -n plasma5-desktop-branding-openSUSE
This package contains the standard openSUSE desktop and extensions.

%package -n plasma5-workspace-branding-openSUSE
Summary:        The KDE Runtime Components
Group:          System/GUI/KDE
PreReq:         %fillup_prereq
Supplements:    packageand(plasma5-workspace:branding-openSUSE)
Provides:       plasma5-workspace-branding = %plasma_version
Conflicts:      otherproviders(plasma5-workspace-branding)
Conflicts:      plasma5-desktop-branding-upstream
Requires:       plasma5-workspace >= %plasma_version
Requires:       wallpaper-branding-openSUSE
%if 0%{?suse_version} > 1314 && "%{suse_version}" != "1320"
Provides:       kdebase4-openSUSE = %{version}
Provides:       kdebase4-workspace-branding-openSUSE = %{version}
Obsoletes:      kdebase4-openSUSE <= %{version}
Obsoletes:      kdebase4-workspace-branding-openSUSE <= %{version}
%else
Conflicts:      kdebase4-openSUSE
Conflicts:      kdebase4-workspace-branding-openSUSE
%endif

%description -n plasma5-workspace-branding-openSUSE
This package contains all run-time dependencies of KDE applications.

%prep
%setup -q -n %{name}
echo "OnlyShowIn=KDE;"  >>  greeter/SUSEgreeter.desktop

%build
  pushd greeter
  %cmake_kf5 -d build
  %make_jobs
  popd

%install
  pushd greeter
  %kf5_makeinstall -C build
  popd
  %suse_update_desktop_file -u %{buildroot}%{_kf5_applicationsdir}/SUSEgreeter.desktop System Documentation
  mv config-files/COPYING .
  cp -a config-files/* %{buildroot}
  echo -e "[General]\nLogoPath=%{_kf5_sharedir}/icons/hicolor/128x128/apps/SUSEgreeter.png\nWebsite=http://www.opensuse.org/" > %{buildroot}/%{_kf5_configdir}/kcm-about-distrorc
  cp /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/splash/Splash.qml %{buildroot}%{_kf5_plasmadir}/look-and-feel/org.openSUSE.desktop/contents/splash/
  cp /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/lockscreen/LockScreen.qml %{buildroot}%{_kf5_plasmadir}/look-and-feel/org.openSUSE.desktop/contents/lockscreen/
  cp /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/osd/*.qml %{buildroot}%{_kf5_plasmadir}/look-and-feel/org.openSUSE.desktop/contents/osd/
  pushd %{buildroot}%{_kf5_plasmadir}/look-and-feel/org.openSUSE.desktop/contents/
  ln -s ../../org.kde.breeze.desktop/contents/components .
  patch -p0 < %{SOURCE2}
  popd
  pushd %{buildroot}%{_kf5_plasmadir}
  mkdir -p %{buildroot}%{_kf5_sharedir}/sddm/themes/ 
  cp -r %{_kf5_sharedir}/sddm/themes/breeze/ %{buildroot}%{_kf5_sharedir}/sddm/themes/
  ln -s /usr/share/wallpapers/openSUSEdefault/contents/images/1920x1080.jpg %{buildroot}%{_kf5_sharedir}/sddm/themes/breeze/components/artwork/
  sed -i 's|background=components/artwork/background.png|background=components/artwork/1920x1080.jpg|g' %{buildroot}%{_kf5_sharedir}/sddm/themes/breeze/theme.conf
  mkdir -p %{buildroot}%{_kf5_plasmadir}/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/
  cp %{_kf5_plasmadir}/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js %{buildroot}%{_kf5_plasmadir}/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js
  mkdir -p %{buildroot}%{_kf5_plasmadir}/shells/org.kde.plasma.desktop/contents/
  cp %{_kf5_plasmadir}/shells/org.kde.plasma.desktop/contents/layout.js %{buildroot}%{_kf5_plasmadir}/shells/org.kde.plasma.desktop/contents/layout.js
  patch -p0 < %{SOURCE3}
  popd

%if ! %{with greeter}
# It's safer to just drop things here, as there are various icons and other things installed as well by make install
rm -rf %{buildroot}{%{_kf5_sharedir},%{_kf5_bindir},%{_kf5_applicationsdir},%{_kf5_configdir}/autostart}/SUSEgreeter*
%endif

%files
%defattr(-,root,root)
%doc COPYING

%files -n plasma5-workspace-branding-openSUSE
%defattr(-,root,root)
%doc COPYING
%config %{_kf5_configdir}/*rc
%config %{_kf5_configdir}/kdeglobals
%{_kf5_servicesdir}/
%{_kf5_sharedir}/color-schemes/
%{_kf5_sharedir}/icons/*/*/*/*.*
%{_kf5_plasmadir}/
%if %{with greeter}
%{_kf5_sharedir}/SUSEgreeter
%{_kf5_bindir}/SUSEgreeter
%{_kf5_applicationsdir}/SUSEgreeter.desktop
%{_kf5_configdir}/autostart/SUSEgreeter.desktop
%endif
%{_kf5_sharedir}/sddm/

%files -n plasma5-desktop-branding-openSUSE
%defattr(-,root,root)
%doc COPYING

%changelog
openSUSE Build Service is sponsored by