%if 0%{?fedora} > 12 # Note that upstream does not support Python 3 %global with_python3 0 %else %global with_python3 0 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif Name: python-goto Version: 1.0 Release: 1%{?dist} Group: Development/Libraries Summary: Python implementation of "goto" and "comefrom" statements License: Python URL: http://entrian.com/goto/ Source0: http://entrian.com/goto/goto-1.0.tar.gz BuildArch: noarch BuildRequires: python2-devel python-setuptools %if 0%{?with_python3} BuildRequires: python3-devel python3-setuptools %endif # if with_python3 %description Goto is a Python module to implement the "goto" and "comefrom" statements. %if 0%{?with_python3} %package -n python3-goto Summary: Python implementation of "goto" and "comefrom" statements Group: Development/Libraries %description -n python3-goto Goto is a Python module to implement the "goto" and "comefrom" statements. %endif # if with_python3 %prep %setup -q -n goto-%{version} chmod a-x PKG-INFO dos2unix -k PKG-INFO %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' %endif # with_python3 %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install %{__python} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --prefix=%{_prefix} --root %{buildroot} popd %endif # with_python3 %files %doc PKG-INFO %{python_sitelib}/* %if 0%{?with_python3} %files -n python3-goto %doc PKG-INFO %{python3_sitelib}/* %endif # with_python3 %changelog * Mon Sep 29 2014 Eric Smith 1.0-1 - initial version