]> git.pld-linux.org Git - SPECS.git/blob - python-cssselect.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-cssselect.spec
1 #
2 # Conditional build:
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
7 #
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}
12 Version:        1.1.0
13 Release:        2
14 License:        BSD
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
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-setuptools
25 %if %{with tests}
26 BuildRequires:  python-lxml
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-devel >= 1:3.4
31 BuildRequires:  python3-setuptools
32 %if %{with tests}
33 BuildRequires:  python3-lxml
34 %endif
35 %endif
36 %if %{with doc}
37 BuildRequires:  sphinx-pdg
38 %endif
39 Requires:       python-modules >= 1:2.7
40 BuildArch:      noarch
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
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.
49
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
55 jako osobny projekt.
56
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
62
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.
69
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
75 jako osobny projekt.
76
77 %package apidocs
78 Summary:        API documentation for Python cssselect module
79 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona cssselect
80 Group:          Documentation
81
82 %description apidocs
83 API documentation for Python cssselect module.
84
85 %description apidocs -l pl.UTF-8
86 Dokumentacja API modułu Pythona cssselect.
87
88 %prep
89 %setup -q -n %{module}-%{version}
90
91 %build
92 %if %{with python2}
93 %py_build %{?with_tests:test}
94 %endif
95
96 %if %{with python3}
97 %py3_build %{?with_tests:test}
98 %endif
99
100 %if %{with doc}
101 # no Makefile...
102 cd docs
103 PYTHONPATH=$(pwd)/.. \
104 sphinx-build -b html . _build/html
105 %endif
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109
110 %if %{with python2}
111 %py_install
112
113 %py_postclean
114 %endif
115
116 %if %{with python3}
117 %py3_install
118 %endif
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %files
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
129 %endif
130
131 %if %{with python3}
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
137 %endif
138
139 %if %{with doc}
140 %files apidocs
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_static,*.html,*.js}
143 %endif
This page took 0.717639 seconds and 3 git commands to generate.