%bcond_with gcc

%define kf6_version 6.0
%define qt6_version 6.5

Name:           klevernotes
Version:        1.1.0
Release:        1%{dist}
Summary:        Note taking and management application
License:        GPL-3.0-or-later
URL:            https://apps.kde.org/klevernotes/
Source0:        https://download.kde.org/stable/klevernotes/%{version}/%{name}-%{version}.tar.xz

%if %{with gcc}
BuildRequires: gcc-toolset-14-gcc-c++
%else
BuildRequires: clang
%endif
BuildRequires:  kf6-rpm-macros
BuildRequires:  extra-cmake-modules
BuildRequires:  cmake(KF6Config) >= %{kf6_version}
BuildRequires:  cmake(KF6ConfigWidgets) >= %{kf6_version}
BuildRequires:  cmake(KF6CoreAddons) >= %{kf6_version}
BuildRequires:  cmake(KF6I18n) >= %{kf6_version}
BuildRequires:  cmake(KF6KIO) >= %{kf6_version}
BuildRequires:  cmake(KF6Kirigami) >= %{kf6_version}
BuildRequires:  cmake(Qt6Core) >= %{qt6_version}
BuildRequires:  cmake(Qt6Gui) >= %{qt6_version}
BuildRequires:  cmake(Qt6PrintSupport) >= %{qt6_version}
BuildRequires:  cmake(Qt6Qml) >= %{qt6_version}
BuildRequires:  cmake(Qt6QuickControls2) >= %{qt6_version}
BuildRequires:  cmake(Qt6Svg) >= %{qt6_version}
BuildRequires:  cmake(Qt6WebEngineQuick) >= %{qt6_version}


%description
KleverNotes allows you to create and preview a Markdown note while giving you
the freedom to customize the preview from settings or using a CSS theme.
You can organize your notes however you want with a combination of categories
and groups, which will be directly reflected on your system in the hierarchy of
your KleverNotes storage folders. Simply choose your storage location and
you're ready to write!

You can print your notes, add small sketches and even create specific tasks for
each of them.

Notes are saved as Markdown files in your KleverNotes storage for easy access.
They support the entire CommonMark specification with extensive syntax.
KleverNotes also introduces a small collection of opt-in “plugins” to extend
basic markdown features, such as: code highlighting, note linking, quick
emoji, etc.

%prep
%autosetup -p1

%build
%if %{with gcc}
%enable_devtoolset14
export CC=gcc
export CXX=c++
%endif

%cmake_kf6

%cmake_build

%install
%cmake_install

%find_lang %{name} --all-name

%files -f %{name}.lang
%license LICENSES/*
%doc README.md
%{_kf6_bindir}/klevernotes
%{_datadir}/applications/org.kde.klevernotes.desktop
%{_metainfodir}/org.kde.klevernotes.metainfo.xml
%{_datadir}/icons/hicolor/scalable/apps/org.kde.klevernotes.svg


%changelog
* Wed Oct 23 2024 Raven <raven@sysadmins.ws> - 1.1.0-1
- Initial build
