From 3a9493bcc403e599e15584f715b45d429f14c55b Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 2 Apr 2024 16:37:18 +0200 Subject: [PATCH] Add -tests subpackage with unit tests that can run in CI Resolves: RHEL-28239 --- qt6-qtvirtualkeyboard.spec | 43 +++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/qt6-qtvirtualkeyboard.spec b/qt6-qtvirtualkeyboard.spec index 59fa212..28b21dd 100644 --- a/qt6-qtvirtualkeyboard.spec +++ b/qt6-qtvirtualkeyboard.spec @@ -6,10 +6,13 @@ %global prerelease rc2 %endif +%global examples 1 +%global build_tests 1 + Summary: Qt6 - VirtualKeyboard component Name: qt6-%{qt_module} Version: 6.6.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-3.0-only WITH Qt-GPL-exception-1.0 Url: http://qt.io @@ -61,11 +64,21 @@ Requires: qt6-qtbase-devel%{?_isa} %description devel %{summary}. +%if 0%{?examples} %package examples Summary: Programming examples for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description examples %{summary}. +%endif + +%if 0%{?build_tests} +%package tests +Summary: Unit tests for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +%description tests +%{summary}. +%endif %prep @@ -73,14 +86,27 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %build -%cmake_qt6 +%cmake_qt6 \ + -DQT_BUILD_EXAMPLES:BOOL=%{?examples:ON}%{!?examples:OFF} \ + -DQT_BUILD_TESTS=%{?build_tests:ON}%{!?build_tests:OFF} + +%if 0%{?build_tests} +%qt6_fix_tests +%endif %cmake_build - %install +%if 0%{?build_tests} +%qt6_dont_autoinstall_tests +%endif + %cmake_install +%if 0%{?build_tests} +%qt6_install_tests +%endif + %files %license LICENSES/* %{_qt6_libdir}/libQt6HunspellInputMethod.so.6* @@ -110,11 +136,22 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %{_qt6_libdir}/qt6/metatypes/qt6*_metatypes.json %{_qt6_libdir}/pkgconfig/*.pc +%if 0%{?examples} %files examples %{_qt6_examplesdir}/ +%endif + +%if 0%{?build_tests} +%files tests +%{_qt6_archdatadir}/tests +%endif %changelog +* Tue Apr 02 2024 Jan Grulich - 6.6.1-4 +- Add -tests subpackage with unit tests that can run in CI + Resolves: RHEL-28239 + * Fri Jan 26 2024 Fedora Release Engineering - 6.6.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild