]>
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} |
5342f174 | 12 | Version: 4.6.1 |
b471452b | 13 | Release: 1 |
7321ac76 | 14 | License: BSD |
eb4ef173 | 15 | Group: Libraries/Python |
4c2d4999 | 16 | Source0: https://lxml.de/files/%{module}-%{version}.tgz |
5342f174 | 17 | # Source0-md5: 10924ab543397a06cb4cfaf9bdf0b80f |
4c2d4999 | 18 | URL: https://lxml.de/ |
d3b1534c ER |
19 | BuildRequires: libxml2-devel >= 1:2.9.2 |
20 | BuildRequires: libxslt-devel >= 1.1.28 | |
5342f174 | 21 | BuildRequires: pkgconfig |
ea280a0f | 22 | %if %{with python2} |
b471452b | 23 | BuildRequires: python-Cython >= 0.29.7 |
5342f174 JB |
24 | BuildRequires: python-devel >= 1:2.7 |
25 | BuildRequires: python-modules >= 1:2.7 | |
4c2d4999 | 26 | BuildRequires: python-setuptools |
ea280a0f AF |
27 | %endif |
28 | %if %{with python3} | |
b471452b | 29 | BuildRequires: python3-Cython >= 0.29.7 |
5342f174 JB |
30 | BuildRequires: python3-devel >= 1:3.5 |
31 | BuildRequires: python3-modules >= 1:3.5 | |
4c2d4999 | 32 | BuildRequires: python3-setuptools |
ea280a0f | 33 | %endif |
7217b13f | 34 | BuildRequires: rpm-pythonprov |
5342f174 | 35 | BuildRequires: rpmbuild(macros) >= 1.752 |
7321ac76 AM |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
37 | ||
38 | %description | |
39 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
40 | ||
8b26c81f JR |
41 | %description -l pl.UTF-8 |
42 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
459884ee | 43 | |
c0e9fb36 JB |
44 | %package -n python3-%{module} |
45 | Summary: Python 3 binding for the libxml2 and libxslt libraries | |
46 | Summary(pl.UTF-8): Wiązanie Pythona 3 do bibliotek libxml2 i libxslt | |
ea280a0f AF |
47 | Group: Libraries/Python |
48 | ||
49 | %description -n python3-%{module} | |
50 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
51 | ||
52 | %description -n python3-%{module} -l pl.UTF-8 | |
53 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
54 | ||
9295daeb ER |
55 | %package apidocs |
56 | Summary: lxml API documentation | |
c0e9fb36 | 57 | Summary(pl.UTF-8): Dokumentacja API modułu lxml |
9295daeb | 58 | Group: Documentation |
5342f174 | 59 | %{?noarchpackage} |
9295daeb ER |
60 | |
61 | %description apidocs | |
c0e9fb36 JB |
62 | lxml API documentation. |
63 | ||
64 | %description apidocs -l pl.UT8-8 | |
65 | Dokumentacja 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 |
75 | install -d testdir-2/src/lxml |
76 | cd testdir-2/src/lxml | |
77 | ln -snf ../../../build-2/lib.linux-*/lxml/* ../../../src/lxml/tests . | |
78 | cd ../.. | |
79 | ln -snf ../doc ../samples ../test.py . | |
80 | LC_ALL=C.UTF-8 \ | |
81 | %{__python} test.py -v | |
82 | cd .. | |
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 |
90 | install -d testdir-3/src/lxml |
91 | cd testdir-3/src/lxml | |
92 | ln -snf ../../../build-3/lib.linux-*/lxml/* ../../../src/lxml/tests . | |
93 | cd ../.. | |
94 | ln -snf ../doc ../samples ../test.py . | |
95 | %{__python3} test.py -v | |
96 | cd .. | |
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 | |
102 | PYTHONPATH=$(echo $(pwd)/build-2/lib.linux-*) \ | |
103 | %{__python} doc/mkhtml.py doc/html $(pwd) %{version} | |
104 | %endif | |
105 | ||
7321ac76 AM |
106 | %install |
107 | rm -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 | |
120 | rm -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 |