%global srcname stsci.tools %global pkgname stsci-tools # Set to 0 if you want to build without Python 2 %global with_python2 1 Name: python-%{pkgname} Version: 3.4.13 Release: 1%{?dist} Summary: Collection of STScI utility functions License: BSD URL: https://pypi.python.org/pypi/%{srcname} Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz Patch0: %{name}-Don-t-install-scripts.patch Patch1: %{name}-Fix-path-for-Python-3.patch Patch2: %{name}-Don-t-check-for-login.cl-in-.iraf-for-userIrafHome.patch Patch3: %{name}-fake-relic.patch BuildArch: noarch # Python 2 %if 0%{?with_python2} BuildRequires: python2-astropy BuildRequires: python2-dateutil BuildRequires: python2-devel BuildRequires: python2-d2to1 BuildRequires: python2-pytest BuildRequires: python2-pytest-runner BuildRequires: python2-setuptools %endif # with_python2 # Python3 BuildRequires: python3-astropy BuildRequires: python3-dateutil BuildRequires: python3-devel BuildRequires: python3-d2to1 BuildRequires: python3-pytest BuildRequires: python3-pytest-runner BuildRequires: python3-setuptools %description STScI utility functions. %if 0%{?with_python2} %package -n python2-%{pkgname} Summary: Collection of STScI utility functions %{?python_provide:%python_provide python2-%{pkgname}} Requires: python2-astropy Requires: python2-d2to1 Requires: python2-setuptools %description -n python2-%{pkgname} STScI utility functions. This is the Python 2 version. %endif # with_python2 %package -n python3-%{pkgname} Summary: Collection of STScI utility functions %{?python_provide:%python_provide python3-%{pkgname}} Requires: python3-astropy Requires: python3-d2to1 Requires: python3-setuptools %description -n python3-%{pkgname} STScI utility functions. This is the Python 3 version. %prep %setup -qc pushd %{srcname}-%{version} %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 sed -i "s/__VERSION__/%{version}/g" relic/release.py sed -i "s/__DATE__/$(date --rfc-3339=date)/g" relic/release.py cp README.md .. popd mv %{srcname}-%{version} python3 %if 0%{?with_python2} cp -r python3 python2 %endif # with_python2 %build %if 0%{?with_python2} pushd python2 %py2_build popd %endif # with_python2 pushd python3 %py3_build popd %install %if 0%{?with_python2} pushd python2 %py2_install popd %endif # with_python2 pushd python3 %py3_install popd # Note that there is no %%files section for the unversioned python module if we are building for several python runtimes %if 0%{?with_python2} %files -n python2-%{pkgname} %doc README.md %{python2_sitelib}/* %endif # with_python2 %files -n python3-%{pkgname} %doc README.md %{python3_sitelib}/* %changelog * Mon Sep 03 2018 Christian Dersch - 3.4.13-1 - new version * Wed May 16 2018 Christian Dersch - 3.4.12-1.1 - initial package