[pyfits] Enable testing in %check

Sergio Pascual sergiopr at fedoraproject.org
Wed Dec 11 13:00:49 UTC 2013


commit db5fef4699bddd6b2f3b6ac5240ba545cffc513a
Author: Sergio Pascual <sergiopr at fis.ucm.es>
Date:   Wed Dec 11 14:00:43 2013 +0100

    Enable testing in %check
    
    - Split tools into subpackage

 pyfits.spec |   49 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 39 insertions(+), 10 deletions(-)
---
diff --git a/pyfits.spec b/pyfits.spec
index 80da94e..3437de5 100644
--- a/pyfits.spec
+++ b/pyfits.spec
@@ -8,7 +8,7 @@
 
 Name: pyfits
 Version: 3.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: Python interface to FITS
 
 Group: Development/Languages
@@ -19,18 +19,31 @@ Source0: http://pypi.python.org/packages/source/p/pyfits/%{name}-%{version}.tar.
 Patch0: pyfits-unbundle-cfitsio.patch
 
 BuildRequires: python2-devel python-setuptools python-d2to1 numpy cfitsio-devel
+BuildRequires: python-nose
 Requires: numpy
 
-%description
-PyFITS provides an interface to FITS formatted files under the Python 
-scripting language. It is useful both for interactive data analysis and for 
-writing analysis scripts in Python using FITS files as either input or output. 
+# Package split before F20 is released
+Requires:  pyfits-tools = %{version}-%{release}
+
+%description 
+PyFITS provides an interface to FITS formatted files under the Python
+scripting language. It is useful both for interactive data analysis and for
+writing analysis scripts in Python using FITS files as either input or output.
+
+%package tools
+Summary: Pyfits utility tools
+BuildArch: noarch
+Requires: pyfits = %{version}-%{release}
+
+%description tools
+Utilities provided by Pyfits: 'fitscheck' and 'fitsdiff'
 
 %if 0%{?with_python3}
 %package -n python3-pyfits
 Summary: Python interface to FITS
 BuildRequires: python3-tools
 BuildRequires: python3-devel python3-setuptools python3-d2to1 python3-numpy
+BuildRequires: python3-nose
 BuildRequires: cfitsio-devel
 Requires: python3-numpy
 
@@ -46,7 +59,7 @@ writing analysis scripts in Python using FITS files as either input or output.
 sed -i -e "1d" lib/pyfits/core.py
 # remove bundled cfitsio
 rm -rf cextern/cfitsio
-find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
+find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
 
 %if 0%{?with_python3}
 rm -rf %{py3dir}
@@ -55,7 +68,7 @@ find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
 %endif # with_python3
 
 %build
-CFLAGS="%{optflags}" %{__python} setup.py build
+CFLAGS="%{optflags}" %{__python2} setup.py build
 
 %if 0%{?with_python3}
 pushd %{py3dir}
@@ -63,6 +76,16 @@ CFLAGS="%{optflags}" %{__python3} setup.py build
 popd
 %endif # with_python3
 
+%check
+pushd %{buildroot}/%{python2_sitearch}
+nosetests-%{python2_version} pyfits
+popd
+%if 0%{?with_python3}
+pushd %{buildroot}/%{python3_sitearch}
+nosetests-%{python3_version} pyfits
+popd
+%endif # with_python3
+
 %install
 rm -rf %{buildroot}
 %if 0%{?with_python3}
@@ -72,14 +95,16 @@ chmod 755 %{buildroot}%{python3_sitearch}/pyfits/compression*.so
 popd
 %endif # with_python3
 
-%{__python} setup.py install --skip-build --root  %{buildroot}
-chmod 755 %{buildroot}%{python_sitearch}/pyfits/compression.so
+%{__python2} setup.py install --skip-build --root  %{buildroot}
+chmod 755 %{buildroot}%{python2_sitearch}/pyfits/compression.so
 
 %files
 %doc FAQ.txt README.txt LICENSE.txt CHANGES.txt
+%{python2_sitearch}/*
+
+%files tools
 %{_bindir}/fitscheck
 %{_bindir}/fitsdiff
-%{python_sitearch}/*
 
 %if 0%{?with_python3}
 %files -n python3-pyfits
@@ -88,6 +113,10 @@ chmod 755 %{buildroot}%{python_sitearch}/pyfits/compression.so
 %endif # with_python3
 
 %changelog
+* Wed Dec 11 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 3.2-3
+- Enable testing in %%check
+- Split tools into subpackage
+
 * Thu Dec 05 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 3.2-2
 - Fix permissions of extension modules
 


More information about the scm-commits mailing list