3 %bcond_without doc # Sphinx documentation
4 %bcond_with tests # unit tests [tests missing in archive as of 1.0.3]
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module cssselect
9 Summary: Python moudle for parsing CSS3 Selectors and translating them to XPath 1.0 expressions
10 Summary(pl.UTF-8): Moduł pythona interpretujący selektory CSS i tłumaczący je na wyrażenia XPath 1.0
11 Name: python-%{module}
15 Group: Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/cssselect/
17 Source0: https://files.pythonhosted.org/packages/source/c/cssselect/%{module}-%{version}.tar.gz
18 # Source0-md5: fa57704c1cb66cc8e537b782bd6b227e
19 URL: http://packages.python.org/cssselect/
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-devel >= 1:2.7
24 BuildRequires: python-setuptools
26 BuildRequires: python-lxml
30 BuildRequires: python3-devel >= 1:3.4
31 BuildRequires: python3-setuptools
33 BuildRequires: python3-lxml
37 BuildRequires: sphinx-pdg
39 Requires: python-modules >= 1:2.7
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 cssselect parses CSS3 Selectors and translate them to XPath 1.0
45 expressions. Such expressions can be used in lxml or another XPath
46 engine to find the matching elements in an XML or HTML document. This
47 module used to live inside of lxml as lxml.cssselect before it was
48 extracted as a stand-alone project.
50 %description -l pl.UTF-8
51 cssselect interpretuje selektory CSS3 i tłumaczy je na wyrażenia XPath
52 1.0. Owe wyreażenia mogą być później użyte w lxml lub w innym kodzie
53 XPath do znajdywania pasujących elementów w dokumentach XML lub HTML.
54 Ten moduł był częścią lxml jako lxml.cssselect zanim został wydzielony
57 %package -n python3-%{module}
58 Summary: Python moudle for parsing CSS3 Selectors and translating them to XPath 1.0 expressions
59 Summary(pl.UTF-8): Moduł pythona interpretujący selektory CSS i tłumaczący je na wyrażenia XPath 1.0
60 Group: Libraries/Python
61 Requires: python3-modules >= 1:3.4
63 %description -n python3-%{module}
64 cssselect parses CSS3 Selectors and translate them to XPath 1.0
65 expressions. Such expressions can be used in lxml or another XPath
66 engine to find the matching elements in an XML or HTML document. This
67 module used to live inside of lxml as lxml.cssselect before it was
68 extracted as a stand-alone project.
70 %description -n python3-%{module} -l pl.UTF-8
71 cssselect interpretuje selektory CSS3 i tłumaczy je na wyrażenia XPath
72 1.0. Owe wyreażenia mogą być później użyte w lxml lub w innym kodzie
73 XPath do znajdywania pasujących elementów w dokumentach XML lub HTML.
74 Ten moduł był częścią lxml jako lxml.cssselect zanim został wydzielony
78 Summary: API documentation for Python cssselect module
79 Summary(pl.UTF-8): Dokumentacja API modułu Pythona cssselect
83 API documentation for Python cssselect module.
85 %description apidocs -l pl.UTF-8
86 Dokumentacja API modułu Pythona cssselect.
89 %setup -q -n %{module}-%{version}
93 %py_build %{?with_tests:test}
97 %py3_build %{?with_tests:test}
103 PYTHONPATH=$(pwd)/.. \
104 sphinx-build -b html . _build/html
108 rm -rf $RPM_BUILD_ROOT
121 rm -rf $RPM_BUILD_ROOT
125 %defattr(644,root,root,755)
126 %doc AUTHORS CHANGES LICENSE README.rst
127 %{py_sitescriptdir}/cssselect
128 %{py_sitescriptdir}/cssselect-%{version}-py*.egg-info
132 %files -n python3-%{module}
133 %defattr(644,root,root,755)
134 %doc AUTHORS CHANGES LICENSE README.rst
135 %{py3_sitescriptdir}/cssselect
136 %{py3_sitescriptdir}/cssselect-%{version}-py*.egg-info
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_static,*.html,*.js}