X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=python-Cython.spec;h=1b09c2c9364080fb37874b70edf1aaf095734225;hb=e8ab6935e9ae48ac9a6217e7a1464ee168d66306;hp=4161fe6edb55d78b5f4f172d1650a8cd3b46fdac;hpb=325d54a529c4bef05af0622d784f03ebee1c2f6f;p=packages%2Fpython-Cython.git diff --git a/python-Cython.spec b/python-Cython.spec index 4161fe6..1b09c2c 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -2,32 +2,36 @@ # Conditional build: %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module +%bcond_without apidocs # Sphinx documentation +%bcond_with tests # test suite (SLOOOOW) %define module Cython Summary: Language for writing Python Extension Modules (Python 2.x version) Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 2.x) Name: python-%{module} -Version: 0.23.1 +Version: 0.29.21 Release: 2 License: Apache v2.0 Group: Libraries/Python -Source0: http://cython.org/release/%{module}-%{version}.tar.gz -# Source0-md5: db3c5b365e1c3f71c7cd90e96473a3ab +#Source0Download: https://pypi.org/simple/cython/ +Source0: https://files.pythonhosted.org/packages/source/c/cython/%{module}-%{version}.tar.gz +# Source0-md5: 12c5e45af71dcc6dff28cdcbcbef6f39 +Patch0: %{name}-sphinx.patch URL: http://cython.org/ +BuildRequires: rpmbuild(macros) >= 1.714 %if %{with python2} BuildRequires: python >= 1:2.6 BuildRequires: python-devel >= 1:2.6 BuildRequires: python-setuptools %endif %if %{with python3} -BuildRequires: python3 >= 1:3.2 -BuildRequires: python3-2to3 >= 1:3.2 -BuildRequires: python3-devel >= 1:3.2 -BuildRequires: python3-modules >= 1:3.2 +BuildRequires: python3 >= 1:3.3 +BuildRequires: python3-devel >= 1:3.3 BuildRequires: python3-setuptools %endif BuildRequires: rpm-pythonprov +%{?with_apidocs:BuildRequires: sphinx-pdg-3 >= 1.8} Requires: python-devel >= 1:2.6 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -51,7 +55,7 @@ Ten pakiet zawiera moduł Cython dla Pythona 2.x. Summary: Language for writing Python Extension Modules (Python 3.x version) Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 3.x) Group: Libraries/Python -Requires: python3-devel >= 1:3.2 +Requires: python3-devel >= 1:3.3 %description -n python3-Cython Cython lets you write code that mixes Python and C data types any way @@ -67,6 +71,17 @@ Cython jest oparty na Pyreksie. Ten pakiet zawiera moduł Cython dla Pythona 3.x. +%package apidocs +Summary: API documentation for Cython module +Summary(pl.UTF-8): Dokumentacja API modułu Cython +Group: Documentation + +%description apidocs +API documentation for Cython module. + +%description apidocs -l pl.UTF-8 +Dokumentacja API modułu Cython. + %package examples Summary: Examples for Cython language Summary(pl.UTF-8): Przykłady programów w języku Cython @@ -81,20 +96,28 @@ Pakiet zawierający przykładowe programy napisane w języku Cython. %prep %setup -q -n %{module}-%{version} +%patch0 -p1 %build %if %{with python2} -CC="%{__cc}" \ -CFLAGS="%{rpmcflags}" \ -%{__python} setup.py build \ - --build-base build-2 +%py_build + +%if %{with tests} +%{__python} runtests.py +%endif %endif %if %{with python3} -CC="%{__cc}" \ -CFLAGS="%{rpmcflags}" \ -%{__python3} setup.py build \ - --build-base build-3 +%py3_build + +%if %{with tests} +%{__python3} runtests.py \ + SPHINXBUILD=sphinx-build-3 +%endif +%endif + +%if %{with apidocs} +%{__make} -C docs html %endif %install @@ -102,13 +125,7 @@ rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} %if %{with python3} -%{__python3} setup.py \ - build \ - --build-base build-3 \ - install \ - --optimize=2 \ - --skip-build \ - --root=$RPM_BUILD_ROOT +%py3_install %{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3} %{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3} @@ -116,13 +133,7 @@ install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} %endif %if %{with python2} -%{__python} setup.py \ - build \ - --build-base build-2 \ - install \ - --optimize=2 \ - --skip-build \ - --root=$RPM_BUILD_ROOT +%py_install find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \; %endif @@ -135,7 +146,7 @@ rm -rf $RPM_BUILD_ROOT %if %{with python2} %files %defattr(644,root,root,755) -%doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c +%doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt %attr(755,root,root) %{_bindir}/cython %attr(755,root,root) %{_bindir}/cythonize %attr(755,root,root) %{_bindir}/cygdb @@ -148,7 +159,7 @@ rm -rf $RPM_BUILD_ROOT %if %{with python3} %files -n python3-Cython %defattr(644,root,root,755) -%doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c +%doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt %attr(755,root,root) %{_bindir}/cython3 %attr(755,root,root) %{_bindir}/cythonize3 %attr(755,root,root) %{_bindir}/cygdb3 @@ -159,6 +170,12 @@ rm -rf $RPM_BUILD_ROOT %{py3_sitedir}/Cython-%{version}-py*.egg-info %endif +%if %{with apidocs} +%files apidocs +%defattr(644,root,root,755) +%doc docs/build/html/{_images,_static,src,*.html,*.js} +%endif + %files examples %defattr(644,root,root,755) %{_examplesdir}/%{name}-%{version}