]>
Commit | Line | Data |
---|---|---|
7321ac76 | 1 | # |
ea280a0f AF |
2 | %bcond_without python3 |
3 | %bcond_without python2 | |
7321ac76 AM |
4 | %define module lxml |
5 | # | |
6 | Summary: A Pythonic binding for the libxml2 and libxslt libraries | |
e1640e5a | 7 | Summary(pl.UTF-8): Pythonowe wiązanie do bibliotek libxml2 i libxslt |
7321ac76 | 8 | Name: python-%{module} |
c1d4e651 | 9 | Version: 2.2.6 |
ea280a0f | 10 | Release: 2 |
7321ac76 | 11 | License: BSD |
eb4ef173 | 12 | Group: Libraries/Python |
7321ac76 | 13 | Source0: http://codespeak.net/lxml/%{module}-%{version}.tgz |
c1d4e651 | 14 | # Source0-md5: b1f700fb22d7ee9b977ee3eceb65b20c |
ea280a0f | 15 | Patch0: python3.patch |
7321ac76 | 16 | URL: http://codespeak.net/lxml/ |
0f893bb9 AM |
17 | BuildRequires: libxml2-devel |
18 | BuildRequires: libxslt-devel | |
ea280a0f | 19 | %if %{with python2} |
0f893bb9 | 20 | BuildRequires: python-devel |
7217b13f | 21 | BuildRequires: python-modules |
ea280a0f AF |
22 | %endif |
23 | %if %{with python3} | |
24 | BuildRequires: python3-Cython | |
25 | BuildRequires: python3-devel | |
26 | BuildRequires: python3-modules | |
27 | %endif | |
7217b13f | 28 | BuildRequires: rpm-pythonprov |
7321ac76 | 29 | BuildRequires: rpmbuild(macros) >= 1.219 |
7321ac76 AM |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
34 | ||
8b26c81f JR |
35 | %description -l pl.UTF-8 |
36 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
459884ee | 37 | |
ea280a0f AF |
38 | %package -n python3-%{module} |
39 | Summary: A Pythonic binding for the libxml2 and libxslt libraries | |
40 | Summary(pl.UTF-8): Pythonowe wiązanie do bibliotek libxml2 i libxslt | |
41 | Version: %{version} | |
42 | Release: %{release} | |
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 | ||
7321ac76 AM |
51 | %prep |
52 | %setup -q -n %{module}-%{version} | |
ea280a0f | 53 | %patch0 -p1 |
7321ac76 AM |
54 | |
55 | %build | |
ea280a0f AF |
56 | %if %{with python2} |
57 | %{__python} setup.py build | |
58 | %endif | |
59 | %if %{with python3} | |
60 | %{__python3} setup.py build | |
61 | %endif | |
7321ac76 AM |
62 | |
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
7321ac76 | 65 | |
ea280a0f AF |
66 | %if %{with python2} |
67 | %{__python} setup.py \ | |
68 | install \ | |
7321ac76 AM |
69 | --root=$RPM_BUILD_ROOT \ |
70 | --optimize=2 | |
71 | ||
72 | %py_postclean | |
ea280a0f AF |
73 | %endif |
74 | ||
75 | %if %{with python3} | |
76 | %{__python3} setup.py \ | |
77 | install \ | |
78 | --root=$RPM_BUILD_ROOT \ | |
79 | --optimize=2 | |
80 | ||
81 | %py3_postclean | |
82 | %endif | |
7321ac76 AM |
83 | |
84 | %clean | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
ea280a0f | 87 | %if %{with python2} |
7321ac76 AM |
88 | %files |
89 | %defattr(644,root,root,755) | |
90 | %doc doc/* CHANGES.txt CREDITS.txt TODO.txt | |
0f893bb9 AM |
91 | %dir %{py_sitedir}/lxml |
92 | %{py_sitedir}/lxml/*.py[co] | |
75dd257f MB |
93 | %dir %{py_sitedir}/lxml/html |
94 | %{py_sitedir}/lxml/html/*.py[co] | |
95 | %attr(755,root,root) %{py_sitedir}/lxml/etree.so | |
96 | %attr(755,root,root) %{py_sitedir}/lxml/objectify.so | |
31980435 | 97 | %{py_sitedir}/lxml-*.egg-info |
ea280a0f AF |
98 | %endif |
99 | ||
100 | %if %{with python3} | |
101 | %files -n python3-%{module} | |
102 | %defattr(644,root,root,755) | |
103 | %doc doc/* CHANGES.txt CREDITS.txt TODO.txt | |
104 | %dir %{py3_sitedir}/lxml | |
105 | %{py3_sitedir}/lxml/*.py[co] | |
106 | %dir %{py3_sitedir}/lxml/html | |
107 | %{py3_sitedir}/lxml/html/*.py[co] | |
108 | %attr(755,root,root) %{py3_sitedir}/lxml/etree.so | |
109 | %attr(755,root,root) %{py3_sitedir}/lxml/objectify.so | |
110 | %{py3_sitedir}/lxml-*.egg-info | |
111 | %endif |