%bcond_with gcc

Name:    kmenuedit
Summary: KDE menu editor
Version: 6.2.5
Release: 1%{?dist}

License: CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later
URL:     https://invent.kde.org/plasma/%{name}

Source0: https://download.kde.org/stable/plasma/%{version}/%{name}-%{version}.tar.xz

BuildRequires:  qt6-qtbase-devel

BuildRequires:  desktop-file-utils
BuildRequires:  extra-cmake-modules
BuildRequires:  kf6-rpm-macros
BuildRequires:  cmake(KF6DBusAddons)
BuildRequires:  cmake(KF6DocTools)
BuildRequires:  cmake(KF6I18n)
BuildRequires:  cmake(KF6IconThemes)
BuildRequires:  cmake(KF6KIO)
BuildRequires:  cmake(KF6Sonnet)
BuildRequires:  cmake(KF6GlobalAccel)
BuildRequires:  libappstream-glib

# when split out from kde-workspace-4.11.x
Conflicts:      kde-workspace < 4.11.15-3

%description
%{summary}.


%prep
%autosetup -p1


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

%cmake_kf6
%cmake_build

%install
%cmake_install
%find_lang kmenuedit5 --with-html --all-name


%check
desktop-file-validate %{buildroot}%{_datadir}/applications/org.kde.kmenuedit.desktop
# commented out until upstream fixes a duplicate entries problem
#appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml

%files -f kmenuedit5.lang
%license LICENSES/*
%{_bindir}/kmenuedit
%{_datadir}/kmenuedit/
%{_datadir}/applications/org.kde.kmenuedit.desktop
%{_datadir}/icons/hicolor/*/apps/kmenuedit.*
%{_kf6_datadir}/qlogging-categories6/kmenuedit.categories
%{_kf6_datadir}/metainfo/org.kde.kmenuedit.appdata.xml

%changelog
* Thu Jan  2 2025 Raven <raven@sysadmins.ws> - 6.2.5-1
- 6.2.5

* Sat Dec 14 2024 Raven <raven@sysadmins.ws> - 6.2.4-2
- rebuild (qt6)

* Wed Nov 27 2024 Raven <raven@sysadmins.ws> - 6.2.4-1
- 6.2.4

* Wed Nov  6 2024 Raven <raven@sysadmins.ws> - 6.2.3-1
- 6.2.3

* Wed Oct 23 2024 Raven <raven@sysadmins.ws> - 6.2.2-1
- 6.2.2

* Tue Oct 15 2024 Raven <raven@sysadmins.ws> - 6.2.1-1
- 6.2.1

* Tue Oct  8 2024 Raven <raven@sysadmins.ws> - 6.2.0-1
- 6.2.0

* Thu Sep 12 2024 Raven <raven@sysadmins.ws> - 6.1.5-1
- 6.1.5

* Wed Aug  7 2024 Raven <raven@sysadmins.ws> - 6.1.4-1
- 6.1.4

* Mon Jul  8 2024 Raven <raven@sysadmins.ws> - 6.1.2-1
- 6.1.2

* Fri Jun 28 2024 Raven <raven@sysadmins.ws> - 6.1.1-1
- 6.1.1

* Wed Jun 26 2024 Raven <raven@sysadmins.ws> - 6.1.0-4
- rebuild with libxkbcommon_ng

* Tue Jun 18 2024 Raven <raven@sysadmins.ws> - 6.1.0-1
- 6.1.0

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