2011-09-02 09:55:13 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-Cython
|
|
|
|
#
|
2015-04-22 13:54:51 +00:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-09-02 09:55:13 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2011-09-05 14:38:13 +00:00
|
|
|
|
2011-09-02 09:55:13 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-11-22 15:35:09 +00:00
|
|
|
|
|
|
|
Name: python-Cython
|
2015-07-13 11:00:08 +00:00
|
|
|
Version: 0.22.1
|
2011-09-21 12:36:31 +00:00
|
|
|
Release: 0
|
2011-09-02 09:55:13 +00:00
|
|
|
Url: http://www.cython.org
|
|
|
|
Summary: The Cython compiler for writing C extensions for the Python language
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: Development/Languages/Python
|
2015-04-22 14:05:54 +00:00
|
|
|
Source: http://cython.org/release/Cython-%{version}.tar.gz
|
2014-08-02 11:02:28 +00:00
|
|
|
Source1: python-Cython-rpmlintrc
|
2011-09-02 09:55:13 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-05-21 09:21:58 +00:00
|
|
|
BuildRequires: fdupes
|
2015-01-09 23:05:34 +00:00
|
|
|
BuildRequires: gcc-c++
|
2011-09-02 09:55:13 +00:00
|
|
|
BuildRequires: python-devel
|
2015-04-22 13:54:51 +00:00
|
|
|
BuildRequires: python-numpy
|
|
|
|
BuildRequires: python-numpy-devel
|
2014-07-24 07:53:15 +00:00
|
|
|
BuildRequires: python-xml
|
2011-09-06 13:29:33 +00:00
|
|
|
Provides: python-cython = %{version}
|
|
|
|
Obsoletes: python-cython < %{version}
|
2014-02-03 19:48:55 +00:00
|
|
|
Requires: python-xml
|
2013-10-11 17:08:38 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2012-11-22 15:35:09 +00:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
|
|
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
|
|
|
%endif
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
%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 the
|
2011-09-02 11:06:10 +00:00
|
|
|
well-known Pyrex, but supports more cutting edge functionality and
|
2011-09-02 09:55:13 +00:00
|
|
|
optimizations.
|
|
|
|
|
|
|
|
The Cython language is very close to the Python language (and most Python
|
|
|
|
code is also valid Cython code), but Cython additionally supports calling C
|
|
|
|
functions and declaring 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
|
|
|
|
libraries, and for fast C modules that speed up the execution of Python
|
|
|
|
code.
|
|
|
|
|
|
|
|
%prep
|
2012-11-22 15:35:09 +00:00
|
|
|
%setup -q -n Cython-%{version}
|
2015-02-09 16:07:30 +00:00
|
|
|
# Fix non-executable scripts
|
|
|
|
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py
|
|
|
|
# Fix EOL encoding
|
|
|
|
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
%build
|
2012-11-22 15:35:09 +00:00
|
|
|
CFLAGS="%{optflags}" python setup.py build
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
2015-01-08 13:41:57 +00:00
|
|
|
# Prepare for update-alternatives usage
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
2015-02-09 16:07:30 +00:00
|
|
|
for p in cython cythonize cygdb ; do
|
|
|
|
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
|
|
|
|
ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_bindir}/$p
|
|
|
|
ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_sysconfdir}/alternatives/$p
|
|
|
|
done
|
2015-01-08 13:41:57 +00:00
|
|
|
|
2012-11-22 15:35:09 +00:00
|
|
|
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
|
2014-12-18 11:10:45 +00:00
|
|
|
rm -rf %{buildroot}%{python_sitearch}/__pycache__/
|
|
|
|
# avoid conflicts with python 2 version
|
2012-02-29 19:08:32 +00:00
|
|
|
|
2015-01-09 23:05:34 +00:00
|
|
|
%check
|
2015-04-22 13:54:51 +00:00
|
|
|
python runtests.py -vv
|
2013-10-11 17:08:38 +00:00
|
|
|
|
|
|
|
%post
|
2015-02-09 16:07:30 +00:00
|
|
|
%_sbindir/update-alternatives \
|
2013-10-11 17:08:38 +00:00
|
|
|
--install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \
|
2014-09-11 11:37:14 +00:00
|
|
|
--slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \
|
2013-10-11 17:08:38 +00:00
|
|
|
--slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver}
|
|
|
|
|
|
|
|
%preun
|
|
|
|
if [ $1 -eq 0 ] ; then
|
2015-02-09 16:07:30 +00:00
|
|
|
%_sbindir/update-alternatives --remove cython %{_bindir}/cython-%{py_ver}
|
2013-10-11 17:08:38 +00:00
|
|
|
fi
|
|
|
|
|
2011-09-02 09:55:13 +00:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
|
2015-02-09 16:07:30 +00:00
|
|
|
%ghost %{_bindir}/cygdb
|
|
|
|
%ghost %{_bindir}/cython
|
|
|
|
%ghost %{_bindir}/cythonize
|
2013-10-11 17:08:38 +00:00
|
|
|
%{_bindir}/cygdb-%{py_ver}
|
|
|
|
%{_bindir}/cython-%{py_ver}
|
2014-09-11 11:37:14 +00:00
|
|
|
%{_bindir}/cythonize-%{py_ver}
|
2014-12-18 11:10:45 +00:00
|
|
|
%ghost %{_sysconfdir}/alternatives/cygdb
|
|
|
|
%ghost %{_sysconfdir}/alternatives/cython
|
|
|
|
%ghost %{_sysconfdir}/alternatives/cythonize
|
2012-11-22 15:35:09 +00:00
|
|
|
%{python_sitearch}/Cython/
|
|
|
|
%{python_sitearch}/Cython-%{version}-py%{py_ver}.egg-info
|
|
|
|
%{python_sitearch}/cython.py*
|
2012-05-21 09:21:58 +00:00
|
|
|
%{python_sitearch}/pyximport/
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
%changelog
|