Blob Blame History Raw
%global srcname healpy
%global sum Python healpix maps tools

%if 0%{?fedora}
%bcond_without python3
%else
%bcond_with python3
%endif

Name:           python-%{srcname}
Version:        1.12.0
Release:        1%{?dist}
Summary:        %{sum}

License:        GPLv2+ 
URL:            https://pypi.python.org/pypi/%{srcname}
Source0:        https://files.pythonhosted.org/packages/source/h/%{srcname}/%{srcname}-%{version}.tar.gz
Patch0:         %{srcname}-1.10.3-unbundling.patch

# Upstream only supports 64 bit architectures, 32 Bit builds, but tests fail
# and we don't want to provide a non reliable software.
# Check https://github.com/healpy/healpy/issues/194
ExclusiveArch:  aarch64 ppc64 ppc64le x86_64 s390x
# Also explicitly exclude known unsupported architectures
ExcludeArch:    %{ix86} %{arm}

# Common build requirements
BuildRequires:  cfitsio-devel
BuildRequires:  gcc-c++
BuildRequires:  healpix-c++-devel

# Python 2 build requirements
BuildRequires:  python2-astropy
BuildRequires:  python2-Cython
BuildRequires:  python2-devel
BuildRequires:  python2-matplotlib
BuildRequires:  python2-pytest
BuildRequires:  python2-pytest-runner
BuildRequires:  python2-setuptools
BuildRequires:  python2-six

%if %{with python3}
# Python 3 build requirements
BuildRequires:  python3-astropy
BuildRequires:  python3-Cython
BuildRequires:  python3-devel
BuildRequires:  python3-matplotlib
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-runner
BuildRequires:  python3-setuptools
BuildRequires:  python3-six
%endif # with python3

%description
Healpy provides a python package to manipulate healpix maps. It is based on the
standard numeric and visualisation tools for Python, Numpy and matplotlib.

%package -n python2-%{srcname}
Summary:        %{sum}
Requires:       python2-astropy
Requires:       python2-matplotlib
Requires:       python2-six
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
Healpy provides a python package to manipulate healpix maps. It is based on the 
standard numeric and visualisation tools for Python, Numpy and matplotlib.

This package contains the Python 2 modules.

%if %{with python3}
%package -n python3-%{srcname}
Summary:        %{sum}
Requires:       python3-astropy
Requires:       python3-matplotlib
Requires:       python3-six
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
Healpy provides a python package to manipulate healpix maps. It is based on the
standard numeric and visualisation tools for Python, Numpy and matplotlib.

This package contains the Python 3 modules.
%endif # with python3

%prep
%autosetup -p1 -n %{srcname}-%{version}
# We use system libs for cfitsio and healpix-c++
rm -rf cfitsio healpixsubmodule

%build
%py2_build

%if %{with python3}
%py3_build
%endif # with python3

%install
%py2_install

%if %{with python3}
%py3_install
%endif # with python3

%check
pushd %{buildroot}/%{python2_sitearch}
py.test-%{python2_version} healpy
# Remove relict from tests
rm -rf .pytest_cache
popd

%if %{with python3}
pushd %{buildroot}/%{python3_sitearch}
py.test-%{python3_version} healpy
# Remove relict from tests
rm -rf .pytest_cache
popd
%endif # with python3

# Note that there is no %%files section for the unversioned python module if we are building for several python runtimes
%files -n python2-%{srcname}
%license COPYING
%doc CHANGELOG.rst CITATION README.rst
%{python2_sitearch}/*

%if %{with python3}
%files -n python3-%{srcname}
%license COPYING
%doc CHANGELOG.rst CITATION README.rst
%{python3_sitearch}/*
%endif # with python3

%changelog
* Tue Jun 19 2018 Christian Dersch <lupinix@fedoraproject.org> - 1.12.0-1
- new version

* Sat May 26 2018 Christian Dersch <lupinix@mailbox.org> - 1.11.0-5
- rebuilt for cfitsio 3.450

* Sat Feb 24 2018 Christian Dersch <lupinix@mailbox.org> - 1.11.0-4
- rebuilt for cfitsio 3.420 (so version bump)

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

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

* Sun Oct 08 2017 Christian Dersch <lupinix@mailbox.org> - 1.11.0-1
- new version

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

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

* Thu Jun 01 2017 Christian Dersch <lupinix@mailbox.org> - 1.10.3-2
- enable s390x architecture

* Fri Apr 07 2017 Christian Dersch <lupinix@mailbox.org> - 1.10.3-1
- initial package (review: rhbz #1440216)