Sergio Pascual cdfc2ae
%global with_python3 1
Sergio Pascual cdfc2ae
%global upname astropy
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
Name: python-astropy
Sergio Pascual 2f1a4e3
Version: 0.3.1
Sergio Pascual 48ddb7f
Release: 2%{?dist}
Sergio Pascual cdfc2ae
Summary: A Community Python Library for Astronomy
Sergio Pascual cdfc2ae
License: BSD
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
URL: http://astropy.org
Sergio Pascual cdfc2ae
Source0: http://pypi.python.org/packages/source/a/astropy/astropy-%{version}.tar.gz
Sergio Pascual cdfc2ae
Source1: astropy-README.dist
Sergio Pascual cdfc2ae
Patch0: python-astropy-system-configobj.patch
Sergio Pascual cdfc2ae
Patch1: python-astropy-system-pytest.patch
Sergio Pascual cdfc2ae
Patch2: python-astropy-system-six.patch
Sergio Pascual 2f1a4e3
Patch3: python-astropy-backport-six15.patch
Sergio Pascual 48ddb7f
# https://github.com/astropy/astropy/pull/2223
Sergio Pascual 48ddb7f
Patch4: python-astropy-install.patch
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
BuildRequires: python2-devel python-setuptools numpy
Sergio Pascual cdfc2ae
BuildRequires: scipy h5py
Sergio Pascual cdfc2ae
BuildRequires: git Cython pytest python-six
Sergio Pascual cdfc2ae
BuildRequires: python-sphinx graphviz
Sergio Pascual cdfc2ae
BuildRequires: python-matplotlib
Sergio Pascual cdfc2ae
BuildRequires: python-configobj
Sergio Pascual cdfc2ae
BuildRequires: expat-devel
Sergio Pascual cdfc2ae
BuildRequires: cfitsio-devel
Sergio Pascual cdfc2ae
BuildRequires: wcslib-devel >= 4.20
Sergio Pascual cdfc2ae
BuildRequires: erfa-devel
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
Requires: numpy
Sergio Pascual cdfc2ae
Requires: python-configobj pytest python-six
Sergio Pascual cdfc2ae
# Optionals
Sergio Pascual cdfc2ae
Requires: scipy h5py
Sergio Pascual cdfc2ae
Requires: /usr/bin/xmllint
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
# we don't want to provide private python extension libs
Sergio Pascual cdfc2ae
%global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%description
Sergio Pascual cdfc2ae
The Astropy project is a common effort to develop a single core package 
Sergio Pascual cdfc2ae
for Astronomy.  Major packages such as PyFITS, PyWCS, vo, and asciitable 
Sergio Pascual cdfc2ae
already merged in, and many more components being worked on. In 
Sergio Pascual cdfc2ae
particular, we are developing imaging, photometric, and spectroscopic 
Sergio Pascual cdfc2ae
functionality, as well as frameworks for cosmology, unit handling, and 
Sergio Pascual cdfc2ae
coordinate transformations.
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%package doc
Sergio Pascual cdfc2ae
Summary: Documentation for %{name}, includes full API docs
Sergio Pascual cdfc2ae
# Disabled for the moment to avoid name collision
Sergio Pascual cdfc2ae
# of generated names between arches
Sergio Pascual cdfc2ae
# BuildArch: noarch
Sergio Pascual cdfc2ae
 
