From c80aed9cfa144087f5874089c71e660777fdec07aeb601283be6f80f0f88ef81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 28 May 2020 07:33:22 +0000 Subject: [PATCH] Accepting request 809557 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/809557 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-astropy?expand=0&rev=25 --- python-astropy.changes | 5 +++++ python-astropy.spec | 39 +++++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/python-astropy.changes b/python-astropy.changes index 1e9c41c..ce37c1f 100644 --- a/python-astropy.changes +++ b/python-astropy.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 27 09:36:06 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Sun Apr 19 10:53:30 UTC 2020 - Benjamin Greiner diff --git a/python-astropy.spec b/python-astropy.spec index a446ef9..2360502 100644 --- a/python-astropy.spec +++ b/python-astropy.spec @@ -17,6 +17,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define binaries fitsdiff fitsheader fitscheck fitsinfo fits2bitmap samp_hub showtable volint wcslint %define skip_python2 1 Name: python-astropy Version: 4.0.1.post1 @@ -48,12 +49,14 @@ Requires: liberfa1 >= 1.7.0 Requires: python-dbm Requires: python-matplotlib >= 2.1 Requires: python-numpy >= 1.7.0 +Requires(post): update-alternatives +Requires(postun): update-alternatives Recommends: libxml2-tools +Recommends: python-Bottleneck Recommends: python-Jinja2 Recommends: python-PyYAML Recommends: python-asdf >= 2.5 Recommends: python-beautifulsoup4 -Recommends: python-Bottleneck Recommends: python-bleach Recommends: python-h5py Recommends: python-ipython @@ -111,7 +114,9 @@ echo "use_system_libraries=1" >> setup.cfg %install %python_install --use-system-libraries --offline - +for b in %{binaries}; do + %python_clone -a %{buildroot}%{_bindir}/$b +done chmod a-x %{buildroot}%{python_sitearch}/astropy/wcs/tests/data/header_with_time.fits # Deduplicating files can generate a RPMLINT warning for pyc mtime @@ -136,7 +141,7 @@ $python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/ export PYTHONDONTWRITEBYTECODE=1 # http://docs.astropy.org/en/latest/development/testguide.html#running-tests %python_exec setup.py build_ext --inplace --offline -%ifarch aarch64 +%ifarch aarch64 # doctest failure because of precision errors %define skippytest -k 'not bayesian_info_criterion_lsq' %endif @@ -145,18 +150,28 @@ export PYTHONDONTWRITEBYTECODE=1 --ignore "docs/whatsnew" %{?skippytest} } +%post +for b in %{binaries}; do + %python_install_alternative $b +done + +%postun +for b in %{binaries}; do + %python_uninstall_alternative $b +done + %files %{python_files} %doc CHANGES.rst README.rst %license licenses/* -%python3_only %{_bindir}/fitsdiff -%python3_only %{_bindir}/fitsheader -%python3_only %{_bindir}/fitscheck -%python3_only %{_bindir}/fitsinfo -%python3_only %{_bindir}/fits2bitmap -%python3_only %{_bindir}/samp_hub -%python3_only %{_bindir}/showtable -%python3_only %{_bindir}/volint -%python3_only %{_bindir}/wcslint +%python_alternative %{_bindir}/fitsdiff +%python_alternative %{_bindir}/fitsheader +%python_alternative %{_bindir}/fitscheck +%python_alternative %{_bindir}/fitsinfo +%python_alternative %{_bindir}/fits2bitmap +%python_alternative %{_bindir}/samp_hub +%python_alternative %{_bindir}/showtable +%python_alternative %{_bindir}/volint +%python_alternative %{_bindir}/wcslint %{python_sitearch}/astropy/ %{python_sitearch}/astropy-%{version}-py*.egg-info