From c24628c52a6d237c1b6af449fb8c626ba755eec630e34638f1e18f40dc40a7fc Mon Sep 17 00:00:00 2001 From: Atri Bhattacharya Date: Sat, 15 May 2021 11:38:28 +0000 Subject: [PATCH] Accepting request 887283 from home:badshah400:branches:science Split tests into a multibuild flavor to avoid circular BuildRequires with python-ligo-lw and other test requirements. OBS-URL: https://build.opensuse.org/request/show/887283 OBS-URL: https://build.opensuse.org/package/show/science/lal?expand=0&rev=17 --- _multibuild | 3 +++ lal.changes | 6 ++++++ lal.spec | 22 ++++++++++++++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/lal.changes b/lal.changes index f19aeac..d5ab192 100644 --- a/lal.changes +++ b/lal.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 21 10:59:16 UTC 2021 - Atri Bhattacharya + +- Split tests into a multibuild flavor to avoid circular + BuildRequires with python-ligo-lw and other test requirements. + ------------------------------------------------------------------- Fri Feb 26 22:23:19 UTC 2021 - Atri Bhattacharya diff --git a/lal.spec b/lal.spec index 53478ad..9f99a9d 100644 --- a/lal.spec +++ b/lal.spec @@ -16,6 +16,15 @@ # +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%bcond_without test +%define psuffix -test +%else +%bcond_with test +%define psuffix %{nil} +%endif + # NEP 29: numpy, scipy do not have a python36 flavor package in TW %define skip_python36 1 @@ -59,6 +68,7 @@ BuildRequires: swig >= 4.0 %else BuildRequires: swig >= 3.0 %endif +%if %{with test} # SECTION For tests (only the default python3 flavor) BuildRequires: python3-freezegun BuildRequires: python3-ligo-lw @@ -67,6 +77,7 @@ BuildRequires: python3-pytest BuildRequires: python3-python-dateutil BuildRequires: python3-scipy # /SECTION +%endif %python_subpackages @@ -142,6 +153,7 @@ popd } %install +%if %{without test} %{python_expand # all python flavors as configured above export PYTHON=$python pushd ../${PYTHON}_build @@ -154,8 +166,6 @@ rm %{buildroot}%{_sysconfdir}/* find %{buildroot} -type f -name "*.la" -delete -print find %{buildroot}%{_libdir} -name "*.a" -delete -print -%python_expand %fdupes %{buildroot}%{$python_sitearch}/ - %{python_expand # FIX env HASHBANGS sed -Ei "1{/^#!\/usr\/bin\/env python/d}" %{buildroot}%{$python_sitearch}/lal/gpstime.py sed -Ei "1{/^#!\/usr\/bin\/env python/d}" %{buildroot}%{$python_sitearch}/lal/series.py @@ -163,7 +173,11 @@ sed -Ei "1{/^#!\/usr\/bin\/env python/d}" %{buildroot}%{$python_sitearch}/lal/an } %{?python_compileall} +%python_expand %fdupes %{buildroot}%{$python_sitearch}/ +%endif + %check +%if %{with test} %{python_expand # Run tests from the build dir of the primary python3 flavor only if [ "$python_" = "python3_" -o "%{$python_provides}" = "python3" ]; then export PYTHON=$python @@ -172,7 +186,9 @@ pushd ../${PYTHON}_build popd fi } +%endif +%if %{without test} %post -n %{shliblal} -p /sbin/ldconfig %post -n %{shliblalsupport} -p /sbin/ldconfig %postun -n %{shliblal} -p /sbin/ldconfig @@ -204,4 +220,6 @@ fi %{_libdir}/octave/*/site/oct/*/*.oct %endif +%endif + %changelog