%{!?_licensedir: %global license %%doc} %if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %global modname re2 Name: python-re2 Version: 0.2.20 Release: 1%{?dist} Summary: Python wrapper for Google's RE2 using Cython Group: Development/Libraries License: BSD URL: http://pypi.python.org/pypi/re2 Source0: https://pypi.python.org/packages/source/r/%{modname}/%{modname}-%{version}.tar.gz BuildRequires: python2-devel BuildRequires: re2-devel Requires: re2 %description python-re2 is a Python extension that wraps Google's RE2 regular expression library. This version of python-re2 is similar to the one you'd find at facebook's github repository except that the stated goal of this version is to be a drop-in replacement for the stdlib re module. %prep %setup -q -n %{modname}-%{version} # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %build CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build %install %{__python2} setup.py install -O1 --skip-build --root=%{buildroot} ## Tests don't run currently #%%check #%%{__python2} setup.py test %files %doc README.rst AUTHORS CHANGELIST %license LICENSE %{python2_sitearch}/%{modname}.so %{python2_sitearch}/%{modname}-%{version}*.egg-info %changelog * Wed Feb 11 2015 Ralph Bean - 0.2.20-1 - initial package for Fedora