%undefine __cmake_in_source_build
%bcond_with clang

Name:          libdbusmenu-lxqt
Summary:       Library providing a way to implement DBusMenu protocol for LXQt
Version:       0.1.0
Release:       1%{?dist}
License:       LGPLv2+
URL:           https://lxqt-project.org/
Source0:       https://github.com/lxqt/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
BuildRequires: cmake
%if %{with clang}
BuildRequires: clang >= 5.0
%else
BuildRequires: gcc-c++
%endif
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: cmake(Qt6DBus)

%description
%{summary}.

%package devel
Summary:        Qt - development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
Files used for developing and building software that uses %{name}.

%prep
%autosetup -p1

%build
%if %{with clang}
export CC=clang
export CXX=clang++
%endif

%cmake
%cmake_build

%install
%cmake_install

%files
%license COPYING
%{_libdir}/libdbusmenu-lxqt.so.0
%{_libdir}/libdbusmenu-lxqt.so.%{version}

%files devel
%{_libdir}/cmake/dbusmenu-lxqt
%{_includedir}/dbusmenu-lxqt
%{_libdir}/libdbusmenu-lxqt.so
%{_libdir}/pkgconfig/dbusmenu-lxqt.pc

%changelog
* Fri Sep 27 2024 Raven <raven@sysadmins.ws> - 0.1.0-1
- initial package ported from fedora
