-%define kdeplasmaver 5.4.0
-%define qtver 5.3.2
+#
+# Conditional build:
+%bcond_with tests # build with tests
+%define kdeplasmaver 5.27.7
+%define qtver 5.15.2
%define kpname kde-gtk-config
Summary: GTK2 and GTK3 Configurator for KDE
Name: kp5-%{kpname}
-Version: 5.4.0
-Release: 3
+Version: 5.27.7
+Release: 1
License: GPL v2+/LGPL v2.1+
Group: X11/Libraries
-Source0: http://download.kde.org/stable/plasma/%{kdeplasmaver}/%{kpname}-%{version}.tar.xz
-# Source0-md5: 31f6c449cd683937a4cc5ba2447bbf0d
+Source0: https://download.kde.org/stable/plasma/%{kdeplasmaver}/%{kpname}-%{version}.tar.xz
+# Source0-md5: 77731f7530552c096785e938554c5c0e
+Patch0: x32.patch
+%define specflags -I/usr/include/harfbuzz
URL: http://www.kde.org/
BuildRequires: Qt5Core-devel >= %{qtver}
-BuildRequires: cmake >= 2.8.12
+BuildRequires: cmake >= 3.16.0
+BuildRequires: gsettings-desktop-schemas
+BuildRequires: gsettings-desktop-schemas-devel
+BuildRequires: gtk+2-devel
+BuildRequires: gtk+3-devel
BuildRequires: kf5-extra-cmake-modules >= 1.4.0
BuildRequires: kf5-karchive-devel
+BuildRequires: kf5-kauth-devel
+BuildRequires: kf5-kbookmarks-devel
BuildRequires: kf5-kcmutils-devel
+BuildRequires: kf5-kcmutils-devel
+BuildRequires: kf5-kconfigwidgets-devel
BuildRequires: kf5-kconfigwidgets-devel
BuildRequires: kf5-ki18n-devel
BuildRequires: kf5-kiconthemes-devel
BuildRequires: kf5-kio-devel
+BuildRequires: kf5-kio-devel
BuildRequires: kf5-knewstuff-devel
+BuildRequires: kf5-knewstuff-devel
+BuildRequires: kf5-kxmlgui-devel
+BuildRequires: kp5-kdecoration-devel >= 5.23.0
+BuildRequires: ninja
BuildRequires: qt5-build >= %{qtver}
BuildRequires: rpmbuild(macros) >= 1.164
BuildRequires: tar >= 1:1.22
%prep
%setup -q -n %{kpname}-%{version}
+#%%patch0 -p1
%build
-install -d build
-cd build
-%cmake \
+%cmake -B build \
+ -G Ninja \
+ %{!?with_tests:-DBUILD_TESTING=OFF} \
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
- ..
-%{__make}
+ -DHTML_INSTALL_DIR=%{_kdedocdir}
+%ninja_build -C build
+
+%if %{with tests}
+ctest
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} -C build install \
- DESTDIR=$RPM_BUILD_ROOT
+%ninja_install -C build
-%find_lang %{kpname} --all-name --with-kde
+sed -i -e 's|/usr/bin/env sh|/bin/bash|' $RPM_BUILD_ROOT/usr/share/kconf_update/remove_window_decorations_from_gtk_css.sh
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-%files -f %{kpname}.lang
+%files
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/gtk3_preview
-%attr(755,root,root) %{_libdir}/gtk_preview
-%attr(755,root,root) %{_libdir}/qt5/plugins/kcm_kdegtkconfig.so
-%attr(755,root,root) %{_libdir}/reload_gtk_apps
-/etc/xdg/cgcgtk3.knsrc
-/etc/xdg/cgcicon.knsrc
-/etc/xdg/cgctheme.knsrc
-%{_iconsdir}/hicolor/*/apps/kde-gtk-config.png
-%{_iconsdir}/hicolor/scalable/apps/kde-gtk-config.svgz
+%attr(755,root,root) %{_prefix}/libexec/gtk3_preview
+%attr(755,root,root) %{_libdir}/qt5/plugins/kf5/kded/gtkconfig.so
+%attr(755,root,root) %{_libdir}/kconf_update_bin/gtk_theme
+%{_datadir}/kconf_update/gtkconfig.upd
+%attr(755,root,root) %{_libdir}/gtk-3.0/modules/libcolorreload-gtk-module.so
+%attr(755,root,root) %{_libdir}/gtk-3.0/modules/libwindow-decorations-gtk-module.so
+%attr(755,root,root) %{_datadir}/kconf_update/remove_window_decorations_from_gtk_css.sh
+%{_datadir}/themes/Breeze/window_decorations.css
%dir %{_datadir}/kcm-gtk-module
%{_datadir}/kcm-gtk-module/preview.ui
-%{_datadir}/kservices5/kde-gtk-config.desktop
-
+%attr(755,root,root) %{_libdir}/kconf_update_bin/remove_deprecated_gtk4_option