Accepting request 280656 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/280656
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Cython?expand=0&rev=25
This commit is contained in:
2015-01-10 22:07:06 +00:00
committed by Git OBS Bridge
parent 7544432467
commit a765de68db
5 changed files with 71 additions and 65 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-Cython
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: python-Cython
Version: 0.21
Version: 0.21.1
Release: 0
Url: http://www.cython.org
Summary: The Cython compiler for writing C extensions for the Python language
@@ -25,10 +25,9 @@ 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: gcc-c++
BuildRequires: python-devel
BuildRequires: python-xml
Provides: python-cython = %{version}
@@ -57,7 +56,6 @@ 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}
@@ -72,17 +70,18 @@ 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}
# Prepare for update-alternatives usage
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/cython %{buildroot}%{_bindir}/cython
ln -s -f %{_sysconfdir}/alternatives/cythonize %{buildroot}%{_bindir}/cythonize
ln -s -f %{_sysconfdir}/alternatives/cygdb %{buildroot}%{_bindir}/cygdb
%pre
# 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:
[ -h %{_bindir}/cygdb ] || rm -f %{_bindir}/cygdb
[ -h %{_bindir}/cythonize ] || rm -f %{_bindir}/cythonize
[ -h %{_bindir}/cython ] || rm -f %{_bindir}/cython
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir}
rm -rf %{buildroot}%{python_sitearch}/__pycache__/
# avoid conflicts with python 2 version
%check
python runtests.py
%post
update-alternatives \
@@ -102,12 +101,15 @@ fi
%files
%defattr(-,root,root,-)
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
%ghost %{_bindir}/cygdb
%{_bindir}/cygdb
%{_bindir}/cython
%{_bindir}/cythonize
%{_bindir}/cygdb-%{py_ver}
%ghost %{_bindir}/cython
%{_bindir}/cython-%{py_ver}
%ghost %{_bindir}/cythonize
%{_bindir}/cythonize-%{py_ver}
%ghost %{_sysconfdir}/alternatives/cygdb
%ghost %{_sysconfdir}/alternatives/cython
%ghost %{_sysconfdir}/alternatives/cythonize
%{python_sitearch}/Cython/
%{python_sitearch}/Cython-%{version}-py%{py_ver}.egg-info
%{python_sitearch}/cython.py*