Add -tests subpackage with unit tests that can run in CI

Resolves: RHEL-28239
This commit is contained in:
Jan Grulich 2024-03-28 13:14:15 +01:00
parent 9c24ea3cc9
commit eecc888a62

View File

@ -18,11 +18,12 @@
%endif
%global examples 1
%global build_tests 1
Summary: Qt6 - Multimedia support
Name: qt6-%{qt_module}
Version: 6.6.1
Release: 3%{?dist}
Release: 4%{?dist}
License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
Url: http://www.qt.io
@ -105,6 +106,15 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%{summary}.
%endif
%if 0%{?build_tests}
%package tests
Summary: Unit tests for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description tests
%{summary}.
%endif
%prep
%autosetup -n %{qt_module}-everywhere-src-%{qt_version}%{?unstable:-%{prerelease}} -p1
@ -113,14 +123,29 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} < 10
. /opt/rh/gcc-toolset-12/enable
%endif
%cmake_qt6 -DQT_BUILD_EXAMPLES:BOOL=%{?examples:ON}%{!?examples:OFF}
%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
## .prl/.la file love
# nuke .prl reference(s) to %%buildroot, excessive (.la-like) libs
pushd %{buildroot}%{_qt6_libdir}
@ -188,8 +213,16 @@ popd
%{_qt6_examplesdir}/
%endif
%if 0%{?build_tests}
%files tests
%{_qt6_archdatadir}/tests
%endif
%changelog
* Thu Mar 28 2024 Jan Grulich <jgrulich@redhat.com> - 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 <releng@fedoraproject.org> - 6.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild