Blob Blame History Raw
%global with_python3 1

Name: pyfits
Version: 3.3
Release: 6%{?dist}
Summary: Python interface to FITS

Group: Development/Languages
License: BSD

URL: http://www.stsci.edu/resources/software_hardware/pyfits
Source0: http://pypi.python.org/packages/source/p/pyfits/%{name}-%{version}.tar.gz
Patch0: pyfits-unbundle-cfitsio.patch
Patch1: pyfits-python3-script.patch
Patch2: pyfits-disable-checksum-test.patch

BuildRequires: python2-devel python-setuptools python-d2to1 numpy
BuildRequires: 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.

%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

%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
%patch0 -p1
%patch1 -p1
%patch2 -p1
sed -i -e "1d" lib/pyfits/core.py
# remove bundled cfitsio
rm -rf cextern/cfitsio
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3

%build
CFLAGS="%{optflags}" %{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
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}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
chmod 755 %{buildroot}%{python3_sitearch}/pyfits/compression*.so
popd
%endif # with_python3

%{__python2} setup.py install --skip-build --root %{buildroot}
chmod 755 %{buildroot}%{python2_sitearch}/pyfits/compression.so

%files
%doc FAQ.txt README.txt CHANGES.txt
%license LICENSE.txt
%{python2_sitearch}/*

%if 0%{?with_python3}
%files -n python3-pyfits
%doc FAQ.txt README.txt CHANGES.txt
%license LICENSE.txt
%exclude %{_bindir}/*
%{python3_sitearch}/*
%endif # with_python3

%changelog
* Mon Jun 29 2015 Sergio Pascual <sergiopr@fedoraproject.org> - 3.3-6
- Remove requires on pyfits-tools (will be provided by astropy-tools)

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Tue Jul 29 2014 Sergio Pascual <sergiopr@fedoraproject.org> 3.3-3
- New upstream source (3.3)
- And the tarball
- Readd checksum patch

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Jun 03 2014 Sergio Pascual <sergiopr@fedoraproject.org> 3.2.4-1
- New upstream source (3.2.4)

* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 3.2.2-6
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Thu Apr 03 2014 Sergio Pascual <sergiopr@fedoraproject.org> 3.2.2-5
- Really disable test failing in i686

* Tue Apr 01 2014 Sergio Pascual <sergiopr@fedoraproject.org> 3.2.2-4
- Disable test failing in i686
- EVR bump

* Thu Mar 27 2014 Sergio Pascual <sergiopr@fedoraproject.org> 3.2.2-2
- New upstream source (3.2.2) added

* Thu Mar 27 2014 Sergio Pascual <sergiopr@fedoraproject.org> 3.2.2-1
- New upstream source (3.2.2)

* Thu Jan 09 2014 Sergio Pascual <sergiopr@fedoraproject.org> 3.2-4
- Rebuilt for new cfitsio (3.360)

* Wed Dec 11 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 3.2-3
- Enable testing in %%check
- Split tools into subpackage

* Thu Dec 05 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 3.2-2
- Fix permissions of extension modules

* Wed Dec 04 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 3.2-1
- New upstream 3.2

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Apr 26 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 3.1.2-1
- New upstream 3.1.2 (bugfixes)

- Added FAQ.txt and README.txt to doc
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jan 02 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 3.1.1-1
- New upstream 3.1.1 (bugfixes)
- Added FAQ.txt and README.txt to doc

* Wed Aug 29 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.1-1
- New upstream 3.1
- New program fitscheck

* Sun Aug 05 2012 David Malcolm <dmalcolm@redhat.com> - 3.0.8-3
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jun 21 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.0.8-1
- New upstream source
- A better patch to unbundle zlib from Kacper Kowalik (Gentoo)

* Wed Apr 25 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.0.7-3
- Added a filter to provides in python3-pyfits

* Wed Apr 25 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.0.7-2
- Unbundle zlib

* Tue Apr 24 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.0.7-1
- New upstream version

* Tue Apr 24 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.0.5-2
- Fixed bz #815376
- Moved python3 requires to package description

* Tue Jan 31 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.0.5-1
- New upstream version, mainly bugfixes

* Fri Jan 20 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 3.0.1-3
- Added compatibility setup.py to avoid using d2to1 package
- Added a dependency on 2to3

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Sep 21 2011 Sergio Pascual <sergiopr@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@lists.fedoraproject.org> - 2.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jan 19 2011 Sergio Pascual <sergiopr@fedoraproject.org> - 2.4.0-1
- New upstream source
- Added filter macro to avoid private-shared-object-provides rpmlint warning

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Wed Jun 23 2010 Sergio Pascual <sergiopr@fedoraproject.org> - 2.3.1-1
- New upstream source, Compressed Image code under BSD license

* Fri May 21 2010 Sergio Pascual <sergiopr@fedoraproject.org> - 2.3-1
- New upstream source

* Wed Jan 20 2010 Sergio Pascual <sergiopr@fedoraproject.org> - 2.2.2-3
- Added missing quotes in CFLAGS

* Wed Jan 20 2010 Sergio Pascual <sergiopr@fedoraproject.org> - 2.2.2-2
- Added CFLAGS to the build line

* Tue Nov 17 2009 Sergio Pascual <sergiopr@fedoraproject.org> - 2.2.2-1
- New upstream source

* Fri Sep 25 2009 Sergio Pascual <sergiopr@fedoraproject.org> - 2.2-1
- New upstream source

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri May 22 2009 Sergio Pascual <sergiopr@fedoraproject.org> - 2.1.1-2
- Fixed strange permision of the .so file

* Tue May 19 2009 Sergio Pascual <sergiopr@fedoraproject.org> - 2.1.1-1
- New upstream source with support for "tile image compression".

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.3-4
- Rebuild for Python 2.6

* Tue Apr 08 2008 Sergio Pascual <sergiopr@fedoraproject.org> - 1.3-3
- Adding dist tag

* Sun Apr 06 2008 Sergio Pascual <sergiopr@fedoraproject.org> - 1.3-2
- Fixing setup not quiet
- Shebang removed from non-script python files

* Wed Mar 26 2008 Sergio Pascual <sergio.pasra@gmail.com> - 1.3-1
- Initial specfile