]>
Commit | Line | Data |
---|---|---|
7321ac76 | 1 | # |
9295daeb ER |
2 | # Conditional build: |
3 | %bcond_without apidocs # do not build and package API docs | |
9295daeb | 4 | %bcond_without python2 # Python 2 package |
c0e9fb36 | 5 | %bcond_without python3 # Python 3 package |
9295daeb | 6 | |
7321ac76 | 7 | %define module lxml |
c0e9fb36 JB |
8 | Summary: Python 2 binding for the libxml2 and libxslt libraries |
9 | Summary(pl.UTF-8): Wiązanie Pythona 2 do bibliotek libxml2 i libxslt | |
7321ac76 | 10 | Name: python-%{module} |
91591463 | 11 | Version: 3.2.4 |
6ada93df | 12 | Release: 2 |
7321ac76 | 13 | License: BSD |
eb4ef173 | 14 | Group: Libraries/Python |
1c115bfe | 15 | Source0: http://lxml.de/files/%{module}-%{version}.tgz |
91591463 | 16 | # Source0-md5: cc363499060f615aca1ec8dcc04df331 |
6ada93df | 17 | Patch0: %{name}-add-handle_failures-option-to-make_links_absolute-to.patch |
1c115bfe | 18 | URL: http://lxml.de/ |
c0e9fb36 JB |
19 | BuildRequires: libxml2-devel >= 1:2.7.8 |
20 | BuildRequires: libxslt-devel >= 1.1.26 | |
ea280a0f | 21 | %if %{with python2} |
c0e9fb36 | 22 | BuildRequires: python-devel >= 1:2.4 |
7217b13f | 23 | BuildRequires: python-modules |
ea280a0f AF |
24 | %endif |
25 | %if %{with python3} | |
339d4628 | 26 | BuildRequires: python3-Cython > 0.17 |
ea280a0f AF |
27 | BuildRequires: python3-devel |
28 | BuildRequires: python3-modules | |
29 | %endif | |
7217b13f | 30 | BuildRequires: rpm-pythonprov |
7321ac76 | 31 | BuildRequires: rpmbuild(macros) >= 1.219 |
7321ac76 AM |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
34 | %description | |
35 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
36 | ||
8b26c81f JR |
37 | %description -l pl.UTF-8 |
38 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
459884ee | 39 | |
c0e9fb36 JB |
40 | %package -n python3-%{module} |
41 | Summary: Python 3 binding for the libxml2 and libxslt libraries | |
42 | Summary(pl.UTF-8): Wiązanie Pythona 3 do bibliotek libxml2 i libxslt | |
ea280a0f AF |
43 | Group: Libraries/Python |
44 | ||
45 | %description -n python3-%{module} | |
46 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
47 | ||
48 | %description -n python3-%{module} -l pl.UTF-8 | |
49 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
50 | ||
9295daeb ER |
51 | %package apidocs |
52 | Summary: lxml API documentation | |
c0e9fb36 | 53 | Summary(pl.UTF-8): Dokumentacja API modułu lxml |
9295daeb ER |
54 | Group: Documentation |
55 | ||
56 | %description apidocs | |
c0e9fb36 JB |
57 | lxml API documentation. |
58 | ||
59 | %description apidocs -l pl.UT8-8 | |
60 | Dokumentacja API modułu lxml. | |
9295daeb | 61 | |
7321ac76 AM |
62 | %prep |
63 | %setup -q -n %{module}-%{version} | |
6ada93df | 64 | %patch0 -p1 |
7321ac76 AM |
65 | |
66 | %build | |
ea280a0f AF |
67 | %if %{with python2} |
68 | %{__python} setup.py build | |
69 | %endif | |
70 | %if %{with python3} | |
71 | %{__python3} setup.py build | |
72 | %endif | |
7321ac76 AM |
73 | |
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
7321ac76 | 76 | |
ea280a0f AF |
77 | %if %{with python2} |
78 | %{__python} setup.py \ | |
79 | install \ | |
7321ac76 AM |
80 | --root=$RPM_BUILD_ROOT \ |
81 | --optimize=2 | |
82 | ||
83 | %py_postclean | |
ea280a0f AF |
84 | %endif |
85 | ||
86 | %if %{with python3} | |
87 | %{__python3} setup.py \ | |
88 | install \ | |
89 | --root=$RPM_BUILD_ROOT \ | |
90 | --optimize=2 | |
ea280a0f | 91 | %endif |
7321ac76 | 92 | |
9295daeb ER |
93 | # cleanup for packaging |
94 | rm -rf docs | |
95 | cp -a doc docs | |
96 | # apidocs packaged separately | |
97 | rm -rf docs/html | |
98 | # build docs not useful at runtime | |
99 | rm docs/build.txt | |
100 | # common licenses | |
101 | rm docs/licenses/{BSD,GPL}.txt | |
102 | ||
7321ac76 AM |
103 | %clean |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
ea280a0f | 106 | %if %{with python2} |
7321ac76 AM |
107 | %files |
108 | %defattr(644,root,root,755) | |
c0e9fb36 | 109 | %doc docs/* CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt |
0f893bb9 AM |
110 | %dir %{py_sitedir}/lxml |
111 | %{py_sitedir}/lxml/*.py[co] | |
c0e9fb36 JB |
112 | %{py_sitedir}/lxml/lxml.etree*.h |
113 | %{py_sitedir}/lxml/includes | |
ae91e877 | 114 | %{py_sitedir}/lxml/isoschematron |
75dd257f MB |
115 | %dir %{py_sitedir}/lxml/html |
116 | %{py_sitedir}/lxml/html/*.py[co] | |
117 | %attr(755,root,root) %{py_sitedir}/lxml/etree.so | |
118 | %attr(755,root,root) %{py_sitedir}/lxml/objectify.so | |
31980435 | 119 | %{py_sitedir}/lxml-*.egg-info |
ea280a0f AF |
120 | %endif |
121 | ||
122 | %if %{with python3} | |
123 | %files -n python3-%{module} | |
124 | %defattr(644,root,root,755) | |
c0e9fb36 | 125 | %doc docs/* CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt |
ea280a0f | 126 | %dir %{py3_sitedir}/lxml |
c0e9fb36 JB |
127 | %attr(755,root,root) %{py3_sitedir}/lxml/etree.cpython-*.so |
128 | %attr(755,root,root) %{py3_sitedir}/lxml/objectify.cpython-*.so | |
ae91e877 | 129 | %{py3_sitedir}/lxml/*.py |
38e20aab | 130 | %{py3_sitedir}/lxml/__pycache__ |
c0e9fb36 JB |
131 | %{py3_sitedir}/lxml/lxml.etree*.h |
132 | %{py3_sitedir}/lxml/includes | |
ae91e877 | 133 | %{py3_sitedir}/lxml/isoschematron |
134 | %{py3_sitedir}/lxml/html | |
ea280a0f AF |
135 | %{py3_sitedir}/lxml-*.egg-info |
136 | %endif | |
9295daeb ER |
137 | |
138 | %if %{with apidocs} | |
139 | %files apidocs | |
140 | %defattr(644,root,root,755) | |
141 | %doc doc/html/* | |
142 | %endif |