File python-Cython.spec of Package python-Cython-rhel

%define realname cython
%define srcext   tar.bz2

%if ! 0%{?py_ver:1}
%define py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
%endif

# Common info
Name:          python-Cython
Version:       0.25.2
Release:       wiz%{?extraver:0.}1%{?dist}
License:       Apache-2.0
Group:         Development/Languages/Python
URL:           http://cython.org/
Summary:       The Cython compiler for writing C extensions for the Python language

# Install-time parameters
Requires:      python%{?suse_version:-base}

# Build-time parameters
BuildRequires: python-devel
BuildRequires: python-setuptools
%if 0%{?suse_version}
BuildRequires: python-xml
%endif
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

%description
The Cython language makes writing C extensions for the Python language as
easy as Python itself.  Cython is a source code translator based on Pyrex_,
but supports more cutting edge functionality and optimizations.

The Cython language is a superset of the Python language (almost all Python
code is also valid Cython code), but Cython additionally supports optional
static typing to natively call C functions, operate with C++ classes and
declare fast C types on variables and class attributes.  This allows the
compiler to generate very efficient C code from Cython code.

This makes Cython the ideal language for writing glue code for external
C/C++ libraries, and for fast C modules that speed up the execution of
Python code.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}

%build
python setup.py build

%install
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
python setup.py install --prefix=%{_prefix} --root=%{buildroot} -O2
[ "%{buildroot}" != "/" ] && find %{buildroot}%{python_sitearch}/ -name "*.pyo" -delete

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc CHANGES.rst COPYING.txt LICENSE.txt README.txt USAGE.txt Doc/*.html
%{_bindir}/cygdb
%{_bindir}/cython
%{_bindir}/cythonize
%{python_sitearch}/Cython/
%{python_sitearch}/Cython-%{version}-py%{py_ver}.egg-info/
%{python_sitearch}/pyximport/
%{python_sitearch}/cython.py*

%changelog
openSUSE Build Service is sponsored by