Name:           ukui-kwin
Version:        1.0.5
Release:        3
Summary:        KDE Window Manager for UKUI desktop environment
License:        GPL-2.0-or-later and LGPL-2.0-or-later
URL:            https://github.com/ukui/ukui-kwin     

Source0:        ukui-kwin-1.0.5.tar.gz
Patch01:        0001-fix-ukui-kwin-data-install-error.patch

BuildRequires:  cmake extra-cmake-modules 
BuildRequires:  kf5-kinit-devel kscreenlocker-devel libcap-devel libdrm-devel >= 2.4.62 mesa-libEGL-devel libepoxy-devel >= 1.2 fontconfig-devel freetype-devel libgbm-devel libICE-devel libinput-devel >= 1.15.5  kdecoration-devel
BuildRequires:  kf5-kactivities-devel  kf5-kcompletion-devel  kf5-kconfig-devel  kf5-kconfigwidgets-devel  kf5-kcoreaddons-devel  kf5-kcrash-devel  kf5-kdeclarative-devel   kf5-kdoctools-devel  kf5-kglobalaccel-devel  kf5-ki18n-devel  kf5-kiconthemes-devel  kf5-kidletime-devel  kf5-kcmutils-devel  kf5-kio-devel kf5-knewstuff-devel kf5-knotifications-devel  kf5-kpackage-devel kf5-plasma-devel kf5-kservice-devel  kf5-ktextwidgets-devel  kf5-kwayland-devel  kf5-kwidgetsaddons-devel  kf5-kwindowsystem-devel  kf5-kxmlgui-devel  
BuildRequires:  qt5-qtsensors-devel qt5-qtx11extras-devel 
BuildRequires:  libSM-devel systemd-devel wayland-devel  >= 1.2 
BuildRequires:  libX11-devel libxcb-devel xcb-util-cursor xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-devel libXcursor-devel libXi-devel libxkbcommon-devel >= 0.7.0 pkg-config
BuildRequires:  qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtdeclarative-devel  qt5-qtscript-devel  qt5-qttools-devel gsettings-qt-devel 
BuildRequires:  kwin-devel libXtst-devel
#compile need
BuildRequires:  kf5-kirigami2-devel plasma-breeze-devel xcb-util-cursor-devel xcb-util-wm-devel xcb-util-image-devel xcb-util-keysyms-devel qt5-qtbase-static kf5-kguiaddons-devel

Requires:       ukui-kwin-x11 ukui-kwin-wayland
%description
Ukui-kwin  is the window manager for the UKUI3.0 Desktop. It gives you complete control over your windows, making sure they're not in the way but aid you in your task. It paints the window decoration, the bar on top of every window with (configurable) buttons like close, maximize and minimize. It also handles placing of windows and switching between them..
Transitional dummy for ukui-kwin-x11
This package is a transitional dummy to depend on the renamed ukui-kwin-x11 and can be removed.


%package -n ukui-kwin-wayland
Summary:        KDE Window Manager for UKUI desktop environment with experimental Wayland support
Requires:       ukui-kwin-common
Requires:       kwayland-integration
Requires:       xorg-x11-server-Xwayland
%description -n ukui-kwin-wayland
%{summary}.


%package -n ukui-kwin-common
Summary:        UKUI window manager, common files
Requires:       ukui-kwin-data kf5-kglobalaccel libukui-kwineffects12 kf5-kirigami2 kf5-kdeclarative qt5-qtmultimedia 
Recommends:     qt5-qtvirtualkeyboard
%description -n ukui-kwin-common
%{summary}.


%package -n ukui-kwin-data
Summary:        UKUI window manager data files
Requires:       kf5-plasma
Recommends:     python3 qt5-qtmultimedia qt5-qtquickcontrols qt5-qtdeclarative qt5-qtvirtualkeyboard 
%description -n ukui-kwin-data
%{summary}.


%package -n ukui-kwin-devel
Summary:        UKUI window manager - devel files
Requires:       ukui-kwin-common mesa-libEGL-devel libepoxy-devel kf5-kconfig-devel kf5-kcoreaddons-devel kf5-kwindowsystem-devel qt5-qtx11extras-devel libxcb-devel qt5-qtbase-devel
%description -n ukui-kwin-devel
%{summary}.


