]>
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 AM |
29 | BuildRequires: rpmbuild(macros) >= 1.219 |
30 | BuildRequires: unzip | |
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 | |
ea280a0f AF |
39 | %package -n python3-%{module} |
40 | Summary: A Pythonic binding for the libxml2 and libxslt libraries | |
41 | Summary(pl.UTF-8): Pythonowe wiązanie do bibliotek libxml2 i libxslt | |
42 | Version: %{version} | |
43 | Release: %{release} | |
44 | Group: Libraries/Python | |
45 | ||
46 | %description -n python3-%{module} | |
47 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
48 | ||
49 | %description -n python3-%{module} -l pl.UTF-8 | |
50 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
51 | ||
7321ac76 AM |
52 | %prep |
53 | %setup -q -n %{module}-%{version} | |
ea280a0f | 54 | %patch0 -p1 |
7321ac76 AM |
55 | |
56 | %build | |
ea280a0f AF |
57 | %if %{with python2} |
58 | %{__python} setup.py build | |
59 | %endif | |
60 | %if %{with python3} | |
61 | %{__python3} setup.py build | |
62 | %endif | |
7321ac76 AM |
63 | |
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
7321ac76 | 66 | |
ea280a0f AF |
67 | %if %{with python2} |
68 | %{__python} setup.py \ | |
69 | install \ | |
7321ac76 AM |
70 | --root=$RPM_BUILD_ROOT \ |
71 | --optimize=2 | |
72 | ||
73 | %py_postclean | |
ea280a0f AF |
74 | %endif |
75 | ||
76 | %if %{with python3} | |
77 | %{__python3} setup.py \ | |
78 | install \ | |
79 | --root=$RPM_BUILD_ROOT \ | |
80 | --optimize=2 | |
81 | ||
82 | %py3_postclean | |
83 | %endif | |
7321ac76 AM |
84 | |
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
ea280a0f | 88 | %if %{with python2} |
7321ac76 AM |
89 | %files |
90 | %defattr(644,root,root,755) | |
91 | %doc doc/* CHANGES.txt CREDITS.txt TODO.txt | |
0f893bb9 AM |
92 | %dir %{py_sitedir}/lxml |
93 | %{py_sitedir}/lxml/*.py[co] | |
75dd257f MB |
94 | %dir %{py_sitedir}/lxml/html |
95 | %{py_sitedir}/lxml/html/*.py[co] | |
96 | %attr(755,root,root) %{py_sitedir}/lxml/etree.so | |
97 | %attr(755,root,root) %{py_sitedir}/lxml/objectify.so | |
31980435 | 98 | %{py_sitedir}/lxml-*.egg-info |
ea280a0f AF |
99 | %endif |
100 | ||
101 | %if %{with python3} | |
102 | %files -n python3-%{module} | |
103 | %defattr(644,root,root,755) | |
104 | %doc doc/* CHANGES.txt CREDITS.txt TODO.txt | |
105 | %dir %{py3_sitedir}/lxml | |
106 | %{py3_sitedir}/lxml/*.py[co] | |
107 | %dir %{py3_sitedir}/lxml/html | |
108 | %{py3_sitedir}/lxml/html/*.py[co] | |
109 | %attr(755,root,root) %{py3_sitedir}/lxml/etree.so | |
110 | %attr(755,root,root) %{py3_sitedir}/lxml/objectify.so | |
111 | %{py3_sitedir}/lxml-*.egg-info | |
112 | %endif |