%bcond_with gcc

Name:           kpublictransport
Version: 24.12.1
Release: 1%{?dist}
License:        BSD and CC0-1.0 and LGPLv2+ and MIT and ODbL-1.0
Summary:        Library to assist with accessing public transport timetables and other data
Url:            https://invent.kde.org/libraries/kpublictransport
Source:         https://download.kde.org/stable/release-service/%{version}/src/kpublictransport-%{version}.tar.xz

BuildRequires: extra-cmake-modules
%if %{with gcc}
BuildRequires: gcc-toolset-14-gcc-c++
%else
BuildRequires: clang
%endif
BuildRequires: kf6-rpm-macros
BuildRequires: zlib-devel

BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Quick)

BuildRequires: cmake(KF6I18n)
BuildRequires: cmake(KF6NetworkManagerQt)
BuildRequires: qt6-qtbase-private-devel

%description
%{summary}.

%package devel
Summary: Development files for %{name}
License: BSD and CC0-1.0 and LGPLv2+ and MIT and ODbL-1.0
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
%{summary}.

%package        doc
Summary:        Developer Documentation files for %{name}
BuildArch:      noarch
%description    doc
Developer Documentation files for %{name} for use with KDevelop or QtCreator.

%prep
%autosetup

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

%cmake_kf6 -DQT_MAJOR_VERSION=6
%cmake_build

%install
%cmake_install

%find_lang %{name} --all-name

%files -f %{name}.lang
%{_kf6_datadir}/qlogging-categories6/org_kde_kpublictransport.categories
%{_kf6_libdir}/libKPublicTransport.so.1
%{_kf6_libdir}/libKPublicTransport.so.%{version}
%{_kf6_libdir}/libKPublicTransportOnboard.so.1
%{_kf6_libdir}/libKPublicTransportOnboard.so.%{version}
%{_kf6_qmldir}/org/kde/kpublictransport/*
%{_kf6_datadir}/qlogging-categories6/org_kde_kpublictransport_onboard.categories


%files devel
%{_includedir}/*
%{_kf6_libdir}/cmake/*
%{_kf6_libdir}/*.so
%{_qt6_docdir}/*.tags
 
%files doc
%{_qt6_docdir}/*.qch

%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)

* Thu Jun 20 2024 Raven <raven@sysadmins.ws> - 24.05.1-2
- rebuild (rx-glib2)

* 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

* Thu Apr 04 2024 Jan Grulich <jgrulich@redhat.com> - 24.02.1-2
- Rebuild (qt6)

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

* Sun Mar 10 2024 Marie Loise Nolden <loise@kde.org> - 24.02.0-2
- add missing BuildArch: noarch to -doc package

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

* Fri Feb 16 2024 Jan Grulich <jgrulich@redhat.com> - 24.01.95-2
- Rebuild (qt6)

* 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

* Tue Jan 09 2024 Marie Loise Nolden <loise@kde.org> - 24.01.85-2
- add doc package for KF6 API

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

* Fri Dec 8 2023 Steve Cossette <farchord@gmail.com> - 24.01.80-1
- 24.01.80

* Wed Nov 29 2023 Jan Grulich <jgrulich@redhat.com> - 24.01.75-2
- Rebuild (qt6)

* Sat Nov 25 2023 Steve Cossette <farchord@gmail.com> - 24.01.75-1
- 24.01.75

* 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

* Sun Jan 08 2023 Marc Deop <marcdeop@fedoraproject.org> - 22.12.1-1
- 22.12.1

* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 22.04.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jul 18 2022 Than Ngo <than@redhat.com> - 22.04.3-1
- 22.04.3

* Mon May 16 2022 Justin Zobel <justin@1707.io> - 22.04.1-1
- Update to 22.04.1

* Thu Apr 21 2022 Justin Zobel <justin@1707.io> - 21.12.3-1
- Update to 21.12.3

* Wed Feb 09 2022 Justin Zobel <justin@1707.io> - 21.12.2-1
- Update to 21.12.2

* Wed Dec 22 2021 Justin Zobel <justin@1707.io> - 21.12-1
- Initial version of package
