[pyfits] New upstream version (with Python 3 support) Python 3 support enabled

Sergio Pascual sergiopr at fedoraproject.org
Thu Sep 22 00:56:01 UTC 2011


commit badeb22f3840262cb6b3153a5c5d1f8d46ed4565
Author: Sergio Pascual <sergiopr at fis.ucm.es>
Date:   Thu Sep 22 02:55:36 2011 +0200

    New upstream version (with Python 3 support)
    Python 3 support enabled

 .gitignore  |    1 +
 pyfits.spec |   70 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 sources     |    2 +-
 3 files changed, 63 insertions(+), 10 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index be82b07..0c0be0e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 pyfits-2.3.1.tar.gz
 /pyfits-2.4.0.tar.gz
+/pyfits-3.0.1.tar.gz
diff --git a/pyfits.spec b/pyfits.spec
index e6f8181..e556cf4 100644
--- a/pyfits.spec
+++ b/pyfits.spec
@@ -1,17 +1,29 @@
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+%global with_python3 1
+%else
+%{!?python_sitearch: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}
+%endif
+
 Name: pyfits
-Version: 2.4.0
-Release: 2%{?dist}
+Version: 3.0.1
+Release: 1%{?dist}
 Summary: Python interface to FITS
 
 Group: Development/Languages
 License: BSD
 
 URL: http://www.stsci.edu/resources/software_hardware/pyfits
-Source0: http://www.stsci.edu/resources/software_hardware/pyfits/%{name}-%{version}.tar.gz
+Source0: http://pypi.python.org/packages/source/p/pyfits/%{name}-%{version}.tar.gz
 
 BuildRequires: python2-devel python-setuptools numpy
 Requires: numpy
 
+%if 0%{?with_python3}
+BuildRequires: python3-devel python3-numpy python3-setuptools
+Requires: python3-numpy
+%endif # with_python3
+
+
 # we don't want to provide private python extension libs
 %{?filter_setup:
 %filter_provides_in %{python_sitearch}/.*\.so$ 
@@ -23,28 +35,68 @@ 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. 
 
+%if 0%{?with_python3}
+%package -n python3-pyfits
+Summary: Python interface to FITS
+
+%description -n python3-pyfits
+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. 
+%endif # with_python3
+
 %prep
 %setup -q
-sed -i -e "1d" lib/core.py
+sed -i -e "1d" lib/pyfits/core.py
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif # with_python3
+
+find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
 
 %build
 CFLAGS="%{optflags}" %{__python} setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+CFLAGS="%{optflags}" %{__python3} setup.py build
+popd
+%endif # with_python3
+
 %install
 rm -rf %{buildroot}
-%{__python} setup.py install -O1 --skip-build --root  %{buildroot}
-chmod 755 %{buildroot}%{python_sitearch}/pyfits/pyfitsComp.so
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root  %{buildroot}
+chmod 755 %{buildroot}%{python3_sitearch}/pyfits/compression*.so
+popd
+%endif # with_python3
 
-%clean
-rm -rf %{buildroot}
+%{__python} setup.py install -O1 --skip-build --root  %{buildroot}
+chmod 755 %{buildroot}%{python_sitearch}/pyfits/compression.so
 
 %files
 %defattr(-,root,root,-)
-%doc lib/LICENSE.txt 
+%doc LICENSE.txt CHANGES.txt
 %{_bindir}/fitscheck
 %{python_sitearch}/*
 
+%if 0%{?with_python3}
+%files -n python3-pyfits
+%doc LICENSE.txt CHANGES.txt
+# Provides the same functionality than the 2.x version
+%exclude %{_bindir}/fitscheck
+%{python3_sitearch}/*
+%endif # with_python3
+
 %changelog
+* Wed Sep 21 2011 Sergio Pascual <sergiopr at fedoraproject.org> - 3.0.1-1
+- New upstream version (with Python 3 support)
+- Python 3 support enabled
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.4.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
diff --git a/sources b/sources
index 3fd1c1b..c981c0c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6f37b5210b41facb9c93c8d0898d14f6  pyfits-2.4.0.tar.gz
+3e65f78484e10b69c9ea6c43548adb05  pyfits-3.0.1.tar.gz


More information about the scm-commits mailing list