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