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