]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without apidocs # API documentation | |
4 | %bcond_without python2 # Python 2 package | |
5 | %bcond_without python3 # Python 3 package | |
6 | %bcond_with tests # unit tests (don't work without lxml not installed?) | |
7 | ||
8 | %define module lxml | |
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 | |
11 | Name: python-%{module} | |
12 | Version: 4.2.5 | |
13 | Release: 2 | |
14 | License: BSD | |
15 | Group: Libraries/Python | |
16 | Source0: https://lxml.de/files/%{module}-%{version}.tgz | |
17 | # Source0-md5: ce042575c4459c4994f68b9a862a72a4 | |
18 | URL: https://lxml.de/ | |
19 | BuildRequires: libxml2-devel >= 1:2.9.2 | |
20 | BuildRequires: libxslt-devel >= 1.1.28 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel >= 1:2.6 | |
23 | BuildRequires: python-modules >= 1:2.6 | |
24 | BuildRequires: python-setuptools | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-Cython >= 0.17 | |
28 | BuildRequires: python3-devel >= 1:3.3 | |
29 | BuildRequires: python3-modules >= 1:3.3 | |
30 | BuildRequires: python3-setuptools | |
31 | %endif | |
32 | BuildRequires: rpm-pythonprov | |
33 | BuildRequires: rpmbuild(macros) >= 1.710 | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
41 | ||
42 | %package -n python3-%{module} | |
43 | Summary: Python 3 binding for the libxml2 and libxslt libraries | |
44 | Summary(pl.UTF-8): Wiązanie Pythona 3 do bibliotek libxml2 i libxslt | |
45 | Group: Libraries/Python | |
46 | ||
47 | %description -n python3-%{module} | |
48 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
49 | ||
50 | %description -n python3-%{module} -l pl.UTF-8 | |
51 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
52 | ||
53 | %package apidocs | |
54 | Summary: lxml API documentation | |
55 | Summary(pl.UTF-8): Dokumentacja API modułu lxml | |
56 | Group: Documentation | |
57 | %if "%{_rpmversion}" >= "5" | |
58 | BuildArch: noarch | |
59 | %endif | |
60 | ||
61 | %description apidocs | |
62 | lxml API documentation. | |
63 | ||
64 | %description apidocs -l pl.UT8-8 | |
65 | Dokumentacja API modułu lxml. | |
66 | ||
67 | %prep | |
68 | %setup -q -n %{module}-%{version} | |
69 | ||
70 | %build | |
71 | %if %{with python2} | |
72 | %py_build | |
73 | ||
74 | %if %{with tests} | |
75 | PYTHONPATH=$(pwd)/$(echo build-2/lib.linux-*) \ | |
76 | %{__python} test.py | |
77 | %endif | |
78 | %endif | |
79 | ||
80 | %if %{with python3} | |
81 | %py3_build | |
82 | ||
83 | %if %{with tests} | |
84 | PYTHONPATH=$(pwd)/$(echo build-3/lib.linux-*) \ | |
85 | %{__python3} test.py | |
86 | %endif | |
87 | %endif | |
88 | ||
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %if %{with python2} | |
93 | %py_install | |
94 | ||
95 | %py_postclean | |
96 | %endif | |
97 | ||
98 | %if %{with python3} | |
99 | %py3_install | |
100 | %endif | |
101 | ||
102 | %clean | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %if %{with python2} | |
106 | %files | |
107 | %defattr(644,root,root,755) | |
108 | %doc CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt doc/licenses/{BSD,ZopePublicLicense,elementtree}.txt | |
109 | %dir %{py_sitedir}/lxml | |
110 | %{py_sitedir}/lxml/*.py[co] | |
111 | %{py_sitedir}/lxml/etree*.h | |
112 | %{py_sitedir}/lxml/lxml.etree*.h | |
113 | %{py_sitedir}/lxml/includes | |
114 | %{py_sitedir}/lxml/isoschematron | |
115 | %attr(755,root,root) %{py_sitedir}/lxml/_elementpath.so | |
116 | %attr(755,root,root) %{py_sitedir}/lxml/builder.so | |
117 | %attr(755,root,root) %{py_sitedir}/lxml/etree.so | |
118 | %attr(755,root,root) %{py_sitedir}/lxml/objectify.so | |
119 | %dir %{py_sitedir}/lxml/html | |
120 | %{py_sitedir}/lxml/html/*.py[co] | |
121 | %attr(755,root,root) %{py_sitedir}/lxml/html/clean.so | |
122 | %attr(755,root,root) %{py_sitedir}/lxml/html/diff.so | |
123 | %{py_sitedir}/lxml-%{version}-py*.egg-info | |
124 | %endif | |
125 | ||
126 | %if %{with python3} | |
127 | %files -n python3-%{module} | |
128 | %defattr(644,root,root,755) | |
129 | %doc CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt doc/licenses/{BSD,ZopePublicLicense,elementtree}.txt | |
130 | %dir %{py3_sitedir}/lxml | |
131 | %attr(755,root,root) %{py3_sitedir}/lxml/_elementpath.cpython-*.so | |
132 | %attr(755,root,root) %{py3_sitedir}/lxml/builder.cpython-*.so | |
133 | %attr(755,root,root) %{py3_sitedir}/lxml/etree.cpython-*.so | |
134 | %attr(755,root,root) %{py3_sitedir}/lxml/objectify.cpython-*.so | |
135 | %{py3_sitedir}/lxml/*.py | |
136 | %{py3_sitedir}/lxml/__pycache__ | |
137 | %{py3_sitedir}/lxml/etree*.h | |
138 | %{py3_sitedir}/lxml/lxml.etree*.h | |
139 | %{py3_sitedir}/lxml/includes | |
140 | %{py3_sitedir}/lxml/isoschematron | |
141 | %dir %{py3_sitedir}/lxml/html | |
142 | %{py3_sitedir}/lxml/html/*.py | |
143 | %{py3_sitedir}/lxml/html/__pycache__ | |
144 | %attr(755,root,root) %{py3_sitedir}/lxml/html/clean.cpython-*.so | |
145 | %attr(755,root,root) %{py3_sitedir}/lxml/html/diff.cpython-*.so | |
146 | %{py3_sitedir}/lxml-%{version}-py*.egg-info | |
147 | %endif | |
148 | ||
149 | %if %{with apidocs} | |
150 | %files apidocs | |
151 | %defattr(644,root,root,755) | |
152 | %doc doc/html/* | |
153 | %endif |