]> git.pld-linux.org Git - packages/python-lxml.git/blame - python-lxml.spec
rebuild with python 3.10
[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}
9cafda48 12Version: 4.8.0
2666e9c6 13Release: 2
7321ac76 14License: BSD
eb4ef173 15Group: Libraries/Python
b4e20e30
JB
16# until 4.6.1
17#Source0: https://lxml.de/files/%{module}-%{version}.tgz
18#Source0Download: https://pypi.org/simple/lxml/
19Source0: https://files.pythonhosted.org/packages/source/l/lxml/%{module}-%{version}.tar.gz
9cafda48 20# Source0-md5: ddb9f25a41ca5fb4f7d174a9d74bfa46
4c2d4999 21URL: https://lxml.de/
d3b1534c
ER
22BuildRequires: libxml2-devel >= 1:2.9.2
23BuildRequires: libxslt-devel >= 1.1.28
5342f174 24BuildRequires: pkgconfig
ea280a0f 25%if %{with python2}
b471452b 26BuildRequires: python-Cython >= 0.29.7
5342f174
JB
27BuildRequires: python-devel >= 1:2.7
28BuildRequires: python-modules >= 1:2.7
4c2d4999 29BuildRequires: python-setuptools
ea280a0f
AF
30%endif
31%if %{with python3}
b471452b 32BuildRequires: python3-Cython >= 0.29.7
5342f174
JB
33BuildRequires: python3-devel >= 1:3.5
34BuildRequires: python3-modules >= 1:3.5
4c2d4999 35BuildRequires: python3-setuptools
ea280a0f 36%endif
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}
72
73%build
ea280a0f 74%if %{with python2}
9ffc2b4f 75%py_build
4c2d4999
JB
76
77%if %{with tests}
b471452b
JB
78install -d testdir-2/src/lxml
79cd testdir-2/src/lxml
80ln -snf ../../../build-2/lib.linux-*/lxml/* ../../../src/lxml/tests .
81cd ../..
82ln -snf ../doc ../samples ../test.py .
83LC_ALL=C.UTF-8 \
84%{__python} test.py -v
85cd ..
4c2d4999 86%endif
ea280a0f 87%endif
4c2d4999 88
ea280a0f 89%if %{with python3}
9ffc2b4f 90%py3_build
4c2d4999
JB
91
92%if %{with tests}
b471452b
JB
93install -d testdir-3/src/lxml
94cd testdir-3/src/lxml
95ln -snf ../../../build-3/lib.linux-*/lxml/* ../../../src/lxml/tests .
96cd ../..
97ln -snf ../doc ../samples ../test.py .
98%{__python3} test.py -v
99cd ..
4c2d4999 100%endif
ea280a0f 101%endif
7321ac76 102
b471452b
JB
103%if %{with apidocs}
104# as of 4.4.2, python3 is not supported in mkhtml.py
105PYTHONPATH=$(echo $(pwd)/build-2/lib.linux-*) \
106%{__python} doc/mkhtml.py doc/html $(pwd) %{version}
107%endif
108
7321ac76
AM
109%install
110rm -rf $RPM_BUILD_ROOT
7321ac76 111
ea280a0f 112%if %{with python2}
9ffc2b4f 113%py_install
7321ac76
AM
114
115%py_postclean
ea280a0f
AF
116%endif
117
118%if %{with python3}
9ffc2b4f 119%py3_install
ea280a0f 120%endif
7321ac76
AM
121
122%clean
123rm -rf $RPM_BUILD_ROOT
124
ea280a0f 125%if %{with python2}
7321ac76
AM
126%files
127%defattr(644,root,root,755)
9cafda48 128%doc CHANGES.txt CREDITS.txt LICENSE.txt LICENSES.txt README.rst TODO.txt doc/licenses/{BSD,elementtree}.txt
0f893bb9
AM
129%dir %{py_sitedir}/lxml
130%{py_sitedir}/lxml/*.py[co]
00a14e75 131%{py_sitedir}/lxml/etree*.h
c0e9fb36
JB
132%{py_sitedir}/lxml/lxml.etree*.h
133%{py_sitedir}/lxml/includes
ae91e877 134%{py_sitedir}/lxml/isoschematron
00a14e75
JB
135%attr(755,root,root) %{py_sitedir}/lxml/_elementpath.so
136%attr(755,root,root) %{py_sitedir}/lxml/builder.so
75dd257f
MB
137%attr(755,root,root) %{py_sitedir}/lxml/etree.so
138%attr(755,root,root) %{py_sitedir}/lxml/objectify.so
b471452b 139%attr(755,root,root) %{py_sitedir}/lxml/sax.so
00a14e75
JB
140%dir %{py_sitedir}/lxml/html
141%{py_sitedir}/lxml/html/*.py[co]
142%attr(755,root,root) %{py_sitedir}/lxml/html/clean.so
143%attr(755,root,root) %{py_sitedir}/lxml/html/diff.so
144%{py_sitedir}/lxml-%{version}-py*.egg-info
ea280a0f
AF
145%endif
146
147%if %{with python3}
148%files -n python3-%{module}
149%defattr(644,root,root,755)
9cafda48 150%doc CHANGES.txt CREDITS.txt LICENSE.txt LICENSES.txt README.rst TODO.txt doc/licenses/{BSD,elementtree}.txt
ea280a0f 151%dir %{py3_sitedir}/lxml
00a14e75
JB
152%attr(755,root,root) %{py3_sitedir}/lxml/_elementpath.cpython-*.so
153%attr(755,root,root) %{py3_sitedir}/lxml/builder.cpython-*.so
c0e9fb36
JB
154%attr(755,root,root) %{py3_sitedir}/lxml/etree.cpython-*.so
155%attr(755,root,root) %{py3_sitedir}/lxml/objectify.cpython-*.so
b471452b 156%attr(755,root,root) %{py3_sitedir}/lxml/sax.cpython-*.so
ae91e877 157%{py3_sitedir}/lxml/*.py
38e20aab 158%{py3_sitedir}/lxml/__pycache__
00a14e75 159%{py3_sitedir}/lxml/etree*.h
c0e9fb36
JB
160%{py3_sitedir}/lxml/lxml.etree*.h
161%{py3_sitedir}/lxml/includes
ae91e877 162%{py3_sitedir}/lxml/isoschematron
00a14e75
JB
163%dir %{py3_sitedir}/lxml/html
164%{py3_sitedir}/lxml/html/*.py
165%{py3_sitedir}/lxml/html/__pycache__
166%attr(755,root,root) %{py3_sitedir}/lxml/html/clean.cpython-*.so
167%attr(755,root,root) %{py3_sitedir}/lxml/html/diff.cpython-*.so
168%{py3_sitedir}/lxml-%{version}-py*.egg-info
ea280a0f 169%endif
9295daeb
ER
170
171%if %{with apidocs}
172%files apidocs
173%defattr(644,root,root,755)
174%doc doc/html/*
175%endif
This page took 0.121448 seconds and 4 git commands to generate.