From 0615aeb655f9e5fc5fd64657391f25af6e676522 Mon Sep 17 00:00:00 2001 From: Christian Dersch Date: Feb 24 2015 23:02:51 +0000 Subject: rebuilt for astroML 0.3, enabled Python 3 support --- diff --git a/python-astroML-addons.spec b/python-astroML-addons.spec index 118512e..2133684 100644 --- a/python-astroML-addons.spec +++ b/python-astroML-addons.spec @@ -1,8 +1,10 @@ %global pypi_name astroML_addons +%global upname astroML-addons +%global with_python3 1 Name: python-astroML-addons Version: 0.2.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Performance add-ons for the astroML package License: BSD @@ -13,6 +15,12 @@ Requires: python-astroML BuildRequires: python-setuptools BuildRequires: python2-devel BuildRequires: python-astroML +%if 0%{?with_python3} +Requires: python3-astroML +BuildRequires: python3-setuptools +BuildRequires: python3-devel +BuildRequires: python3-astroML +%endif %description astroML is split into two components. The core astroML library is written @@ -25,16 +33,52 @@ 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 + +%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}/* @@ -43,7 +87,15 @@ find %{buildroot} -name 'setup.py*' -print0 | xargs -0 rm -rf %{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 +* Tue Feb 24 2015 Christian Dersch - 0.2.1-6 +- rebuilt for astroML 0.3, enabled Python 3 support + * Sun Aug 17 2014 Fedora Release Engineering - 0.2.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild