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