%package -n ukui-kwin-x11
Summary:        UKUI window manager drm plugin
Requires:       ukui-kwin-common libukui-kwinglutils12 libukui-kwinxrenderutils12
Provides:       ukui-kwin, x-window-manager
%description -n ukui-kwin-x11
%{summary}.


%package -n libukui-kwin4-effect-builtins1
Summary:        UKUI window manager drm plugin
Requires:       libukui-kwineffects12
%description -n libukui-kwin4-effect-builtins1
%{summary}.


%package -n libukui-kwineffects12
Summary:        UKUI window manager effects library
%description -n libukui-kwineffects12
%{summary}.


%package -n libukui-kwinglutils12
Summary:        UKUI window manager effects library
%description -n libukui-kwinglutils12
%{summary}.


%package -n libukui-kwinxrenderutils12
Summary:        UKUI window manager effects library
%description -n libukui-kwinxrenderutils12
%{summary}.


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

%build
mkdir %{_target_platform}
pushd %{_target_platform}
%{cmake_kf5} .. \
   -DBUILD_TESTING:BOOL=ON
popd

%make_build -C %{_target_platform} -j4


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

ln -s ukui-kwin_x11 %{buildroot}%{_bindir}/ukui-kwin
mkdir -p %{buildroot}%{_datadir}/licenses/ukui-kwin
cp  COPYING* %{buildroot}%{_datadir}/licenses/ukui-kwin/

%files
%license COPYING*
%{_bindir}/ukui-kwin

%files -n ukui-kwin-wayland
%{_kf5_bindir}/ukui-kwin_wayland
%{_kf5_plugindir}/org.ukui.kidletime.platforms/KF5IdleTimeKWinWaylandPrivatePlugin.so
%{_kf5_qtplugindir}/platforms/UKUIKWinQpaPlugin.so
%{_kf5_qtplugindir}/org.ukui.kwin.waylandbackends/KWinWaylandDrmBackend.so
%{_kf5_qtplugindir}/org.ukui.kwin.waylandbackends/KWinWaylandFbdevBackend.so
%{_kf5_qtplugindir}/org.ukui.kwin.waylandbackends/KWinWaylandWaylandBackend.so
%{_kf5_qtplugindir}/org.ukui.kwin.waylandbackends/KWinWaylandX11Backend.so
%{_kf5_qtplugindir}/org.ukui.kwin.waylandbackends/KWinWaylandVirtualBackend.so

