Accepting request 121584 from home:TheBlackCat:branches:devel:languages:python

Add python 3 package

OBS-URL: https://build.opensuse.org/request/show/121584
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=11
This commit is contained in:
Todd R 2012-05-21 09:21:58 +00:00 committed by Git OBS Bridge
parent 7bbff47556
commit 7df235766e
6 changed files with 127 additions and 14 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:248123f2f02f2701a28d9452132ac835533b396a273cda9d361cb65c26067edc
size 1796536

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri May 18 10:52:46 UTC 2012 - toddrme2178@gmail.com
- Add python 3 package
-------------------------------------------------------------------
Mon Apr 23 11:09:29 UTC 2012 - vdziewiecki@suse.com

View File

@ -15,24 +15,28 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-Cython
%define modname Cython
%define binname cython
Name: python-%{modname}
Version: 0.16
Release: 0
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
Source: http://pypi.python.org/packages/source/C/Cython/Cython-%{version}.tar.gz
Source: http://pypi.python.org/packages/source/C/%{modname}/%{modname}-%{version}.tar.gz
Source99: python-Cython-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-devel
%if 0%{?suse_version}
%py_requires
%endif
%if 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
Provides: python-cython = %{version}
Obsoletes: python-cython < %{version}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%description
The Cython language makes writing C extensions for the Python language as
@ -50,7 +54,7 @@ libraries, and for fast C modules that speed up the execution of Python
code.
%prep
%setup -q -n Cython-%{version}
%setup -q -n %{modname}-%{version}
sed -i "1d" {Cython/Debugger/libpython,Cython/Debugger/Cygdb,cython}.py # Fix non-executable scripts
%build
@ -58,11 +62,11 @@ CFLAGS="%{optflags} -fno-strict-aliasing" python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%fdupes -s %{buildroot}
# fix EOL encoding
%__sed -i 's/\r$//' \
Demos/{callback/README.txt,callback/cheesefinder.h,embed/Makefile.unix,embed/Makefile.msc.static} \
Doc/primes.c
sed -i 's/\r$//' Demos/callback/{README.txt,cheesefinder.h}
sed -i 's/\r$//' Demos/embed/{Makefile.unix,Makefile.msc.static}
sed -i 's/\r$//' Doc/primes.c
# Disabled testsuite as it takes a long time:
#%%check
@ -71,7 +75,12 @@ Doc/primes.c
%files
%defattr(-,root,root,-)
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
%{_bindir}/cy*
%{python_sitearch}/*
%{_bindir}/cygdb
%{_bindir}/%{binname}
%{python_sitearch}/%{modname}/
%{python_sitearch}/%{modname}-%{version}-py%{py_ver}.egg-info
%{python_sitearch}/%{binname}.py
%{python_sitearch}/%{binname}.pyc
%{python_sitearch}/pyximport/
%changelog

2
python3-Cython-rpmlintrc Normal file
View File

@ -0,0 +1,2 @@
setBadness('devel-file-in-non-devel-package', 0)
addFilter('devel-file-in-non-devel-package .*/Cython/Debugger/Tests/cfuncs.c')

5
python3-Cython.changes Normal file
View File

@ -0,0 +1,5 @@
-------------------------------------------------------------------
Fri May 18 10:52:46 UTC 2012 - toddrme2178@gmail.com
- Add python 3 package

95
python3-Cython.spec Normal file
View File

@ -0,0 +1,95 @@
#
# spec file for package python3-Cython
#
# Copyright (c) 2012 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
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define modname Cython
%define binname cython
Name: python3-%{modname}
Version: 0.16
Release: 0
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
Source: http://pypi.python.org/packages/source/C/%{modname}/%{modname}-%{version}.tar.gz
Source99: python-Cython-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python3
BuildRequires: python3-2to3
BuildRequires: python3-devel
Requires: python3 >= %{py3_ver}
%if 0%{?suse_version} <= 1140
%{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py3_ver: %global py3_ver %(python3 -c "import sys; version=str(sys.version_info[0]) + '.' + str(sys.version_info[1]); print(version)" 2>/dev/null || echo PYTHON-NOT-FOUND)}
%endif
Provides: python3-cython = %{version}
Obsoletes: python3-cython < %{version}
%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
well-known Pyrex, but supports more cutting edge functionality and
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
%setup -q -n %{modname}-%{version}
sed -i "1d" {Cython/Debugger/libpython,Cython/Debugger/Cygdb,cython}.py # Fix non-executable scripts
%build
CFLAGS="%{optflags} -fno-strict-aliasing" python3 setup.py build
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%if 0%{?suse_version} >= 1210
rm -r %{buildroot}%{python3_sitearch}/__pycache__/
%endif
%fdupes -s %{buildroot}
# avoid conflicts with python 2 version
mv %{buildroot}%{_bindir}/cygdb %{buildroot}%{_bindir}/cygdb-python3
mv %{buildroot}%{_bindir}/%{binname} %{buildroot}%{_bindir}/%{binname}-python3
# fix EOL encoding
sed -i 's/\r$//' Demos/callback/{README.txt,cheesefinder.h}
sed -i 's/\r$//' Demos/embed/{Makefile.unix,Makefile.msc.static}
sed -i 's/\r$//' Doc/primes.c
# Disabled testsuite as it takes a long time:
#%%check
#python runtests.py
%files
%defattr(-,root,root,-)
%doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos
%{_bindir}/cygdb-python3
%{_bindir}/%{binname}-python3
%{python3_sitearch}/%{modname}/
%{python3_sitearch}/%{modname}-%{version}-py%{py3_ver}.egg-info
%{python3_sitearch}/pyximport/
%{python3_sitearch}/%{binname}.py
%if 0%{?suse_version} <= 1210
%{python3_sitearch}/%{binname}.pyc
%endif
%changelog