Sergio Pascual cdfc2ae
%description doc
Sergio Pascual cdfc2ae
This package contains the full API documentation for %{name}.
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%if 0%{?with_python3}
Sergio Pascual cdfc2ae
%package -n python3-%{upname}
Sergio Pascual cdfc2ae
Summary: A Community Python Library for Astronomy
Sergio Pascual cdfc2ae
BuildRequires: python3-devel python3-setuptools python3-numpy
Sergio Pascual cdfc2ae
BuildRequires: git python3-Cython python3-pytest python3-six
Sergio Pascual cdfc2ae
BuildRequires: python3-scipy python3-h5py
Sergio Pascual cdfc2ae
BuildRequires: python3-sphinx graphviz
Sergio Pascual cdfc2ae
BuildRequires: python3-matplotlib
Sergio Pascual cdfc2ae
BuildRequires: python3-configobj
Sergio Pascual cdfc2ae
#
Sergio Pascual cdfc2ae
BuildRequires: expat-devel
Sergio Pascual cdfc2ae
BuildRequires: wcslib-devel >= 4.20
Sergio Pascual cdfc2ae
BuildRequires: erfa-devel
Sergio Pascual cdfc2ae
BuildRequires: cfitsio-devel
Sergio Pascual cdfc2ae
BuildRequires: python3-devel
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
Requires: python3-numpy
Sergio Pascual cdfc2ae
Requires: python3-configobj
Sergio Pascual cdfc2ae
Requires: python3-pytest
Sergio Pascual 110e18b
Requires: python3-six
Sergio Pascual cdfc2ae
# Optionals
Sergio Pascual cdfc2ae
Requires: python3-scipy python3-h5py
Sergio Pascual cdfc2ae
Requires: /usr/bin/xmllint
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%description -n python3-%{upname}
Sergio Pascual cdfc2ae
The Astropy project is a common effort to develop a single core package 
Sergio Pascual cdfc2ae
for Astronomy.  Major packages such as PyFITS, PyWCS, vo, and asciitable 
Sergio Pascual cdfc2ae
already merged in, and many more components being worked on. In 
Sergio Pascual cdfc2ae
particular, we are developing imaging, photometric, and spectroscopic 
Sergio Pascual cdfc2ae
functionality, as well as frameworks for cosmology, unit handling, and 
Sergio Pascual cdfc2ae
coordinate transformations.
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%package -n python3-%{upname}-doc
Sergio Pascual cdfc2ae
Summary: Documentation for %{name}, includes full API docs
Sergio Pascual cdfc2ae
# Disabled for the moment to avoid name collision
Sergio Pascual cdfc2ae
# of generated names between arches
Sergio Pascual cdfc2ae
# BuildArch: noarch
Sergio Pascual cdfc2ae
 
Sergio Pascual cdfc2ae
%description -n python3-%{upname}-doc
Sergio Pascual cdfc2ae
This package contains the full API documentation for %{name}.
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%endif # with_python3
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%package -n %{upname}-tools
Sergio Pascual cdfc2ae
Summary: Astropy utility tools
Sergio Pascual cdfc2ae
BuildArch: noarch
Sergio Pascual cdfc2ae
Requires: python-%{upname} = %{version}-%{release}
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%description -n %{upname}-tools
Sergio Pascual cdfc2ae
Utilities provided by Astropy: 'volint' for validating a Virtual Observatory 
Sergio Pascual cdfc2ae
files, 'wcslint' for validating the WCS keywords in a FITS file.
Sergio Pascual cdfc2ae
 
