[packages/python-cssselect] - up to 0.9.1; python3 package

arekm arekm at pld-linux.org
Thu Oct 15 13:52:50 CEST 2015


commit d504ae3f52cba70e4f4a517d603d9f33d2a78567
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 15 13:52:45 2015 +0200

    - up to 0.9.1; python3 package

 python-cssselect.spec | 86 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 75 insertions(+), 11 deletions(-)
---
diff --git a/python-cssselect.spec b/python-cssselect.spec
index a4ebd39..825aedd 100644
--- a/python-cssselect.spec
+++ b/python-cssselect.spec
@@ -1,17 +1,31 @@
+# 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	cssselect
 Summary:	Python moudle for parsing CSS3 Selectors and translating them to XPath 1.0 expressions
 Summary(pl.UTF-8):	Moduł pythona interpretujący selektory CSS i tłumaczący je na wyrażenia XPath 1.0
 Name:		python-%{module}
-Version:	0.7.1
-Release:	2
+Version:	0.9.1
+Release:	1
 License:	BSD
 Group:		Development/Languages/Python
 Source0:	http://pypi.python.org/packages/source/c/%{module}/%{module}-%{version}.tar.gz
-# Source0-md5:	c6c5e9a2e7ca226ce03f6f67a771379c
+# Source0-md5:	c74f45966277dc7a0f768b9b0f3522ac
 URL:		http://packages.python.org/cssselect/
-BuildRequires:	python-distribute
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.219
+%if %{with python2}
+BuildRequires:	python-devel
+BuildRequires:	python-distribute
+%endif
+%if %{with python3}
+BuildRequires:	python3-devel
+BuildRequires:	python3-distribute
+BuildRequires:	python3-modules
+%endif
 Requires:	python-modules
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -30,26 +44,68 @@ XPath do znajdywania pasujących elementów w dokumentach XML lub HTML.
 Ten moduł był częścią lxml jako lxml.cssselct zanim został wydzielony
 jako osobny projekt.
 
+%package -n python3-%{module}
+Summary:	Python moudle for parsing CSS3 Selectors and translating them to XPath 1.0 expressions
+Summary(pl.UTF-8):	Moduł pythona interpretujący selektory CSS i tłumaczący je na wyrażenia XPath 1.0
+Group:		Libraries/Python
+Requires:	python3-modules
+
+%description -n python3-%{module}
+cssselect parses CSS3 Selectors and translate them to XPath 1.0
+expressions. Such expressions can be used in lxml or another XPath
+engine to find the matching elements in an XML or HTML document. This
+module used to live inside of lxml as lxml.cssselect before it was
+extracted as a stand-alone project.
+
+%description -n python3-%{module} -l pl.UTF-8
+cssselect interpretuje selektory CSS3 i tłumaczy je na wyrażenia XPath
+1.0. Owe wyreażenia mogą być późnije użyte w lxml lub w innym kodzie
+XPath do znajdywania pasujących elementów w dokumentach XML lub HTML.
+Ten moduł był częścią lxml jako lxml.cssselct zanim został wydzielony
+jako osobny projekt.
+
 %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 \
-	--skip-build \
-	--optimize=2 \
-	--root=$RPM_BUILD_ROOT
 
-%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
-%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
+%if %{with python2}
+%{__python} setup.py \
+        build --build-base build-2 \
+        install --skip-build \
+        --optimize=2 \
+        --root=$RPM_BUILD_ROOT
+
 %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)
 # %doc AUTHORS CREDITS ChangeLog NEWS README THANKS TODO
@@ -57,3 +113,11 @@ rm -rf $RPM_BUILD_ROOT
 %{py_sitescriptdir}/%{module}-*.egg-info
 %endif
 %{py_sitescriptdir}/%{module}
+%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-cssselect.git/commitdiff/d504ae3f52cba70e4f4a517d603d9f33d2a78567



More information about the pld-cvs-commit mailing list