[packages/python-pyquery] - rel 3; python3 package

arekm arekm at pld-linux.org
Thu Oct 15 13:48:37 CEST 2015


commit 7e2ccfffbfe2b1922c361812cccec838bd474c88
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 15 13:48:33 2015 +0200

    - rel 3; python3 package

 python-pyquery.spec | 84 ++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 74 insertions(+), 10 deletions(-)
---
diff --git a/python-pyquery.spec b/python-pyquery.spec
index 3645db3..4a5dffd 100644
--- a/python-pyquery.spec
+++ b/python-pyquery.spec
@@ -1,18 +1,34 @@
+# Conditional build:
+%bcond_without  doc             # don't build doc
+%bcond_without  tests   # do not perform "make test"
+%bcond_without  python2 # CPython 2.x module
+%bcond_without  python3 # CPython 3.x module
+#
 %define 	module	pyquery
 Summary:	A jquery-like library for Python
 Summary(pl.UTF-8):	Podobna do jquery biblioteka dla Pythona
 Name:		python-%{module}
 Version:	1.2.9
-Release:	1
+Release:	2
 License:	BSD
 Group:		Development/Languages/Python
 # Source0:	http://pypi.python.org/packages/source/p/pyquery/%{module}-%{version}.tar.gz
 Source0:	https://github.com/gawel/pyquery/archive/%{version}.tar.gz
 # Source0-md5:	902e2ded38899c7c3f66cba6d4a464fb
 URL:		http://pypi.python.org/pypi/pyquery
-BuildRequires:	python-setuptools
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.219
+%if %{with python2}
+%{?with_tests:BuildRequires:       python-cssselect}
+BuildRequires:	python-devel
+BuildRequires:	python-setuptools
+%endif
+%if %{with python3}
+%{?with_tests:BuildRequires:       python3-cssselect}
+BuildRequires:	python3-devel
+BuildRequires:	python3-modules
+BuildRequires:	python3-setuptools
+%endif
 Requires:	python-cssselect
 Requires:	python-lxml
 Requires:	python-modules
@@ -26,29 +42,69 @@ xml and html manipulation.
 
 %description -l pl.UTF-8
 Pyquery pozwala na wykonywanie zapytań jquery na dokumentach XML.
-Interfejs jest jak to tylko możliwe podobny do jquery. Pyquery używa lxml
-do szybkiej manipulacji plików XML i HTML.
+Interfejs jest jak to tylko możliwe podobny do jquery. Pyquery używa
+lxml do szybkiej manipulacji plików XML i HTML.
+
+%package -n python3-%{module}
+Summary:	A jquery-like library for Python
+Summary(pl.UTF-8):	Podobna do jquery biblioteka dla Pythona
+Group:		Libraries/Python
+Requires:	python-cssselect
+Requires:	python-lxml
+Requires:	python-modules
+
+%description -n python3-%{module}
+Pyquery allows you to make jquery queries on xml documents. The API is
+as much as possible the similar to jquery. pyquery uses lxml for fast
+xml and html manipulation.
+
+%description -n python3-%{module} -l pl.UTF-8
+Pyquery pozwala na wykonywanie zapytań jquery na dokumentach XML.
+Interfejs jest jak to tylko możliwe podobny do jquery. Pyquery używa
+lxml do szybkiej manipulacji plików XML i HTML.
 
 %prep
 %setup -q -n %{module}-%{version}
 
+# setup copy of source in py3 dir
+set -- *
+install -d py3
+cp -a "$@" py3
+
 %build
-%{__python} setup.py build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
-	--optimize=2 \
-	--root=$RPM_BUILD_ROOT
 
+%if %{with python2}
+%{__python} setup.py \
+        build --build-base build-2 \
+        install --skip-build \
+        --optimize=2 \
+        --root=$RPM_BUILD_ROOT
 
-%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
-%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
 %py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+        build --build-base build-3 \
+        install --skip-build \
+        --optimize=2 \
+        --root=$RPM_BUILD_ROOT
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %dir %{py_sitescriptdir}/%{module}
@@ -56,3 +112,11 @@ rm -rf $RPM_BUILD_ROOT
 %if "%{py_ver}" > "2.4"
 %{py_sitescriptdir}/pyquery-*.egg-info
 %endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pyquery.git/commitdiff/7e2ccfffbfe2b1922c361812cccec838bd474c88



More information about the pld-cvs-commit mailing list