%global debug_package %{nil}
%global commit fa87704a3756f295d7bfa98435976f19fb9a2d24
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global gitcounter 20
%global last_stable_version 2.9.0
Name: krusader
Version: %{last_stable_version}.git.%{gitcounter}
Release: %{shortcommit}%{?dist}
Summary: An advanced twin-panel (commander-style) file-manager for KDE
License: GPLv2+
URL: https://www.krusader.org/
Source0: https://invent.kde.org/utilities/%{name}/-/archive/%{commit}.tar.bz2#/%{name}-%{shortcommit}.tar.bz2
# Patch1: https://invent.kde.org/utilities/%%{name}/-/commit/60b3f60508506753616bb47d6d6dfcfdbacb0f42.patch#/KF6_ColorScheme_link.patch
BuildRequires: cmake extra-cmake-modules
BuildRequires: qt6-qtbase-devel qt6-qt5compat-devel
BuildRequires: kf6-kio-devel kf6-karchive-devel kf6-kbookmarks-devel kf6-kcodecs-devel kf6-kcompletion-devel
BuildRequires: kf6-kcoreaddons-devel kf6-kconfig-devel kf6-kdoctools-devel kf6-ki18n-devel kf6-kiconthemes-devel
BuildRequires: kf6-kitemviews-devel kf6-knotifications-devel kf6-kparts-devel kf6-solid-devel kf6-ktextwidgets-devel
BuildRequires: kf6-kwallet-devel kf6-kwidgetsaddons-devel kf6-kwindowsystem-devel kf6-kxmlgui-devel kf6-kguiaddons-devel
BuildRequires: kf6-kstatusnotifieritem-devel kf6-kglobalaccel-devel kf6-kcrash-devel kf6-kcolorscheme-devel
BuildRequires: libattr-devel libacl-devel zlib-devel bzip2-devel
BuildRequires: desktop-file-utils libappstream-glib
BuildRequires: ninja-build
BuildRequires: devscripts
%description
Krusader is an advanced twin panel (commander style) file manager for KDE and
other desktops in the *nix world, similar to Midnight or Total Commander.
It provides all the file management features you could possibly want.
Plus: extensive archive handling, mounted filesystem support, FTP, advanced
search module, an internal viewer/editor, directory synchronisation,
file content comparisons, powerful batch renaming and much much more.
It supports a wide variety of archive formats and can handle other KIO slaves
such as smb or fish. It is (almost) completely customizable, very user
friendly, fast and looks great on your desktop! You should give it a try.
%prep
%autosetup -p1 -n %{name}-%{commit}
%build
%set_build_flags
export -p CFLAGS=$(echo "$CFLAGS -fdata-sections -ffunction-sections" | sed -e 's|-g |-g0 |' -e 's|-march=x86-64|-march=x86-64-v2 -fvect-cost-model=dynamic|')
export -p CXXFLAGS=$(echo "$CXXFLAGS -fdata-sections -ffunction-sections" | sed -e 's|-g |-g0 |' -e 's|-march=x86-64|-march=x86-64-v2 -fvect-cost-model=dynamic|')
export -p LDFLAGS=$(echo "$LDFLAGS -Wl,-s,--gc-sections")
%cmake_kf6 -G Ninja -DCMAKE_BUILD_TYPE=Release
%cmake_build
%install
%cmake_install
%find_lang %{name} --with-kde
%check
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
hardening-check -v --nobranchprotection %{buildroot}%{_bindir}/%{name}
%files -f %{name}.lang
%doc AUTHORS ChangeLog README README.md NEWS TODO
%license LICENSES/*
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/*.desktop
%{_datadir}/doc/HTML/*/%{name}/
%{_datadir}/icons/hicolor/*/apps/*.png
%{_datadir}/kxmlgui5/%{name}/
%{_libdir}/qt6/plugins/kf6/kio/kio*.so
%{_mandir}/*/man1/%{name}.1*
%{_mandir}/man1/%{name}.1*
%{_metainfodir}/*.appdata.xml
%{_sysconfdir}/xdg/kio_isorc
%changelog
* Fri Aug 14 2026 samoht0 git-master
- switch to git master to avoid massive backporting
* Sat Aug 08 2026 samoht0 git-stable
- testing x86-64-v2
* Sun Nov 10 2024 samoht0 git-stable
- switch to kf6
- history cleanup