Sergio Pascual cdfc2ae
%prep
Sergio Pascual cdfc2ae
%setup -qn %{upname}-%{version}
Sergio Pascual cdfc2ae
cp %{SOURCE1} README.dist
Sergio Pascual cdfc2ae
rm -rf astropy*egg-info
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
# Remove expat, erfa, cfitsio and wcslib
Sergio Pascual cdfc2ae
rm -rf cextern/expat
Sergio Pascual cdfc2ae
rm -rf cextern/erfa
Sergio Pascual cdfc2ae
rm -rf cextern/cfitsio
Sergio Pascual cdfc2ae
rm -rf cextern/wcslib
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
# Unbundle configobj
Sergio Pascual cdfc2ae
rm -rf astropy/extern/configobj*
Sergio Pascual cdfc2ae
%patch0 -p1
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
# Unbundle pytest
Sergio Pascual cdfc2ae
rm -rf astropy/extern/pytest*
Sergio Pascual cdfc2ae
%patch1 -p1
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
# Unbundle six
Sergio Pascual cdfc2ae
rm -rf astropy/extern/six.py*
Sergio Pascual cdfc2ae
%patch2 -p1
Sergio Pascual cdfc2ae
%patch3 -p1
Sergio Pascual cdfc2ae
Sergio Pascual 48ddb7f
%patch4 -p1
Sergio Pascual 48ddb7f
Sergio Pascual cdfc2ae
echo "[build]" >> setup.cfg
Sergio Pascual cdfc2ae
echo "use_system_expat=1" >> setup.cfg
Sergio Pascual cdfc2ae
echo "use_system_cfitsio=1" >> setup.cfg
Sergio Pascual cdfc2ae
echo "use_system_erfa=1" >> setup.cfg
Sergio Pascual cdfc2ae
echo "use_system_wcslib=1" >> setup.cfg
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%if 0%{?with_python3}
Sergio Pascual cdfc2ae
rm -rf %{py3dir}
Sergio Pascual cdfc2ae
cp -a . %{py3dir}
Sergio Pascual cdfc2ae
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
Sergio Pascual cdfc2ae
%endif # with_python3
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%build
Sergio Pascual cdfc2ae
CFLAGS="%{optflags}" %{__python2} setup.py build 
Sergio Pascual cdfc2ae
%{__python2} setup.py build_sphinx
Sergio Pascual cdfc2ae
rm -f docs/_build/html/.buildinfo
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%if 0%{?with_python3}
Sergio Pascual cdfc2ae
pushd %{py3dir}
Sergio Pascual cdfc2ae
CFLAGS="%{optflags}" %{__python3} setup.py build
Sergio Pascual cdfc2ae
# Not working, python3-sphinx bug
Sergio Pascual cdfc2ae
# https://bugzilla.redhat.com/show_bug.cgi?id=1014505
Sergio Pascual cdfc2ae
#%{__python3} setup.py build_sphinx
Sergio Pascual cdfc2ae
popd
Sergio Pascual cdfc2ae
# Copying the python2 docs for the moment
Sergio Pascual cdfc2ae
mkdir -p docs/_build3/
Sergio Pascual cdfc2ae
cp -r docs/_build/html docs/_build3/
Sergio Pascual cdfc2ae
%endif # with_python3
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%install
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%if 0%{?with_python3}
Sergio Pascual cdfc2ae
pushd %{py3dir}
Sergio Pascual cdfc2ae
%{__python3} setup.py install --skip-build --root %{buildroot}
Sergio Pascual cdfc2ae
popd
Sergio Pascual cdfc2ae
%endif # with_python3
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%{__python2} setup.py install --skip-build --root %{buildroot}
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
find %{buildroot} -name "*.so" | xargs chmod 755
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
# install_scripts target seems to overwrite the shebang of the scripts
Sergio Pascual cdfc2ae
# it doesn't matter the the order of the installs
Sergio Pascual cdfc2ae
# fixing it here
Sergio Pascual cdfc2ae
for i in %{buildroot}/usr/bin/*; do 
Sergio Pascual cdfc2ae
 sed -i '1s|^#!%{__python3}|#!%{__python2}|' $i
Sergio Pascual cdfc2ae
done
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%check
Sergio Pascual 48ddb7f
# Disable checks until 
Sergio Pascual 48ddb7f
# https://github.com/astropy/astropy/issues/2171
Sergio Pascual 48ddb7f
# gets fixed
Sergio Pascual 2f1a4e3
pushd %{buildroot}/%{python2_sitearch}
Sergio Pascual 48ddb7f
#py.test-%{python2_version}  astropy
Sergio Pascual 2f1a4e3
popd
Sergio Pascual 2f1a4e3
Sergio Pascual cdfc2ae
%if 0%{?with_python3}
Sergio Pascual 2f1a4e3
pushd %{buildroot}/%{python3_sitearch}
Sergio Pascual 48ddb7f
#py.test-%{python3_version}  astropy
Sergio Pascual cdfc2ae
popd
Sergio Pascual cdfc2ae
%endif # with_python3
Sergio Pascual cdfc2ae
 
Sergio Pascual cdfc2ae
%files
Sergio Pascual cdfc2ae
%doc README.rst README.dist licenses/LICENSE.rst
Sergio Pascual cdfc2ae
%{python2_sitearch}/*
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%files -n %{upname}-tools
Sergio Pascual cdfc2ae
%{_bindir}/*
Sergio Pascual cdfc2ae
# These two are provided by pyfits
Sergio Pascual cdfc2ae
%exclude %{_bindir}/fitsdiff
Sergio Pascual cdfc2ae
%exclude %{_bindir}/fitscheck
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%files doc
Sergio Pascual cdfc2ae
%doc README.rst README.dist licenses/LICENSE.rst docs/_build/html
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%if 0%{?with_python3}
Sergio Pascual cdfc2ae
%files -n python3-%{upname}
Sergio Pascual cdfc2ae
%doc README.rst licenses/LICENSE.rst README.dist
Sergio Pascual cdfc2ae
%{python3_sitearch}/*
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%files -n python3-%{upname}-doc
Sergio Pascual cdfc2ae
%doc README.rst README.dist licenses/LICENSE.rst docs/_build3/html
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%endif # with_python3
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
%changelog
Sergio Pascual 48ddb7f
* Tue Mar 25 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.1-2
Sergio Pascual 48ddb7f
- Disable checks until https://github.com/astropy/astropy/issues/2171 is fixed
Sergio Pascual 48ddb7f
- Patch to fix https://github.com/astropy/astropy/pull/2223
Sergio Pascual 48ddb7f
Sergio Pascual 2f1a4e3
* Wed Mar 05 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.1-1
Sergio Pascual 2f1a4e3
- New upstream version (0.3.1)
Sergio Pascual 2f1a4e3
- Remove require python(3)-matplotlib-qt4 (bug #1030396 fixed)
Sergio Pascual 2f1a4e3
- Run the tests on the installed files
Sergio Pascual 2f1a4e3
- Add patch to run with six 1.5.x
Sergio Pascual 2f1a4e3
Sergio Pascual 110e18b
* Mon Jan 27 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-7
Sergio Pascual 110e18b
- Add missing requires python3-six
Sergio Pascual 110e18b
Sergio Pascual b73fce2
* Sat Jan 18 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-6
Sergio Pascual b73fce2
- Do not exclude hidden file, it breaks tests
Sergio Pascual b73fce2
Sergio Pascual 4139e3a
* Thu Jan 16 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-5
Sergio Pascual 4139e3a
- Remove split -devel subpackage, it does not make much sense
Sergio Pascual 4139e3a
Sergio Pascual cdfc2ae
* Fri Jan 10 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-4
Sergio Pascual cdfc2ae
- Disable noarch for doc subpackages to avoid name colision
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Fri Jan 10 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-3
Sergio Pascual cdfc2ae
- Enable HDF5 version check (fixed in h5py)
Sergio Pascual cdfc2ae
- Patch for failing test with wcslib 4.20
Sergio Pascual cdfc2ae
- Require python(3)-matplotlib-qt4 due to bug #1030396
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Sun Jan 05 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-2
Sergio Pascual cdfc2ae
- Disable HDF5 version check
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Mon Nov 25 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-1
Sergio Pascual cdfc2ae
- New upstream (0.3)
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Tue Nov 19 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-0.3.rc1
Sergio Pascual cdfc2ae
- New upstream, first release candidate Testing 0.3rc1
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Wed Nov 06 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-0.2.b1
Sergio Pascual cdfc2ae
- Split utility scripts in subpackage
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Tue Nov 05 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3-0.1.b1
Sergio Pascual cdfc2ae
- Testing 0.3 (0.3b1)
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Mon Oct 28 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.2.5-1
Sergio Pascual cdfc2ae
- New upstream version (0.2.5)
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Tue Oct 22 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.2.4-4
Sergio Pascual cdfc2ae
- Split header files into devel subpackages
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Mon Oct 21 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.2.4-3
Sergio Pascual cdfc2ae
- Disable tests in Rawhide
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Thu Oct 10 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.2.4-3
Sergio Pascual cdfc2ae
- Add a patch to build with cfitsio 3.35
Sergio Pascual cdfc2ae
Sergio Pascual cdfc2ae
* Wed Oct 02 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 0.2.4-1
Sergio Pascual cdfc2ae
- Initial spec