%global srcname stsci.distutils %global pkgname stsci-distutils # Set to 0 if you want to build without Python 2 %global with_python2 1 Name: python-%{pkgname} Epoch: 1 Version: 0.3.7 Release: 3%{?dist} Summary: Python packaging utilities for STScI's packages License: BSD URL: https://pypi.python.org/pypi/%{srcname} Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch # Python 2 %if 0%{?with_python2} BuildRequires: python2-devel BuildRequires: python2-d2to1 BuildRequires: python2-setuptools %endif # with_python2 # Python 3 BuildRequires: python3-devel BuildRequires: python3-d2to1 BuildRequires: python3-setuptools %description This package contains utilities used to package some of STScI's Python projects; specifically those projects that comprise stsci_python and Astrolib. It currently consists mostly of some setup_hook scripts meant for use with distutils2 and/or d2to1, and a customized easy_install command meant for use with distribute. %if 0%{?with_python2} %package -n python2-%{pkgname} Summary: Python 2 packaging utilities for STScI's packages %{?python_provide:%python_provide python2-%{pkgname}} Requires: python2-d2to1 Requires: python2-setuptools %description -n python2-%{pkgname} This package contains utilities used to package some of STScI's Python projects; specifically those projects that comprise stsci_python and Astrolib. It currently consists mostly of some setup_hook scripts meant for use with distutils2 and/or d2to1, and a customized easy_install command meant for use with distribute. This is the Python 2 version. %endif # with_python2 %package -n python3-%{pkgname} Summary: Python 3 packaging utilities for STScI's packages %{?python_provide:%python_provide python3-%{pkgname}} Requires: python3-d2to1 Requires: python3-setuptools %description -n python3-%{pkgname} This package contains utilities used to package some of STScI's Python projects; specifically those projects that comprise stsci_python and Astrolib. It currently consists mostly of some setup_hook scripts meant for use with distutils2 and/or d2to1, and a customized easy_install command meant for use with distribute. This is the Python 3 version. %prep %setup -qc mv %{srcname}-%{version} python3 cp python3/{LICENSE.txt,CHANGES.txt,README.txt} . %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} %license LICENSE.txt %doc CHANGES.txt README.txt %{python2_sitelib}/* %endif # with_python2 %files -n python3-%{pkgname} %license LICENSE.txt %doc CHANGES.txt README.txt %{python3_sitelib}/* %changelog * Fri May 03 2019 Christian Dersch - 1:0.3.7-3 - rebuilt * Wed Sep 05 2018 Christian Dersch - 0.3.7-2.1 - rebuilt * Wed May 16 2018 Christian Dersch - 0.3.7-1.1 - initial package