From e4d63d7aafd4194628f3df0c85ed581bab8d3827 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 5 Oct 2023 22:45:41 +0200 Subject: [PATCH] Conditionalize qt6 build --- qcustomplot.spec | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/qcustomplot.spec b/qcustomplot.spec index ce6ce42..6cd8839 100644 --- a/qcustomplot.spec +++ b/qcustomplot.spec @@ -4,9 +4,15 @@ %global lib_ver 2.0.0 #global pre beta +%if 0%{?rhel} +%bcond_with qt6 +%else +%bcond_without qt6 +%endif + Name: qcustomplot Version: 2.1.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Qt widget for plotting and data visualization License: GPL-3.0-or-later @@ -18,7 +24,9 @@ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: gcc-c++ BuildRequires: qt5-qtbase-devel +%if %{with qt6} BuildRequires: qt6-qtbase-devel +%endif %description @@ -52,6 +60,7 @@ The %{name}-devel package contains libraries and header files for developing applications that use %{name} (Qt5). +%if %{with qt6} %package qt6 Summary: Qt widget for plotting and data visualization Requires: %{name}-qt5%{?_isa} = %{version}-%{release} @@ -72,6 +81,7 @@ Requires: %{name}-qt5%{?_isa} = %{version}-%{release} %description qt6-devel The %{name}-devel package contains libraries and header files for developing applications that use %{name} (Qt6). +%endif %package doc @@ -93,23 +103,20 @@ cp -a %{SOURCE1} . %cmake -DQT_VER=5 -DLIB_VER=%{lib_ver} %cmake_build +%if %{with qt6} %define _vpath_builddir %{_target_platform}-qt6 %cmake -DQT_VER=6 -DLIB_VER=%{lib_ver} %cmake_build +%endif %install %define _vpath_builddir %{_target_platform}-qt5 %cmake_install -%define _vpath_builddir %{_target_platform}-qt6 -%cmake_install - -# pkg-config files -for qtver in -qt5 -qt6; do - install -d %{buildroot}%{_libdir}/pkgconfig/ -cat > %{buildroot}%{_libdir}/pkgconfig/%{name}$qtver.pc < %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc < %{buildroot}%{_libdir}/pkgconfig/%{name}-qt6.pc < - 2.1.1-7 +- Conditionalize qt6 build + * Fri Jul 21 2023 Fedora Release Engineering - 2.1.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild