%global framework plasma

Name:           kf5-%{framework}
Version:        5.55.0
Release:        1
Summary:        KDE Frameworks 5 Tier 3 framework is foundation to build a primary user interface
License:        GPLv2+ and LGPLv2+ and BSD
URL:            https://cgit.kde.org/plasma-framework.git

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

%global __provides_exclude_from ^%{_kf5_qmldir}/.*\\.so$

BuildRequires:  extra-cmake-modules >= %{majmin}  kf5-kactivities-devel >= %{majmin}  kf5-kactivities-devel >= %{majmin}  kf5-karchive-devel >= %{majmin}  kf5-kconfig-devel >= %{majmin}  kf5-kconfigwidgets-devel >= %{majmin}  kf5-kcoreaddons-devel >= %{majmin}  kf5-kdbusaddons-devel >= %{majmin}  kf5-kdeclarative-devel >= %{majmin}  kf5-kdesu-devel >= %{majmin}  kf5-kdoctools-devel >= %{majmin}  kf5-kglobalaccel-devel >= %{majmin}  kf5-kguiaddons-devel >= %{majmin}  kf5-ki18n-devel >= %{majmin}  kf5-kiconthemes-devel >= %{majmin}  kf5-kio-devel >= %{majmin}  kf5-knotifications-devel >= %{majmin}  kf5-kpackage-devel >= %{majmin}  kf5-kparts-devel >= %{majmin}  kf5-kservice-devel >= %{majmin}  kf5-kirigami2-devel >= %{majmin}  kf5-kwidgetsaddons-devel >= %{majmin}  kf5-kwindowsystem-devel >= %{majmin}  kf5-kxmlgui-devel >= %{majmin}  kf5-rpm-macros  kf5-solid-devel >= %{majmin}  libGL-devel  libSM-devel  libX11-devel  libxcb-devel  libXext-devel  libXrender-devel  libXScrnSaver-devel  openssl-devel  qt5-qtbase-devel  qt5-qtdeclarative-devel  qt5-qtquickcontrols2-devel  qt5-qtscript-devel  qt5-qtsvg-devel  qt5-qtx11extras-devel
Requires:       qt5-qtquickcontrols%{?_isa}       qt5-qtquickcontrols2%{?_isa}
%description
%{summary}.

%package        devel
Summary:        Development files for %{name}
Conflicts:      kapptemplates < 15.12.0-1
Requires:       %{name}%{?_isa} = %{version}-%{release}       kf5-kpackage-devel >= %{majmin}       kf5-kservice-devel >= %{majmin}       kf5-kwindowsystem-devel >= %{majmin}       qt5-qtbase-devel
%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


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

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

%make_build -C %{_target_platform}


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

%find_lang %{name} --all-name --with-man --all-name

# create/own dirs
mkdir -p %{buildroot}%{_kf5_datadir}/plasma/plasmoids
mkdir -p %{buildroot}%{_kf5_qmldir}/org/kde/private



%ldconfig_scriptlets

%files -f %{name}.lang
%doc README.md
%license COPYING.LIB
%{_kf5_bindir}/plasmapkg2
%{_kf5_libdir}/libKF5Plasma.so.*
%{_kf5_libdir}/libKF5PlasmaQuick.so.*
%dir %{_kf5_qmldir}/org/
%dir %{_kf5_qmldir}/org/kde/
%dir %{_kf5_qmldir}/org/kde/private/
%{_kf5_qmldir}/org/kde/plasma/
%{_kf5_qmldir}/org/kde/kirigami.2/styles
%{_kf5_qmldir}/QtQuick/Controls/Styles/Plasma/
%{_kf5_qmldir}/QtQuick/Controls.2/Plasma/
%{_kf5_qtplugindir}/plasma/
%{_kf5_qtplugindir}/kpackage/packagestructure/*.so
%{_kf5_datadir}/plasma/
%{_kf5_datadir}/kservices5/*.desktop
%{_kf5_datadir}/kservicetypes5/*.desktop
%{_kf5_mandir}/man1/plasmapkg2.1.*
# can find_lang handle this too somehow? -- rex
%lang(lt) %{_datadir}/locale/lt/LC_SCRIPTS/libplasma5/

%files devel
%{_kf5_libdir}/cmake/KF5Plasma/
%{_kf5_libdir}/cmake/KF5PlasmaQuick/
%{_kf5_libdir}/libKF5Plasma.so
%{_kf5_libdir}/libKF5PlasmaQuick.so
%{_kf5_includedir}/plasma_version.h
%{_kf5_includedir}/plasma/
%{_kf5_includedir}/Plasma/
%{_kf5_includedir}/PlasmaQuick/
%{_kf5_includedir}/plasmaquick/
%dir %{_kf5_datadir}/kdevappwizard/
%{_kf5_datadir}/kdevappwizard/templates/


%changelog
* Mon Aug 17 2020 yeqinglong <yeqinglong@uniontech.com> - 5.55.0-1
- Initial release for OpenEuler

