## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 3;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%bcond check 0

Name:           kaidan
Version:        0.11.0
Release:        %autorelease
Summary:        A XMPP client based on KDE Framework
License:        GPL-3.0-or-later AND MIT AND Apache-2.0 AND CC-BY-SA-4.0 AND LGPL-2.0-or-later
URL:            https://invent.kde.org/network/kaidan
Source0:        %{url}/-/archive/v%{version}/%{name}-v%{version}.tar.gz

%if 0%{?fedora} || 0%{?epel} > 7
# handled by qt6-srpm-macros, which defines %%qt6_qtwebengine_arches
# Package doesn't build on arches that qtwebengine is not built on.
ExclusiveArch: %{qt6_qtwebengine_arches}
%endif

# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}

BuildRequires:  gcc-c++
BuildRequires:  cmake
BuildRequires:  ninja-build
BuildRequires:  extra-cmake-modules

BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6Concurrent)
BuildRequires:  cmake(Qt6Qml)
BuildRequires:  cmake(Qt6Quick)
BuildRequires:  cmake(Qt6Svg)
BuildRequires:  cmake(Qt6Sql)
BuildRequires:  cmake(Qt6QuickControls2)
BuildRequires:  cmake(Qt6Xml)
BuildRequires:  cmake(Qt6Multimedia)
BuildRequires:  cmake(Qt6Positioning)
BuildRequires:  cmake(Qt6Location)
BuildRequires:  cmake(Qt6Test)


BuildRequires:  cmake(KF6KIO)
BuildRequires:  cmake(KF6Kirigami2)
BuildRequires:  cmake(KF6Prison)
BuildRequires:  cmake(KF6Crash)
BuildRequires:  cmake(KF6KirigamiAddons)
BuildRequires:  cmake(KF6Notifications)
BuildRequires:  cmake(KF6QQC2DesktopStyle)

BuildRequires:  cmake(QXmppQt6)
BuildRequires:  libicu-devel

BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib

# src/hsluv-c directory
# https://github.com/hsluv/hsluv-c
Provides:       bundled(hsluv-c)
# src/singleapp directory
# https://github.com/itay-grudev/SingleApplication
Provides:       bundled(SingleApplication)

# QML module dependencies
Requires:       kf6-kirigami2%{?_isa}
Requires:       kf6-kirigami2-addons%{?_isa}
Requires:       kf6-kquickcharts%{?_isa}
Requires:       qt6-qtwebchannel%{?_isa}
Requires:       qt6-qtwebengine%{?_isa}
Requires:       kquickimageeditor-qt6%{?_isa}
Requires:       hicolor-icon-theme

%description
Kaidan is a simple, user-friendly and modern chat client. It uses the open
communication protocol XMPP (Jabber). The user interface makes use of Kirigami
and QtQuick, while the back-end of Kaidan is entirely written in C++ using Qt
and the Qt-based XMPP library QXmpp.

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

%build
%cmake \
    -GNinja \
    -DUSE_KNOTIFICATIONS=ON \
%if %{with check}
    -DBUILD_TESTING=ON \
%else
    -DBUILD_TESTS=OFF \
%endif

%cmake_build

%install
%cmake_install
%find_lang %{name} --with-qt

%check
%if %{with check}
%ctest -E 'PublicGroupChatTest'
%endif

desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml

%files -f %{name}.lang
%license LICENSES/*
%doc README.md
%{_bindir}/kaidan
%{_datadir}/applications/im.kaidan.kaidan.desktop
%{_datadir}/icons/hicolor/128x128/apps/kaidan.png
%{_datadir}/icons/hicolor/scalable/apps/kaidan.svg
%{_datadir}/kaidan/
%{_datadir}/knotifications6/kaidan.notifyrc
%{_datadir}/metainfo/im.kaidan.kaidan.appdata.xml
%{_datadir}/qlogging-categories6/kaidan.categories

%changelog
## START: Generated by rpmautospec
* Tue Mar 04 2025 Yaakov Selkowitz <yselkowi@redhat.com> - 0.11.0-3
- Enable on ppc64le

* Sun Feb 16 2025 topazus <topazus@outlook.com> - 0.11.0-2
- Fix build; rhbz#2345910 and rhbz#2345913

* Sat Feb 15 2025 topazus <topazus@outlook.com> - 0.11.0-1
- 0.11.0

* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild

* Tue Dec 17 2024 topazus <topazus@outlook.com> - 0.10.1-2
- Fix packit

* Mon Dec 16 2024 topazus <topazus@outlook.com> - 0.10.1-1
- 0.10.1

* Fri Jul 26 2024 topazus <topazus@outlook.com> - 0.9.2-1
- 0.9.2

* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sun May 26 2024 topazus <topazus@outlook.com> - 0.9.1-9
- rebuild with qxmpp

* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Dec 11 2023 topazus <topazus@outlook.com> - 0.9.1-6
- fix runtime dependency name of kquickimageeditor; fix rhbz#2253555

* Wed Dec 06 2023 Yaakov Selkowitz <yselkowitz@fedoraproject.org> - 0.9.1-5
- Avoid build dependency on kquickimageeditor-devel

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

* Fri Jul 14 2023 topazus <topazus@outlook.com> - 0.9.1-3
- add runtime dependency kquickimageeditor

* Wed Jul 12 2023 topazus <topazus@outlook.com> - 0.9.1-2
- fix license; mark bundled libraries

* Mon Jul 10 2023 topazus <topazus@outlook.com> - 0.9.1-1
- initial import; RHBZ#2216600
## END: Generated by rpmautospec