]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without apidocs # do not build and package API docs | |
4 | %bcond_without python2 # Python 2 package | |
5 | %bcond_without python3 # Python 3 package | |
6 | ||
7 | %define module lxml | |
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 | |
10 | Name: python-%{module} | |
11 | Version: 3.2.4 | |
12 | Release: 2 | |
13 | License: BSD | |
14 | Group: Libraries/Python | |
15 | Source0: http://lxml.de/files/%{module}-%{version}.tgz | |
16 | # Source0-md5: cc363499060f615aca1ec8dcc04df331 | |
17 | Patch0: %{name}-add-handle_failures-option-to-make_links_absolute-to.patch | |
18 | URL: http://lxml.de/ | |
19 | BuildRequires: libxml2-devel >= 1:2.7.8 | |
20 | BuildRequires: libxslt-devel >= 1.1.26 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel >= 1:2.4 | |
23 | BuildRequires: python-modules | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-Cython > 0.17 | |
27 | BuildRequires: python3-devel | |
28 | BuildRequires: python3-modules | |
29 | %endif | |
30 | BuildRequires: rpm-pythonprov | |
31 | BuildRequires: rpmbuild(macros) >= 1.219 | |
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 | ||
37 | %description -l pl.UTF-8 | |
38 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
39 | ||
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 | |
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 | ||
51 | %package apidocs | |
52 | Summary: lxml API documentation | |
53 | Summary(pl.UTF-8): Dokumentacja API modułu lxml | |
54 | Group: Documentation | |
55 | ||
56 | %description apidocs | |
57 | lxml API documentation. | |
58 | ||
59 | %description apidocs -l pl.UT8-8 | |
60 | Dokumentacja API modułu lxml. | |
61 | ||
62 | %prep | |
63 | %setup -q -n %{module}-%{version} | |
64 | %patch0 -p1 | |
65 | ||
66 | %build | |
67 | %if %{with python2} | |
68 | %{__python} setup.py build | |
69 | %endif | |
70 | %if %{with python3} | |
71 | %{__python3} setup.py build | |
72 | %endif | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %if %{with python2} | |
78 | %{__python} setup.py \ | |
79 | install \ | |
80 | --root=$RPM_BUILD_ROOT \ | |
81 | --optimize=2 | |
82 | ||
83 | %py_postclean | |
84 | %endif | |
85 | ||
86 | %if %{with python3} | |
87 | %{__python3} setup.py \ | |
88 | install \ | |
89 | --root=$RPM_BUILD_ROOT \ | |
90 | --optimize=2 | |
91 | %endif | |
92 | ||
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 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
109 | %doc docs/* CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt | |
110 | %dir %{py_sitedir}/lxml | |
111 | %{py_sitedir}/lxml/*.py[co] | |
112 | %{py_sitedir}/lxml/lxml.etree*.h | |
113 | %{py_sitedir}/lxml/includes | |
114 | %{py_sitedir}/lxml/isoschematron | |
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 | |
119 | %{py_sitedir}/lxml-*.egg-info | |
120 | %endif | |
121 | ||
122 | %if %{with python3} | |
123 | %files -n python3-%{module} | |
124 | %defattr(644,root,root,755) | |
125 | %doc docs/* CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt | |
126 | %dir %{py3_sitedir}/lxml | |
127 | %attr(755,root,root) %{py3_sitedir}/lxml/etree.cpython-*.so | |
128 | %attr(755,root,root) %{py3_sitedir}/lxml/objectify.cpython-*.so | |
129 | %{py3_sitedir}/lxml/*.py | |
130 | %{py3_sitedir}/lxml/__pycache__ | |
131 | %{py3_sitedir}/lxml/lxml.etree*.h | |
132 | %{py3_sitedir}/lxml/includes | |
133 | %{py3_sitedir}/lxml/isoschematron | |
134 | %{py3_sitedir}/lxml/html | |
135 | %{py3_sitedir}/lxml-*.egg-info | |
136 | %endif | |
137 | ||
138 | %if %{with apidocs} | |
139 | %files apidocs | |
140 | %defattr(644,root,root,755) | |
141 | %doc doc/html/* | |
142 | %endif |