%bcond_with gcc

Name:    ksanecore
Summary: Library providing logic to interface scanners
Version: 24.12.1
Release: 1%{?dist}

License: BSD and LGPLv2.1-only and LGPLv3.0-only
URL:     https://invent.kde.org/libraries/ksanecore
Source0: http://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz

BuildRequires: cmake
BuildRequires: extra-cmake-modules
%if %{with gcc}
BuildRequires: gcc-toolset-14-gcc-c++
%else
BuildRequires: clang
%endif

BuildRequires: kf5-rpm-macros
BuildRequires: cmake(KF5I18n)
BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5Gui)

BuildRequires: kf6-rpm-macros
BuildRequires: cmake(KF6I18n)
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Gui)

BuildRequires: pkgconfig(sane-backends)

Conflicts: %{name} < 24.01
Obsoletes: %{name}-common < 24.12.0
Obsoletes: %{name}-qt5 < 24.12.0
Obsoletes: %{name}-qt6 < 24.12.0

%description
%{summary}.


%package devel
Summary:  Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: cmake(Qt6Gui)
Obsoletes: %{name}-qt5-devel < 24.12.0
Obsoletes: %{name}-qt6-devel < 24.12.0
%description devel
%{summary}.



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


%build
%if %{with gcc}
%enable_devtoolset14
export CC=gcc
export CXX=c++
%else
%global optflags %(echo %{optflags}) -Qunused-arguments
%endif

%cmake_kf6 -DBUILD_WITH_QT6=ON
%cmake_build

%install
%cmake_install


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

%files -f %{name}.lang
%doc README.md
%license LICENSES/*
%{_libdir}/libKSaneCore6.so.{1,%{maj_ver_kf6}.*}

%files devel
%{_includedir}/KSaneCore6/
%{_libdir}/cmake/KSaneCore6/
%{_libdir}/libKSaneCore6.so


%changelog
*Fri Jan 10 2025 Raven <raven@sysadmins.ws> - 24.12.1-1
- 24.12.1

* Fri Dec 13 2024 Raven <raven@sysadmins.ws> - 24.12.0-1
- 24.12.0

* Thu Nov  7 2024 Raven <raven@sysadmins.ws> - 24.08.3-1
- 24.08.3

* Fri Oct 11 2024 Raven <raven@sysadmins.ws> - 24.08.2-1
- 24.08.2

* Fri Sep 13 2024 Raven <raven@sysadmins.ws> - 24.08.1-1
- 24.08.1

* Fri Aug 23 2024 Raven <raven@sysadmins.ws> - 24.08.0-1
- 24.08.0

* Wed Jul 10 2024 Raven <raven@sysadmins.ws> - 24.05.2-1
- 24.05.2

* Fri Jun 28 2024 Raven <raven@sysadmins.ws> - 24.05.1-4
- rebuild (libxkbcommon)

* Wed Jun 26 2024 Raven <raven@sysadmins.ws> - 24.05.1-3
- Rebuild (qt6)

* Mon Jun  3 2024 Raven <raven@sysadmins.ws> - 24.05.0-1
- 24.05.0

* Fri Apr 12 2024 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 24.02.2-1
- 24.02.2

* Fri Mar 29 2024 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 24.02.1-1
- 24.02.1

* Wed Feb 21 2024 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 24.02.0-1
- 24.02.0

* Wed Jan 31 2024 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 24.01.95-1
- 24.01.95

* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 24.01.90-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 24.01.90-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Thu Jan 11 2024 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 24.01.90-1
- 24.01.90

* Sat Dec 23 2023 ales.astone@gmail.com - 24.01.85-1
- 24.01.85

* Wed Dec 13 2023 Alessandro Astone <ales.astone@gmail.com> - 24.01.80-3
- Explicit conflicts ksanecore-common

* Tue Dec 12 2023 Alessandro Astone <ales.astone@gmail.com> - 24.01.80-2
- Respin qt5/qt6 coinstallability patch

* Mon Dec 11 2023 Alessandro Astone <ales.astone@gmail.com>
- Update to 24.01.80

* Thu Oct 12 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.08.2-1
- 23.08.2

* Sat Sep 16 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.08.1-1
- 23.08.1

* Sat Aug 26 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.08.0-1
- 23.08.0

* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 23.04.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Sat Jul 08 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.04.3-1
- 23.04.3

* Tue Jun 06 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.04.2-1
- 23.04.2

* Sat May 13 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.04.1-1
- 23.04.1

* Fri Apr 14 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.04.0-1
- 23.04.0

* Fri Mar 31 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.03.90-1
- 23.03.90

* Mon Mar 20 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 23.03.80-1
- 23.03.80

* Thu Mar 02 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 22.12.3-1
- 22.12.3

* Tue Jan 31 2023 Marc Deop <marcdeop@fedoraproject.org> - 22.12.2-1
- 22.12.2

* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 22.12.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Tue Jan 03 2023 Justin Zobel <justin@1707.io> - 22.12.1-1
- Update to 22.12.1

* Wed Dec 21 2022 Justin Zobel <justin@1707.io> - 22.12.0-1
- Initial inclusion
