%global rname QHotkey Name: qhotkey Version: 1.5.0 Release: 1%{?dist} Summary: A global shortcut library for Desktop Qt-Applications License: BSD-3-Clause URL: https://github.com/Skycoder42/QHotkey Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/%{rname}-%{version}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: qt5-qtbase-devel BuildRequires: qt6-qtbase-devel BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5X11Extras) BuildRequires: pkgconfig(x11) %description QHotkey is a library to handle global shortcuts (hotkeys) in Qt applications, on both Windows and Linux (X11). %package -n qhotkey-qt5 Summary: A global shortcut library for Qt5 %description -n qhotkey-qt5 QHotkey is a library to handle global shortcuts (hotkeys) in Qt applications, on both Windows and Linux (X11). This package contains the Qt5 version. %package -n qhotkey-qt6 Summary: A global shortcut library for Qt6 %description -n qhotkey-qt6 QHotkey is a library to handle global shortcuts (hotkeys) in Qt applications, on both Windows and Linux (X11). This package contains the Qt6 version. %package qt5-devel Summary: Development files for QHotkey Qt5 Requires: qhotkey-qt5 = %{version}-%{release} Requires: qt5-qtbase-devel Requires: qt5-qtx11extras-devel %description qt5-devel Development files for QHotkey Qt5 %package qt6-devel Summary: Development files for QHotkey Qt5 Requires: qhotkey-qt6 = %{version}-%{release} Requires: qt5-qtbase-devel Requires: qt5-qtx11extras-devel %description qt6-devel Development files for QHotkey Qt6 %prep %autosetup -n %{rname}-%{version} %build # Build for Qt5 %{set_build_flags} mkdir -p build-qt5 pushd build-qt5 %cmake -DQT_DEFAULT_MAJOR_VERSION=5 -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=%{_libdir}/qt5 \ -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_qt5_headerdir} \ .. %cmake_build popd # Build for Qt6 %{set_build_flags} mkdir -p build-qt6 pushd build-qt6 %cmake -DQT_DEFAULT_MAJOR_VERSION=6 -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=%{_libdir}/qt6 \ -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_qt6_headerdir} \ .. %cmake_build popd %install # Install Qt5 version pushd build-qt5 %cmake_install popd # Install Qt6 version pushd build-qt6 %cmake_install popd #%%check #cmake HotkeyTest -DQT_DEFAULT_MAJOR_VERSION=5 %files -n qhotkey-qt5 %license LICENSE %doc README.md %{_libdir}/qt5/libqhotkey*.so.* %files -n qhotkey-qt6 %license LICENSE %doc README.md %{_libdir}/qt6/libqhotkey*.so.* %files qt5-devel %doc README.md %dir %{_libdir}/qt5/cmake %dir %{_libdir}/qt5/cmake/QHotkey %{_libdir}/qt5/cmake/QHotkey/QHotkeyConfig.cmake %{_libdir}/qt5/cmake/QHotkey/QHotkeyConfigVersion.cmake %{_libdir}/qt5/cmake/QHotkey/QHotkeyConfig-release.cmake %{_libdir}/qt5/libqhotkey*.so %dir %{_includedir}/qt5 %{_includedir}/qt5/QHotkey %{_includedir}/qt5/qhotkey.h %files qt6-devel %doc README.md %dir %{_libdir}/qt6/cmake %dir %{_libdir}/qt6/cmake/QHotkey %{_libdir}/qt6/cmake/QHotkey/QHotkeyConfig.cmake %{_libdir}/qt6/cmake/QHotkey/QHotkeyConfigVersion.cmake %{_libdir}/qt6/cmake/QHotkey/QHotkeyConfig-release.cmake %{_libdir}/qt6/libqhotkey*.so %dir %{_includedir}/qt6 %{_includedir}/qt6/QHotkey %{_includedir}/qt6/qhotkey.h %changelog * Sat Jul 06 2024 Martin Gansser - 1.5.0-1 - Initial package