Blob Blame History Raw
%global with_python3 1

Name: ATpy
Version: 0.9.7
Release: 17%{?dist}
Summary: Astronomical Tables in Python
License: MIT

Group: Development/Libraries
URL: http://atpy.readthedocs.org
Source0: https://pypi.python.org/packages/source/A/ATpy/%{name}-%{version}.tar.gz

BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-setuptools

%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif # with_python3

%global _description\
ATpy is a high-level Python package providing a way to manipulate tables of\
astronomical data in a uniform way. It provides built-in support for NumPy\
recarrays and common astronomical file/database formats (FITS, VO, HDF5,\
and ASCII tables) with a very simple API.

%description %_description

%package -n python2-atpy
Summary: %summary
Requires: python2-numpy python2-astropy
%{?python_provide:%python_provide python2-atpy}
# Remove before F30
Provides: ATpy%{?_isa} = %{version}-%{release}
Obsoletes: ATpy < %{version}-%{release}

%description -n python2-atpy %_description

%if 0%{?with_python3}
%package -n python3-ATpy
Summary: Astronomical Tables in Python
Requires: python3-numpy python3-astropy

%description -n python3-ATpy
ATpy is a high-level Python package providing a way to manipulate tables of 
astronomical data in a uniform way. It provides built-in support for NumPy
recarrays and common astronomical file/database formats (FITS, VO, HDF5, 
and ASCII tables) with a very simple API.

%endif # with_python3

%prep
%setup -q

%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|#!%{__python2}|'

%build
%{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3

%install

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root  %{buildroot}
popd
%endif # with_python3

%{__python2} setup.py install --skip-build --root  %{buildroot}

%files -n python2-atpy
%doc CHANGES LICENSE README.md
%{python2_sitelib}/ATpy-*.egg-info
%{python2_sitelib}/atpy

%if 0%{?with_python3}
%files -n python3-ATpy
%doc CHANGES LICENSE README.md
%{python3_sitelib}/ATpy-*.egg-info
%{python3_sitelib}/atpy
%endif # with_python3

%changelog
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.9.7-16
- Rebuilt for Python 3.7

* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.9.7-15
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.9.7-13
- Python 2 binary package renamed to python2-atpy
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.9.7-10
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-7
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

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

* Mon Jan 27 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.9.7-3
- Activate python3 build

* Thu Jan 16 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.9.7-2
- Add a requirement on python-astropy
- Macro fixes

* Tue Jul 30 2013 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.7-1
- New upstream release 0.9.7
- Minor cleanups in the spec

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 0.9.6-4
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 0.9.6-3
- remove rhel logic from with_python3 conditional

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

* Mon May 21 2012 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.6-1
- New upstream release.

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

* Thu Jul 14 2011 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.5.3-1
- New upstream release.

* Wed May 11 2011 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.5-2
- Moving Requires for python3 to its proper place in package macro

* Mon May 02 2011 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.5-1
- New upstream release

* Tue Apr 26 2011 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.4-3
- Added support for python3

* Tue Apr 26 2011 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.4-2
- Updated upstream web site
- More details in files section

* Tue Nov 30 2010 Sergio Pascual <sergiopr at fedoraproject.org> - 0.9.4-1
- Initial spec file