Accepting request 477966 from devel:languages:python:singlespec

- update for multipython build

OBS-URL: https://build.opensuse.org/request/show/477966
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=81
This commit is contained in:
Jan Matejek 2017-03-09 14:13:38 +00:00 committed by Git OBS Bridge
parent 40181cd7ca
commit 5ad2b90285
2 changed files with 37 additions and 38 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Dec 19 17:49:22 UTC 2016 - jmatejek@suse.com
- update for multipython build
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 28 12:40:24 UTC 2016 - toddrme2178@gmail.com Fri Oct 28 12:40:24 UTC 2016 - toddrme2178@gmail.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-Cython # spec file for package python-Cython
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,6 +16,8 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name: python-Cython Name: python-Cython
Version: 0.25.1 Version: 0.25.1
Release: 0 Release: 0
@ -26,20 +28,22 @@ Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz
Source1: python-Cython-rpmlintrc Source1: python-Cython-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: %{python_module devel}
BuildRequires: %{python_module xml}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: python-devel BuildRequires: python-rpm-macros
BuildRequires: python-xml
Requires: python-devel Requires: python-devel
Requires: python-xml Requires: python-xml
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
Provides: python-cython = %{version} %ifpython2
Obsoletes: python-cython < %{version} Provides: %{oldpython}-cython = %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110 Obsoletes: %{oldpython}-cython < %{version}
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif %endif
%python_subpackages
%description %description
The Cython language makes writing C extensions for the Python language as 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 easy as Python itself. Cython is a source code translator based on the
@ -63,58 +67,48 @@ sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c
%build %build
CFLAGS="%{optflags}" python setup.py build export CFLAGS="%{optflags}"
%python_build
%install %install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} %{python_expand %$python_install
# Prepare for update-alternatives usage # Prepare for update-alternatives usage
mkdir -p %{buildroot}%{_sysconfdir}/alternatives mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for p in cython cythonize cygdb ; do for p in cython cythonize cygdb ; do
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver} mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{$python_bin_suffix}
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p done
}
for p in cython cythonize cygdb ; do
%prepare_alternative $p
done done
%fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir} %{python_expand %fdupes -s %{buildroot}%{$python_sitearch}}
rm -rf %{buildroot}%{python_sitearch}/__pycache__/ %fdupes %{buildroot}%{_docdir}
%post %post
%_sbindir/update-alternatives \ %{python_install_alternative cython} \
--install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \ --slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{python_bin_suffix} \
--slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \ --slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{python_bin_suffix}
--slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver}
%postun %postun
if [ $1 -eq 0 ] ; then %python_uninstall_alternative cython
%_sbindir/update-alternatives --remove cython %{_bindir}/cython-%{py_ver}
fi
%check %check
%if 0%{?suse_version} && 0%{?suse_version} <= 1140
sed -i.SLES11.SP4.bak -e 's/const char/char/' ./tests/run/cpdef_extern_func.pyx
#mv ./tests/run/cpdef_extern_func.pxd ./tests/run/cpdef_extern_func.pxd.TNT.txt
#mv ./tests/run/cpdef_extern_func.pyx ./tests/run/cpdef_extern_func.pyx.TNT.txt
#sleep 60
%endif
%ifarch x86_64 %ifarch x86_64
python runtests.py -vv export LANG=en_US.UTF-8
%python_exec runtests.py -vv
%endif %endif
%files %files %{python_files}
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos %doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
%{_bindir}/cygdb %python_alternative %{_bindir}/cygdb
%{_bindir}/cython %python_alternative %{_bindir}/cython
%{_bindir}/cythonize %python_alternative %{_bindir}/cythonize
%{_bindir}/cygdb-%{py_ver}
%{_bindir}/cython-%{py_ver}
%{_bindir}/cythonize-%{py_ver}
%ghost %{_sysconfdir}/alternatives/cygdb
%ghost %{_sysconfdir}/alternatives/cython
%ghost %{_sysconfdir}/alternatives/cythonize
%{python_sitearch}/Cython/ %{python_sitearch}/Cython/
%{python_sitearch}/Cython-%{version}-py*.egg-info %{python_sitearch}/Cython-%{version}-py*.egg-info
%{python_sitearch}/cython.py* %{python_sitearch}/cython.py*
%pycache_only %{python_sitearch}/__pycache__
%{python_sitearch}/pyximport/ %{python_sitearch}/pyximport/
%changelog %changelog