%files -n ukui-kwin-common
%{_libexecdir}/ukui_kwin_killer_helper
%{_libexecdir}/ukui_kwin_rules_dialog
%{_kf5_libdir}/kconf_update_bin/ukui_kwin5_update_default_rules
%{_libdir}/libkcmukuikwincommon.so.*
%{_kf5_libdir}/libkdeinit5_ukui_kwin_rules_dialog.so
%{_libdir}/libukui-kwin.so.*
%{_qt5_plugindir}/kcm_ukuikwin*.so
%{_qt5_plugindir}/kcms/kcm_ukuikwin_effects.so
%{_qt5_plugindir}/kcms/kcm_ukuikwin_virtualdesktops.so
%{_qt5_plugindir}/kcms/kcm_ukuikwindecoration.so
%{_kf5_plugindir}/org.ukui.kwindowsystem.platforms/KF5WindowSystemKWinPrivatePlugin.so
%{_kf5_qtplugindir}/kpackage/packagestructure/ukui_kwin_packagestructure*.so
%{_qt5_plugindir}/ukuikwin*.so
%{_kf5_qtplugindir}/ukui-kwin/
%{_kf5_qtplugindir}/org.kde.kdecoration2/*.so
%{_kf5_qtplugindir}/org.ukui.kglobalaccel5.platforms/KF5GlobalAccelPrivateKWin.so
%{_kf5_qtplugindir}/org.ukui.kwin.scenes/*.so
%{_qt5_qmldir}/org/ukui/kwin
%{_datadir}/knsrcfiles/*.knsrc
%{_kf5_datadir}/qlogging-categories5/org_ukui_kwin.categories
%{_datadir}/touchgesture/touchgesture.xml

%files -n ukui-kwin-data
%{_sysconfdir}/xdg/LowPerformanceCPU.list
%{_sysconfdir}/xdg/LowVgaPci.list
%{_sysconfdir}/xdg/autostart/ukui-kwin.desktop
%{_sysconfdir}/xdg/ukui-kwinrc
%{_datadir}/aurorae/
%{_kf5_datadir}/config.kcfg/ukui-kwin.kcfg
%{_kf5_datadir}/config.kcfg/ukui-kwin_colorcorrect.kcfg
%{_kf5_datadir}/config.kcfg/ukuikwindecorationsettings.kcfg
%{_kf5_datadir}/config.kcfg/ukuivirtualdesktopssettings.kcfg
%{_datadir}/icons/*/*/apps/ukui-kwin.*
%{_datadir}/kconf_update/ukui-kwin-5.16-auto-bordersize.sh
%{_datadir}/kconf_update/ukui-kwin-5.18-move-animspeed.py
%{_datadir}/kconf_update/ukui-kwin.upd
%{_kf5_datadir}/knotifications5/ukui-kwin.notifyrc
%{_kf5_datadir}/kpackage/kcms/kcm_ukuikwin_effects/
%{_kf5_datadir}/kpackage/kcms/kcm_ukuikwin_virtualdesktops/
%{_kf5_datadir}/kpackage/kcms/kcm_ukuikwindecoration
%{_kf5_datadir}/kservices5/*.desktop
%{_kf5_datadir}/kservices5/ukui-kwin
%{_kf5_datadir}/kservicetypes5/*.desktop
%{_kf5_datadir}/kservicetypes5/ukui-kwin/*.desktop
%{_datadir}/ukui-kwin
%{_datadir}/locale

%files -n ukui-kwin-devel
%{_includedir}/ukui-kwin*.h
%{_includedir}/ukui-kwin/
%{_libdir}/cmake/ukui-kwin/KWinDBusInterface
%{_libdir}/libukui-kwin4_effect_builtins.so
%{_libdir}/libukui-kwineffects.so
%{_libdir}/libukui-kwinglutils.so
%{_libdir}/libukui-kwinxrenderutils.so
%{_datadir}/dbus-1/interfaces/*.xml

%files -n ukui-kwin-x11
%{_bindir}/ukui-kwin_x11
%{_kf5_libdir}/libkdeinit5_ukui-kwin_x11.so
%{_kf5_qtplugindir}/org.ukui.kwin.platforms/KWinX11Platform.so

%files -n libukui-kwin4-effect-builtins1
%{_libdir}/libukui-kwin4_effect_builtins.so.*

%files -n libukui-kwineffects12
%{_libdir}/libukui-kwineffects.so.*

%files -n libukui-kwinglutils12
%{_libdir}/libukui-kwinglutils.so.*

%files -n libukui-kwinxrenderutils12
%{_libdir}/libukui-kwinxrenderutils.so.*


%changelog
* Thu Feb 16 2023 peijiankang<peijiankang@kylinos.cn> - 1.0.5-3
- fix ukui-kwin-data install error

* Tue Dec 6 2022 peijiankang<peijiankang@kylinos.cn> - 1.0.5-2
- modify install error

* Fri Dec 2 2022 peijiankang<peijiankang@kylinos.cn> - 1.0.5-1
- update version to 1.0.5

* Fri Jul 29 2022 peijiankang<peijiankang@kylinos.cn> - 1.0.4-5
- modify complie error of kde5.95

* Fri Apr 8 2022 peijiankang<peijiankang@kylinos.cn> - 1.0.4-4
- remove kwin requires

* Wed Mar 2 2022 peijiankang<peijiankang@kylinos.cn> - 1.0.4-3
- add kwin requires

* Fri Feb 25 2022 peijiankang<peijiankang@kylinos.cn> - 1.0.4-2
- update to version 1.0.4-2

* Fri Feb 11 2022 peijiankang<peijiankang@kylinos.cn> - 1.0.4-1
- Init ukui-kwin 1.0.4-1

