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

Name:           python-astroML-addons
Version:        0.2.1
Release:        8%{?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

Requires:       python-astroML

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

%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.

%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
%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
* 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