From 7df235766ee42dce0c3bcf24dbec5286a58fca88e9198be3557ec14f6d2da826 Mon Sep 17 00:00:00 2001 From: Todd R Date: Mon, 21 May 2012 09:21:58 +0000 Subject: [PATCH] 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 --- Cython-0.15.1.tar.gz | 3 -- python-Cython.changes | 5 +++ python-Cython.spec | 31 ++++++++----- python3-Cython-rpmlintrc | 2 + python3-Cython.changes | 5 +++ python3-Cython.spec | 95 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 127 insertions(+), 14 deletions(-) delete mode 100644 Cython-0.15.1.tar.gz create mode 100644 python3-Cython-rpmlintrc create mode 100644 python3-Cython.changes create mode 100644 python3-Cython.spec diff --git a/Cython-0.15.1.tar.gz b/Cython-0.15.1.tar.gz deleted file mode 100644 index b62fade..0000000 --- a/Cython-0.15.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:248123f2f02f2701a28d9452132ac835533b396a273cda9d361cb65c26067edc -size 1796536 diff --git a/python-Cython.changes b/python-Cython.changes index bd20c7f..b0743c3 100644 --- a/python-Cython.changes +++ b/python-Cython.changes @@ -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 diff --git a/python-Cython.spec b/python-Cython.spec index 89a0878..86da916 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -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 diff --git a/python3-Cython-rpmlintrc b/python3-Cython-rpmlintrc new file mode 100644 index 0000000..40f70c0 --- /dev/null +++ b/python3-Cython-rpmlintrc @@ -0,0 +1,2 @@ +setBadness('devel-file-in-non-devel-package', 0) +addFilter('devel-file-in-non-devel-package .*/Cython/Debugger/Tests/cfuncs.c') diff --git a/python3-Cython.changes b/python3-Cython.changes new file mode 100644 index 0000000..3814312 --- /dev/null +++ b/python3-Cython.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Fri May 18 10:52:46 UTC 2012 - toddrme2178@gmail.com + +- Add python 3 package + diff --git a/python3-Cython.spec b/python3-Cython.spec new file mode 100644 index 0000000..997bdd6 --- /dev/null +++ b/python3-Cython.spec @@ -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