]>
Commit | Line | Data |
---|---|---|
7321ac76 | 1 | # |
9295daeb | 2 | # Conditional build: |
4c2d4999 | 3 | %bcond_without apidocs # API documentation |
9295daeb | 4 | %bcond_without python2 # Python 2 package |
c0e9fb36 | 5 | %bcond_without python3 # Python 3 package |
b471452b | 6 | %bcond_without tests # unit tests |
9295daeb | 7 | |
7321ac76 | 8 | %define module lxml |
c0e9fb36 JB |
9 | Summary: Python 2 binding for the libxml2 and libxslt libraries |
10 | Summary(pl.UTF-8): Wiązanie Pythona 2 do bibliotek libxml2 i libxslt | |
7321ac76 | 11 | Name: python-%{module} |
126b2eb4 | 12 | Version: 4.9.2 |
ec5415e6 | 13 | Release: 1 |
7321ac76 | 14 | License: BSD |
eb4ef173 | 15 | Group: Libraries/Python |
b4e20e30 JB |
16 | #Source0Download: https://pypi.org/simple/lxml/ |
17 | Source0: https://files.pythonhosted.org/packages/source/l/lxml/%{module}-%{version}.tar.gz | |
126b2eb4 | 18 | # Source0-md5: aa84a7ce47581b43cb827145340505c6 |
30ce582a | 19 | Patch0: lxml-Skip-failing-test-test_html_prefix_nsmap.patch |
4c2d4999 | 20 | URL: https://lxml.de/ |
d3b1534c ER |
21 | BuildRequires: libxml2-devel >= 1:2.9.2 |
22 | BuildRequires: libxslt-devel >= 1.1.28 | |
5342f174 | 23 | BuildRequires: pkgconfig |
ea280a0f | 24 | %if %{with python2} |
ec5415e6 | 25 | BuildRequires: python-Cython >= 0.29.30 |
5342f174 JB |
26 | BuildRequires: python-devel >= 1:2.7 |
27 | BuildRequires: python-modules >= 1:2.7 | |
4c2d4999 | 28 | BuildRequires: python-setuptools |
ea280a0f AF |
29 | %endif |
30 | %if %{with python3} | |
ec5415e6 | 31 | BuildRequires: python3-Cython >= 0.29.30 |
5342f174 JB |
32 | BuildRequires: python3-devel >= 1:3.5 |
33 | BuildRequires: python3-modules >= 1:3.5 | |
4c2d4999 | 34 | BuildRequires: python3-setuptools |
ea280a0f | 35 | %endif |
ad6a70c9 | 36 | BuildRequires: rpm-build >= 4.6 |
7217b13f | 37 | BuildRequires: rpm-pythonprov |
5342f174 | 38 | BuildRequires: rpmbuild(macros) >= 1.752 |
7321ac76 AM |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
40 | ||
41 | %description | |
42 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
43 | ||
8b26c81f JR |
44 | %description -l pl.UTF-8 |
45 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
459884ee | 46 | |
c0e9fb36 JB |
47 | %package -n python3-%{module} |
48 | Summary: Python 3 binding for the libxml2 and libxslt libraries | |
49 | Summary(pl.UTF-8): Wiązanie Pythona 3 do bibliotek libxml2 i libxslt | |
ea280a0f AF |
50 | Group: Libraries/Python |
51 | ||
52 | %description -n python3-%{module} | |
53 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
54 | ||
55 | %description -n python3-%{module} -l pl.UTF-8 | |
56 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
57 | ||
9295daeb ER |
58 | %package apidocs |
59 | Summary: lxml API documentation | |
c0e9fb36 | 60 | Summary(pl.UTF-8): Dokumentacja API modułu lxml |
9295daeb | 61 | Group: Documentation |
d50a3f3a | 62 | BuildArch: noarch |
9295daeb ER |
63 | |
64 | %description apidocs | |
c0e9fb36 JB |
65 | lxml API documentation. |
66 | ||
67 | %description apidocs -l pl.UT8-8 | |
68 | Dokumentacja API modułu lxml. | |
9295daeb | 69 | |
7321ac76 AM |
70 | %prep |
71 | %setup -q -n %{module}-%{version} | |
30ce582a | 72 | %patch0 -p1 |
7321ac76 AM |
73 | |
74 | %build | |
ea280a0f | 75 | %if %{with python2} |
9ffc2b4f | 76 | %py_build |
4c2d4999 JB |
77 | |
78 | %if %{with tests} | |
b471452b JB |
79 | install -d testdir-2/src/lxml |
80 | cd testdir-2/src/lxml | |
81 | ln -snf ../../../build-2/lib.linux-*/lxml/* ../../../src/lxml/tests . | |
82 | cd ../.. | |
83 | ln -snf ../doc ../samples ../test.py . | |
84 | LC_ALL=C.UTF-8 \ | |
85 | %{__python} test.py -v | |
86 | cd .. | |
4c2d4999 | 87 | %endif |
ea280a0f | 88 | %endif |
4c2d4999 | 89 | |
ea280a0f | 90 | %if %{with python3} |
9ffc2b4f | 91 | %py3_build |
4c2d4999 JB |
92 | |
93 | %if %{with tests} | |
b471452b JB |
94 | install -d testdir-3/src/lxml |
95 | cd testdir-3/src/lxml | |
96 | ln -snf ../../../build-3/lib.linux-*/lxml/* ../../../src/lxml/tests . | |
97 | cd ../.. | |
98 | ln -snf ../doc ../samples ../test.py . | |
99 | %{__python3} test.py -v | |
100 | cd .. | |
4c2d4999 | 101 | %endif |
ea280a0f | 102 | %endif |
7321ac76 | 103 | |
b471452b JB |
104 | %if %{with apidocs} |
105 | # as of 4.4.2, python3 is not supported in mkhtml.py | |
106 | PYTHONPATH=$(echo $(pwd)/build-2/lib.linux-*) \ | |
107 | %{__python} doc/mkhtml.py doc/html $(pwd) %{version} | |
108 | %endif | |
109 | ||
7321ac76 AM |
110 | %install |
111 | rm -rf $RPM_BUILD_ROOT | |
7321ac76 | 112 | |
ea280a0f | 113 | %if %{with python2} |
9ffc2b4f | 114 | %py_install |
7321ac76 AM |
115 | |
116 | %py_postclean | |
ea280a0f AF |
117 | %endif |
118 | ||
119 | %if %{with python3} | |
9ffc2b4f | 120 | %py3_install |
ea280a0f | 121 | %endif |
7321ac76 AM |
122 | |
123 | %clean | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
ea280a0f | 126 | %if %{with python2} |
7321ac76 AM |
127 | %files |
128 | %defattr(644,root,root,755) | |
9cafda48 | 129 | %doc CHANGES.txt CREDITS.txt LICENSE.txt LICENSES.txt README.rst TODO.txt doc/licenses/{BSD,elementtree}.txt |
0f893bb9 | 130 | %dir %{py_sitedir}/lxml |
126b2eb4 | 131 | %{py_sitedir}/lxml/*.pxi |
0f893bb9 | 132 | %{py_sitedir}/lxml/*.py[co] |
126b2eb4 JB |
133 | %{py_sitedir}/lxml/etree.pyx |
134 | %{py_sitedir}/lxml/objectify.pyx | |
00a14e75 | 135 | %{py_sitedir}/lxml/etree*.h |
c0e9fb36 JB |
136 | %{py_sitedir}/lxml/lxml.etree*.h |
137 | %{py_sitedir}/lxml/includes | |
ae91e877 | 138 | %{py_sitedir}/lxml/isoschematron |
00a14e75 JB |
139 | %attr(755,root,root) %{py_sitedir}/lxml/_elementpath.so |
140 | %attr(755,root,root) %{py_sitedir}/lxml/builder.so | |
75dd257f MB |
141 | %attr(755,root,root) %{py_sitedir}/lxml/etree.so |
142 | %attr(755,root,root) %{py_sitedir}/lxml/objectify.so | |
b471452b | 143 | %attr(755,root,root) %{py_sitedir}/lxml/sax.so |
00a14e75 JB |
144 | %dir %{py_sitedir}/lxml/html |
145 | %{py_sitedir}/lxml/html/*.py[co] | |
146 | %attr(755,root,root) %{py_sitedir}/lxml/html/clean.so | |
147 | %attr(755,root,root) %{py_sitedir}/lxml/html/diff.so | |
148 | %{py_sitedir}/lxml-%{version}-py*.egg-info | |
ea280a0f AF |
149 | %endif |
150 | ||
151 | %if %{with python3} | |
152 | %files -n python3-%{module} | |
153 | %defattr(644,root,root,755) | |
9cafda48 | 154 | %doc CHANGES.txt CREDITS.txt LICENSE.txt LICENSES.txt README.rst TODO.txt doc/licenses/{BSD,elementtree}.txt |
ea280a0f | 155 | %dir %{py3_sitedir}/lxml |
00a14e75 JB |
156 | %attr(755,root,root) %{py3_sitedir}/lxml/_elementpath.cpython-*.so |
157 | %attr(755,root,root) %{py3_sitedir}/lxml/builder.cpython-*.so | |
c0e9fb36 JB |
158 | %attr(755,root,root) %{py3_sitedir}/lxml/etree.cpython-*.so |
159 | %attr(755,root,root) %{py3_sitedir}/lxml/objectify.cpython-*.so | |
b471452b | 160 | %attr(755,root,root) %{py3_sitedir}/lxml/sax.cpython-*.so |
126b2eb4 | 161 | %{py3_sitedir}/lxml/*.pxi |
ae91e877 | 162 | %{py3_sitedir}/lxml/*.py |
38e20aab | 163 | %{py3_sitedir}/lxml/__pycache__ |
126b2eb4 JB |
164 | %{py3_sitedir}/lxml/etree.pyx |
165 | %{py3_sitedir}/lxml/objectify.pyx | |
00a14e75 | 166 | %{py3_sitedir}/lxml/etree*.h |
c0e9fb36 JB |
167 | %{py3_sitedir}/lxml/lxml.etree*.h |
168 | %{py3_sitedir}/lxml/includes | |
ae91e877 | 169 | %{py3_sitedir}/lxml/isoschematron |
00a14e75 JB |
170 | %dir %{py3_sitedir}/lxml/html |
171 | %{py3_sitedir}/lxml/html/*.py | |
172 | %{py3_sitedir}/lxml/html/__pycache__ | |
173 | %attr(755,root,root) %{py3_sitedir}/lxml/html/clean.cpython-*.so | |
174 | %attr(755,root,root) %{py3_sitedir}/lxml/html/diff.cpython-*.so | |
175 | %{py3_sitedir}/lxml-%{version}-py*.egg-info | |
ea280a0f | 176 | %endif |
9295daeb ER |
177 | |
178 | %if %{with apidocs} | |
179 | %files apidocs | |
180 | %defattr(644,root,root,755) | |
181 | %doc doc/html/* | |
182 | %endif |