Blob Blame History Raw
%global pypi_name astroML_addons
%global upname astroML-addons
%global with_python3 1

Name:           python-astroML-addons
Version:        0.2.2
Release:        17%{?dist}
Summary:        Performance add-ons for the astroML package

License:        BSD
URL:            http://www.astroml.org/
Source0:        https://pypi.python.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz

BuildRequires:  gcc

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

%global _description\
astroML is split into two components. The core astroML library is written\
in python only, and is designed to be very easy to install for any users,\
even those who don't have a working C or fortran compiler. A companion library,\
astroML_addons, can be optionally installed for increased performance on\
certain algorithms. Every algorithm in astroML_addons has a pure python\
counterpart in the core astroML implementation, but the astroML_addons library\
contains faster and more efficient implementations in compiled code.\
Furthermore, if astroML_addons is installed on your system, the core astroML\
library will import and use the faster routines by default.

%description %_description

%package -n python2-astroml-addons
Summary: %summary
Requires:       python2-astroML
%{?python_provide:%python_provide python2-astroml-addons}

%description -n python2-astroml-addons %_description

%if 0%{?with_python3}
%package -n python3-%{upname}
Summary:        Performance add-ons for the astroML package
Requires:       python3-astroML

%description -n python3-%{upname}
astroML is split into two components. The core astroML library is written
in python only, and is designed to be very easy to install for any users,
even those who don't have a working C or fortran compiler. A companion library,
astroML_addons, can be optionally installed for increased performance on
certain algorithms. Every algorithm in astroML_addons has a pure python
counterpart in the core astroML implementation, but the astroML_addons library
contains faster and more efficient implementations in compiled code.
Furthermore, if astroML_addons is installed on your system, the core astroML
library will import and use the faster routines by default.
%endif # with_python3


%prep
%setup -qn %{pypi_name}-%{version}
%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
%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
popd
%endif # with_python3
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build


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

find %{buildroot} -name 'setup.py*' -print0 | xargs -0 rm -rf
%{_fixperms} %{buildroot}/*

%files -n python2-astroml-addons
%doc README.rst
%{python2_sitearch}/astroML_addons
%{python2_sitearch}/astroML_addons-%{version}-py%{python2_version}.egg-info

%files -n python3-%{upname}
%doc README.rst
%{python3_sitearch}/astroML_addons
%{python3_sitearch}/astroML_addons-%{version}-py%{python3_version}.egg-info

%changelog
* Sun Jul 15 2018 Christian Dersch <lupinix@fedoraproject.org> - 0.2.2-17
- BuildRequires: gcc

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

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

* Wed Feb 14 2018 Christian Dersch <lupinix@mailbox.org> - 0.2.2-14
- rebuilt

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

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

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

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

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

* Sat Oct 15 2016 Peter Robinson <pbrobinson@fedoraproject.org> - 0.2.2-6
- rebuilt for matplotlib-2.0.0

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

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Nov 25 2015 Christian Dersch <lupinix@mailbox.org> - 0.2.2-3
- Rebuilt for updates in Python 3.5

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

* Wed Sep 23 2015 Christian Dersch <lupinix@fedoraproject.org> - 0.2.2-1
- new version

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

* Fri Mar 06 2015 Christian Dersch <chrisdersch@gmail.com> - 0.2.1-7
- fixed wrong dependency in python 2 package (BZ #1199429)

* Tue Feb 24 2015 Christian Dersch <chrisdersch@gmail.com> - 0.2.1-6 
- rebuilt for astroML 0.3, enabled Python 3 support

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

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

* Mon Mar 17 2014 Christian Dersch <chrisdersch@gmail.com> - 0.2.1-3
- fixed spec to match packaging guidelines

* Mon Mar 17 2014 Christian Dersch <chrisdersch@gmail.com> - 0.2.1-2
- fixed spec to match packaging guidelines

* Mon Feb 24 2014 Christian Dersch <chrisdersch@gmail.com> 0.2.1-1
- initial build