Accepting request 248950 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/248950
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Cython?expand=0&rev=23
This commit is contained in:
Stephan Kulow
2014-09-18 05:12:19 +00:00
committed by Git OBS Bridge
parent e169cd455e
commit 626bc72d3a
5 changed files with 172 additions and 4 deletions

View File

@@ -17,7 +17,7 @@
Name: python-Cython
Version: 0.20.2
Version: 0.21
Release: 0
Url: http://www.cython.org
Summary: The Cython compiler for writing C extensions for the Python language
@@ -25,6 +25,8 @@ License: Apache-2.0
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/C/Cython/Cython-%{version}.tar.gz
Source1: python-Cython-rpmlintrc
#PATCH-FIX-UPSTREAM Cython-fix-version-detection.patch https://github.com/cython/cython/commit/43342ab90704f5f850733544288485048160003d
Patch0: Cython-fix-version-detection.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-devel
@@ -55,11 +57,14 @@ code.
%prep
%setup -q -n Cython-%{version}
%patch0 -p1
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py # Fix non-executable scripts
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c # Fix EOL encoding
mv bin/cython bin/cython-%{py_ver}
mv bin/cythonize bin/cythonize-%{py_ver}
mv bin/cygdb bin/cygdb-%{py_ver}
sed -i "s|bin/cython|bin/cython-%{py_ver}|" setup.py
sed -i "s|bin/cythonize|bin/cythonize-%{py_ver}|" setup.py
sed -i "s|bin/cygdb|bin/cygdb-%{py_ver}|" setup.py
%build
@@ -68,6 +73,7 @@ CFLAGS="%{optflags}" python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
ln -s %{_bindir}/cython-%{py_ver} %{buildroot}%{_bindir}/cython
ln -s %{_bindir}/cythonize-%{py_ver} %{buildroot}%{_bindir}/cythonize
ln -s %{_bindir}/cygdb-%{py_ver} %{buildroot}%{_bindir}/cygdb
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
@@ -75,12 +81,14 @@ ln -s %{_bindir}/cygdb-%{py_ver} %{buildroot}%{_bindir}/cygdb
# Since /usr/bin/cython and /usr/bin/cygdb became ghosted to be used with update-alternatives, we have to get rid
# of the old binary resulting from the non-update-alternativies-ified package:
[[ ! -L %{_bindir}/cygdb ]] && rm -f %{_bindir}/cygdb
[[ ! -L %{_bindir}/cythonize ]] && rm -f %{_bindir}/cythonize
[[ ! -L %{_bindir}/cython ]] && rm -f %{_bindir}/cython
exit 0
%post
update-alternatives \
--install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \
--slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \
--slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver}
%preun
@@ -99,6 +107,8 @@ fi
%{_bindir}/cygdb-%{py_ver}
%ghost %{_bindir}/cython
%{_bindir}/cython-%{py_ver}
%ghost %{_bindir}/cythonize
%{_bindir}/cythonize-%{py_ver}
%{python_sitearch}/Cython/
%{python_sitearch}/Cython-%{version}-py%{py_ver}.egg-info
%{python_sitearch}/cython.py*