]> git.pld-linux.org Git - packages/python-cffi.git/blobdiff - python-cffi.spec
go back to last python2 version (1.15.1) and disable python3 here
[packages/python-cffi.git] / python-cffi.spec
index 94acc9742c874d7a930c0e2f80084910fe23ddea..9bea5864a3b34e9eaa522cb95ceefc3014515ad6 100644 (file)
@@ -1,34 +1,48 @@
 #
 # Conditional build:
-%bcond_without  python2 # CPython 2.x module
-%bcond_without  python3 # CPython 3.x module
-%bcond_without doc     # sphinx based documentation
+%bcond_without python2 # CPython 2.x module
+%bcond_with    python3 # CPython 3.x module
+%bcond_without doc     # Sphinx based documentation
+%bcond_without tests   # unit tests
 #
 Summary:       Foreign Function Interface for Python 2 calling C code
 Summary(pl.UTF-8):     Interfejs funkcji obcych (FFI) dla Pythona 2 wywołującego kod w C
 Name:          python-cffi
-Version:       1.2.1
+Version:       1.15.1
 Release:       2
 License:       MIT
 Group:         Libraries/Python
-#Source0Download: https://pypi.python.org/pypi/cffi
-Source0:       https://pypi.python.org/packages/source/c/cffi/cffi-%{version}.tar.gz
-# Source0-md5: faca1e420e80433db409bb1bdd0a3f45
+#Source0Download: https://pypi.org/simple/cffi/
+Source0:       https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
+# Source0-md5: f493860a6e98cd0c4178149568a6b4f6
 URL:           http://cffi.readthedocs.org/
 BuildRequires: libffi-devel >= 3
 BuildRequires: pkgconfig
 %if %{with python2}
 BuildRequires: python >= 1:2.6
 BuildRequires: python-devel >= 1:2.6
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-pycparser
+BuildRequires: python-pytest
+BuildRequires: rpm-build >= 4.6
+BuildRequires: virtualenv
+%endif
 %endif
 %if %{with python3}
 BuildRequires: python3 >= 1:3.2
 BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-pycparser
+BuildRequires: python3-pytest
+BuildRequires: virtualenv
+%endif
 %endif
 BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.612
+BuildRequires: rpmbuild(macros) >= 1.714
 %{?with_doc:BuildRequires:     sphinx-pdg}
-Requires:      python-modules
+Requires:      python-modules >= 1:2.6
 Requires:      python-pycparser
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -51,7 +65,7 @@ Ten pakiet zawiera moduł Pythona 2.
 Summary:       Foreign Function Interface for Python 3 calling C code
 Summary(pl.UTF-8):     Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
 Group:         Libraries/Python
-Requires:      python3-modules
+Requires:      python3-modules >= 1:3.2
 Requires:      python3-pycparser
 
 %description -n python3-cffi
@@ -69,17 +83,40 @@ potrzeby nauki dodatkowego języka lub API.
 
 Ten pakiet zawiera moduł Pythona 3.
 
+%package apidocs
+Summary:       API documentation for Python CFFI module
+Summary(pl.UTF-8):     Dokumentacja API modułu Pythona CFFI
+Group:         Documentation
+BuildArch:     noarch
+
+%description apidocs
+API documentation for Python CFFI module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona CFFI.
+
 %prep
 %setup -q -n cffi-%{version}
 
 %build
 %if %{with python2}
-%py_build \
-       --build-base build-2
+%py_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTHONPATH=$(pwd):$(echo $(pwd)/build-2/lib.linux-*) \
+%{__python} -m pytest c testing
+%endif
 %endif
+
 %if %{with python3}
-%py3_build \
-       --build-base build-3
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
+%{__python3} -m pytest c testing
+%endif
 %endif
 
 %if %{with doc}
@@ -90,23 +127,13 @@ Ten pakiet zawiera moduł Pythona 3.
 rm -rf $RPM_BUILD_ROOT
 
 %if %{with python2}
-%{__python} setup.py \
-       build \
-               --build-base build-2 \
-       install \
-               --root=$RPM_BUILD_ROOT \
-               --optimize=2
+%py_install
 
 %py_postclean
 %endif
 
 %if %{with python3}
-%{__python3} setup.py \
-       build \
-               --build-base build-3 \
-       install \
-               --root=$RPM_BUILD_ROOT \
-               --optimize=2
+%py3_install
 %endif
 
 %clean
@@ -115,10 +142,12 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc LICENSE %{?with_doc:doc/build/html/{*.html,*.js,_static}}
+%doc AUTHORS LICENSE README.md
 %attr(755,root,root) %{py_sitedir}/_cffi_backend.so
 %dir %{py_sitedir}/cffi
+%{py_sitedir}/cffi/_cffi_errors.h
 %{py_sitedir}/cffi/_cffi_include.h
+%{py_sitedir}/cffi/_embedding.h
 %{py_sitedir}/cffi/parse_c_type.h
 %{py_sitedir}/cffi/*.py[co]
 %{py_sitedir}/cffi-%{version}-py*.egg-info
@@ -127,12 +156,20 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python3}
 %files -n python3-cffi
 %defattr(644,root,root,755)
-%doc LICENSE %{?with_doc:doc/build/html/{*.html,*.js,_static}}
+%doc AUTHORS LICENSE README.md
 %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
 %dir %{py3_sitedir}/cffi
+%{py3_sitedir}/cffi/_cffi_errors.h
 %{py3_sitedir}/cffi/_cffi_include.h
+%{py3_sitedir}/cffi/_embedding.h
 %{py3_sitedir}/cffi/parse_c_type.h
 %{py3_sitedir}/cffi/*.py
 %{py3_sitedir}/cffi/__pycache__
 %{py3_sitedir}/cffi-%{version}-py*.egg-info
 %endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/build/html/{_static,*.html,*.js}
+%endif
This page took 0.030367 seconds and 4 git commands to generate.