%define _disable_source_fetch 0
%define debug_package %{nil}

Name:           sonic-frameworks-auth
Version:        6.24.0
Release:        2%{?dist}
Summary:        SonicDE Auth (fork of KAuth)

License:        LGPL-2.0-or-later
URL:            https://github.com/Sonic-DE/sonic-frameworks-auth
Source0:        %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildRequires:  extra-cmake-modules
BuildRequires:  kf6-rpm-macros
BuildRequires:  qt6-qtbase-devel
BuildRequires:  qt6-qtdeclarative-devel
BuildRequires:  sonic-frameworks-windowsystem-devel
BuildRequires:  cmake(KF6CoreAddons)
BuildRequires:  gcc-c++

Provides:       kf6-kauth%{?_isa} >= %{version}
Provides:       kf6-kauth >= %{version}
Obsoletes:      kf6-kauth <= %{version}
BuildRequires:  polkit-qt6-1-devel

%description
SonicDE Auth is a fork of KAuth, providing a high-level API for running tasks
with elevated privileges in SonicDE.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       cmake(KF6CoreAddons)
Requires:       qt6-qtbase-devel

Provides:       kf6-kauth-devel%{?_isa} >= %{version}
Provides:       kf6-kauth-devel >= %{version}
Obsoletes:      kf6-kauth-devel <= %{version}

%description    devel
Development files for %{name}.

%prep
%autosetup -p1

%build
%cmake_kf6
%cmake_build

%install
%cmake_install
%find_lang kauth6 --all-name --with-qt || :

%files -f kauth6.lang
%license LICENSES/*
%{_libdir}/libKF6AuthCore.so.*
%{_libexecdir}/kf6/kauth/
%{_qt6_plugindir}/kf6/kauth/
%{_datadir}/dbus-1/system.d/org.kde.kf6auth.conf
%{_datadir}/kf6/kauth/
%{_datadir}/qlogging-categories6/kauth.categories
%{_datadir}/qlogging-categories6/kauth.renamecategories

%files devel
%{_includedir}/KF6/KAuth/
%{_includedir}/KF6/KAuthCore/
%{_libdir}/libKF6AuthCore.so
%{_libdir}/cmake/KF6Auth/

%changelog
* Tue Mar 24 2026 Anders da Silva Rytter Hansen <andersrh@users.noreply.github.com> - 6.24.0-1
- Initial release of sonic-frameworks-auth for SonicDE
