## bootstrap, omit problematic optional build deps)
#global bootstrap 1

%global         base_name   breeze

Name:    plasma-breeze
Version: 5.16.5
Release: 1
Summary: Artwork, styles and assets for the Breeze visual style for the Plasma Desktop

License: GPLv2+
URL:     https://cgit.kde.org/%{base_name}.git

%global revision %(echo %{version} | cut -d. -f3)
%if %{revision} >= 50
%global majmin_ver %(echo %{version} | cut -d. -f1,2).50
%global stable unstable
%else
%global majmin_ver %(echo %{version} | cut -d. -f1,2)
%global stable stable
%endif
Source0: http://download.kde.org/%{stable}/plasma/%{version}/%{base_name}-%{version}.tar.xz

# filter plugin provides
%global __provides_exclude_from ^(%{_kde4_libdir}/kde4/.*\\.so|%{_kf5_qtplugindir}/.*\\.so)$

BuildRequires:  gettext
BuildRequires:  kdecoration-devel 

BuildRequires:  extra-cmake-modules
BuildRequires:  kf5-kauth-devel
BuildRequires:  kf5-frameworkintegration-devel
BuildRequires:  kf5-kcmutils-devel
BuildRequires:  kf5-kcompletion-devel
BuildRequires:  kf5-kconfig-devel
BuildRequires:  kf5-kcoreaddons-devel
BuildRequires:  kf5-kguiaddons-devel
BuildRequires:  kf5-ki18n-devel
BuildRequires:  kf5-kpackage-devel
BuildRequires:  kf5-kservice-devel
BuildRequires:  kf5-kwayland-devel
BuildRequires:  kf5-kwindowsystem-devel
BuildRequires:  kf5-plasma-devel
BuildRequires:  kf5-rpm-macros

BuildRequires:  libxcb-devel
BuildRequires:  fftw-devel
## appears to be not required anymore, commenting out for now -- rex
#if ! 0%{?bootstrap}
%if 0
# required kpackage plugins
BuildRequires:  plasma-packagestructure
%endif

BuildRequires:  qt5-qtbase-devel
BuildRequires:  qt5-qtdeclarative-devel
BuildRequires:  qt5-qtx11extras-devel

Requires:       %{name}-common = %{version}-%{release}

# since we provide a cmake dev-like file
Provides:       %{name}-devel = %{version}-%{release}

%description
%{summary}.

%package        common
Summary:        Common files shared between KDE 4 and Plasma 5 versions of the Breeze style
BuildArch:      noarch
%description    common
%{summary}.

%package -n     breeze-cursor-theme
Summary:        Breeze cursor theme
BuildArch:      noarch
Obsoletes:      breeze-icon-theme < 5.17.0
Provides:       breeze-cursor-themes = %{version}-%{release}
%description -n breeze-cursor-theme
%{summary}.

%if 0%{?build_kde4:1}
%package -n     kde-style-breeze
Summary:        KDE 4 version of Plasma 5 artwork, style and assets
BuildRequires:  kf5-kdelibs4support
#BuildRequires:  kdelibs4-devel
BuildRequires:  libxcb-devel
## currently mostly plasma5-specific resources, not needed or useful here really
Obsoletes:      plasma-breeze-kde4 < 5.1.95
Provides:       plasma-breeze-kde4%{?_isa} = %{version}-%{release}
%if 0
Supplements: (kde-runtime and plasma-workspace)
%endif
%description -n kde-style-breeze
%{summary}.
%endif


%prep
%autosetup -n %{base_name}-%{version} -p1


%build
mkdir %{_target_platform}
pushd %{_target_platform}
%{cmake_kf5} ..
popd

%make_build -C %{_target_platform}


%if 0%{?build_kde4:1}
mkdir %{_target_platform}_kde4
pushd %{_target_platform}_kde4
%{cmake_kde4} -DUSE_KDE4=TRUE ..
popd

%make_build -C %{_target_platform}_kde4
%endif


%install
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}

%find_lang breeze --all-name

%if 0%{?build_kde4:1}
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}_kde4
%endif

# omit/rename kde4breeze.upd, seems to be causing problems for
# (at least) new users, lame workaround for
# http://bugzilla.redhat.com/1283348
mv %{buildroot}%{_kf5_datadir}/kconf_update/kde4breeze.upd \
   %{buildroot}%{_kf5_datadir}/kconf_update/kde4breeze.upd.BAK


%ldconfig_scriptlets

%files
%license COPYING
%{_kf5_qtplugindir}/org.kde.kdecoration2/breezedecoration.so
%{_kf5_qtplugindir}/styles/breeze.so
%{_kf5_datadir}/kstyle/themes/breeze.themerc
%{_kf5_qtplugindir}/kstyle_breeze_config.so
%{_kf5_datadir}/kconf_update/kde4breeze.upd*
%{_kf5_libdir}/kconf_update_bin/kde4breeze
# used by breezedecoration
%{_libdir}/libbreezecommon5.so.5*
%{_kf5_qmldir}/QtQuick/Controls/Styles/Breeze
%{_bindir}/breeze-settings5
%{_datadir}/icons/hicolor/*/apps/breeze-settings.*
%{_kf5_datadir}/kservices5/breezedecorationconfig.desktop
%{_kf5_datadir}/kservices5/breezestyleconfig.desktop
%{_kf5_datadir}/plasma/look-and-feel/org.kde.breezedark.desktop/
#if ! 0%{?bootstrap}
%{_kf5_metainfodir}/org.kde.breezedark.desktop.appdata.xml
#endif
%{_libdir}/cmake/Breeze/

%files common -f breeze.lang
%{_datadir}/color-schemes/*.colors
%dir %{_datadir}/QtCurve/
%{_datadir}/QtCurve/Breeze.qtcurve
%{_datadir}/wallpapers/Next/

%if 0%{?build_kde4:1}
%ldconfig_scriptlets -n kde-style-breeze

%files -n kde-style-breeze
%{_libdir}/libbreezecommon4.so.5*
%{_kde4_libdir}/kde4/plugins/styles/breeze.so
%{_kde4_libdir}/kde4/kstyle_breeze_config.so
%{_kde4_appsdir}/kstyle/themes/breeze.themerc
%endif

%files -n breeze-cursor-theme
%doc cursors/Breeze/README
%dir %{_kf5_datadir}/icons/Breeze_Snow/
%{_kf5_datadir}/icons/Breeze_Snow/cursors/
%{_kf5_datadir}/icons/Breeze_Snow/index.theme
%dir %{_kf5_datadir}/icons/breeze_cursors/
%{_kf5_datadir}/icons/breeze_cursors/cursors/
%{_kf5_datadir}/icons/breeze_cursors/index.theme


%changelog
* Fri Aug 7 2020 weidong <weidong@uniontech.com> - 5.16.5-1
- Initial release for OpenEuler
