]> git.pld-linux.org Git - SPECS.git/blob - python-elementpath.spec
SPECS updated Tue 30 Apr 15:06:09 CEST 2024
[SPECS.git] / python-elementpath.spec
1 # NOTE: for python-elementpath >= 1.4 (for python 3.5+) see python3-elementpath.spec
2 #
3 # Conditional build:
4 %bcond_without  doc     # Sphinx documentation
5 %bcond_without  tests   # unit tests
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_with     python3 # CPython 3.x module (built from python3-elementpath.spec)
8
9 Summary:        XPath 1.0/2.0 parsers and selectors for ElementTree and lxml
10 Summary(pl.UTF-8):      Parsery i selektory XPath 1.0/2.0 dla ElementTree oraz lxml
11 Name:           python-elementpath
12 # keep 1.3.x here for python2 support
13 Version:        1.3.3
14 Release:        1
15 License:        MIT
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.org/simple/elementpath/
18 Source0:        https://files.pythonhosted.org/packages/source/e/elementpath/elementpath-%{version}.tar.gz
19 # Source0-md5:  3712104ae5970878a112c31aea71a503
20 Patch0:         %{name}-hash.patch
21 URL:            https://pypi.org/project/elementpath/
22 %if %{with python2}
23 BuildRequires:  python-modules >= 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-modules >= 1:3.5
31 BuildRequires:  python3-setuptools
32 %if %{with tests}
33 BuildRequires:  python3-lxml
34 %endif
35 %endif
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  rpmbuild(macros) >= 1.714
38 %if %{with doc}
39 BuildRequires:  sphinx-pdg
40 %endif
41 Requires:       python-modules >= 1:2.7
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 The proposal of this package is to provide XPath 1.0 and 2.0 selectors
47 for Python's ElementTree XML data structures, both for the standard
48 ElementTree library and for the lxml.etree library.
49
50 %description -l pl.UTF-8
51 Celem tego pakietu jest udostępnienie selektorów XPath 1.0 i 2.0 do
52 pythonowych struktur danych XML ElementTree, zarówno dla ElementTree z
53 biblioteki strandardowej, jak i lxml.etree.
54
55 %package -n python3-elementpath
56 Summary:        XPath 1.0/2.0 parsers and selectors for ElementTree and lxml
57 Summary(pl.UTF-8):      Parsery i selektory XPath 1.0/2.0 dla ElementTree oraz lxml
58 Group:          Libraries/Python
59 Requires:       python3-modules >= 1:3.5
60
61 %description -n python3-elementpath
62 The proposal of this package is to provide XPath 1.0 and 2.0 selectors
63 for Python's ElementTree XML data structures, both for the standard
64 ElementTree library and for the lxml.etree library.
65
66 %description -n python3-elementpath -l pl.UTF-8
67 Celem tego pakietu jest udostępnienie selektorów XPath 1.0 i 2.0 do
68 pythonowych struktur danych XML ElementTree, zarówno dla ElementTree z
69 biblioteki strandardowej, jak i lxml.etree.
70
71 %package apidocs
72 Summary:        API documentation for Python elementpath module
73 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona elementpath
74 Group:          Documentation
75
76 %description apidocs
77 API documentation for Python elementpath module.
78
79 %description apidocs -l pl.UTF-8
80 Dokumentacja API modułu Pythona elementpath.
81
82 %prep
83 %setup -q -n elementpath-%{version}
84 %patch0 -p1
85
86 %build
87 %if %{with python2}
88 %py_build
89
90 %if %{with tests}
91 PYTHONPATH=$(pwd) \
92 %{__python} tests/test_elementpath.py
93 %endif
94 %endif
95
96 %if %{with python3}
97 %py3_build
98
99 %if %{with tests}
100 %{__python3} -m unittest
101 %endif
102 %endif
103
104 %if %{with doc}
105 %{__make} -C doc html
106 %endif
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with python2}
112 %py_install
113
114 %py_postclean
115 %endif
116
117 %if %{with python3}
118 %py3_install
119 %endif
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124 %if %{with python2}
125 %files
126 %defattr(644,root,root,755)
127 %doc CHANGELOG.rst LICENSE README.rst
128 %{py_sitescriptdir}/elementpath
129 %{py_sitescriptdir}/elementpath-%{version}-py*.egg-info
130 %endif
131
132 %if %{with python3}
133 %files -n python3-elementpath
134 %defattr(644,root,root,755)
135 %doc CHANGELOG.rst LICENSE README.rst
136 %{py3_sitescriptdir}/elementpath
137 %{py3_sitescriptdir}/elementpath-%{version}-py*.egg-info
138 %endif
139
140 %if %{with doc}
141 %files apidocs
142 %defattr(644,root,root,755)
143 %doc doc/_build/html/{_static,*.html,*.js}
144 %endif
This page took 0.173962 seconds and 3 git commands to generate.