%if 0%{?fedora} %global with_python3 1 %endif %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %global srcname regex Name: python-%{srcname} Version: 2014.10.09 Release: 1%{?dist} Summary: Alternative regular expression module, to replace re License: Python URL: https://pypi.python.org/pypi/%{srcname} Source0: https://pypi.python.org/packages/source/r/%{srcname}/%{srcname}-%{version}.tar.gz BuildRequires: python-devel %if 0%{?with_python3} BuildRequires: python3-devel %endif # with_python3 %description This new regex implementation is intended eventually to replace Python's current re module implementation. For testing and comparison with the current 're' module the new implementation is in the form of a module called 'regex'. %if 0%{?with_python3} %package -n python3-%{srcname} Summary: Alternative regular expression module, to replace re Group: Development/Languages %description -n python3-%{srcname} This new regex implementation is intended eventually to replace Python's current re module implementation. For testing and comparison with the current 're' module the new implementation is in the form of a module called 'regex'. %endif # with_python3 %prep %setup -q -n %{srcname}-%{version} %if 0%{?with_python3} cp -a . %{py3dir} %endif # with_python3 %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build popd %endif # with_python3 %install %{__python} setup.py install -O1 --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif # with_python3 %files %doc README %doc docs/Features.html docs/UnicodeProperties.txt %{python_sitearch}/* %if 0%{?with_python3} %files -n python3-%{srcname} %doc README %doc docs/Features.html docs/UnicodeProperties.txt %{python3_sitearch}/* %endif # with_python3 %changelog * Wed Oct 22 2014 Thomas Moschny - 2014.10.09-1 - Initial version.