]>
Commit | Line | Data |
---|---|---|
7321ac76 | 1 | # |
9295daeb ER |
2 | # Conditional build: |
3 | %bcond_without apidocs # do not build and package API docs | |
4 | %bcond_without python3 # Python 3 package | |
5 | %bcond_without python2 # Python 2 package | |
6 | ||
7321ac76 | 7 | %define module lxml |
7321ac76 | 8 | Summary: A Pythonic binding for the libxml2 and libxslt libraries |
e1640e5a | 9 | Summary(pl.UTF-8): Pythonowe wiązanie do bibliotek libxml2 i libxslt |
7321ac76 | 10 | Name: python-%{module} |
d91419be CM |
11 | Version: 2.2.8 |
12 | Release: 1 | |
7321ac76 | 13 | License: BSD |
eb4ef173 | 14 | Group: Libraries/Python |
7321ac76 | 15 | Source0: http://codespeak.net/lxml/%{module}-%{version}.tgz |
d91419be | 16 | # Source0-md5: d6c612d63a84d79440912a1b29d3b981 |
ea280a0f | 17 | Patch0: python3.patch |
7321ac76 | 18 | URL: http://codespeak.net/lxml/ |
0f893bb9 AM |
19 | BuildRequires: libxml2-devel |
20 | BuildRequires: libxslt-devel | |
ea280a0f | 21 | %if %{with python2} |
0f893bb9 | 22 | BuildRequires: python-devel |
7217b13f | 23 | BuildRequires: python-modules |
ea280a0f AF |
24 | %endif |
25 | %if %{with python3} | |
26 | BuildRequires: python3-Cython | |
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 | |
ea280a0f AF |
40 | %package -n python3-%{module} |
41 | Summary: A Pythonic binding for the libxml2 and libxslt libraries | |
42 | Summary(pl.UTF-8): Pythonowe wiązanie do bibliotek libxml2 i libxslt | |
43 | Version: %{version} | |
44 | Release: %{release} | |
45 | Group: Libraries/Python | |
46 | ||
47 | %description -n python3-%{module} | |
48 | lxml is a Pythonic binding for the libxml2 and libxslt libraries. | |
49 | ||
50 | %description -n python3-%{module} -l pl.UTF-8 | |
51 | lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt. | |
52 | ||
9295daeb ER |
53 | %package apidocs |
54 | Summary: lxml API documentation | |
55 | Summary(pl.UTF-8): Dokumentacja API biblioteki lxml | |
56 | Group: Documentation | |
57 | ||
58 | %description apidocs | |
59 | API and internal documentation for lxml library. | |
60 | ||
7321ac76 AM |
61 | %prep |
62 | %setup -q -n %{module}-%{version} | |
ea280a0f | 63 | %patch0 -p1 |
7321ac76 AM |
64 | |
65 | %build | |
ea280a0f AF |
66 | %if %{with python2} |
67 | %{__python} setup.py build | |
68 | %endif | |
69 | %if %{with python3} | |
70 | %{__python3} setup.py build | |
71 | %endif | |
7321ac76 AM |
72 | |
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
7321ac76 | 75 | |
ea280a0f AF |
76 | %if %{with python2} |
77 | %{__python} setup.py \ | |
78 | install \ | |
7321ac76 AM |
79 | --root=$RPM_BUILD_ROOT \ |
80 | --optimize=2 | |
81 | ||
82 | %py_postclean | |
ea280a0f AF |
83 | %endif |
84 | ||
85 | %if %{with python3} | |
86 | %{__python3} setup.py \ | |
87 | install \ | |
88 | --root=$RPM_BUILD_ROOT \ | |
89 | --optimize=2 | |
90 | ||
91 | %py3_postclean | |
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) | |
9295daeb | 110 | %doc docs/* CHANGES.txt CREDITS.txt TODO.txt |
0f893bb9 AM |
111 | %dir %{py_sitedir}/lxml |
112 | %{py_sitedir}/lxml/*.py[co] | |
75dd257f MB |
113 | %dir %{py_sitedir}/lxml/html |
114 | %{py_sitedir}/lxml/html/*.py[co] | |
115 | %attr(755,root,root) %{py_sitedir}/lxml/etree.so | |
116 | %attr(755,root,root) %{py_sitedir}/lxml/objectify.so | |
31980435 | 117 | %{py_sitedir}/lxml-*.egg-info |
ea280a0f AF |
118 | %endif |
119 | ||
120 | %if %{with python3} | |
121 | %files -n python3-%{module} | |
122 | %defattr(644,root,root,755) | |
9295daeb | 123 | %doc docs/* CHANGES.txt CREDITS.txt TODO.txt |
ea280a0f AF |
124 | %dir %{py3_sitedir}/lxml |
125 | %{py3_sitedir}/lxml/*.py[co] | |
126 | %dir %{py3_sitedir}/lxml/html | |
127 | %{py3_sitedir}/lxml/html/*.py[co] | |
128 | %attr(755,root,root) %{py3_sitedir}/lxml/etree.so | |
129 | %attr(755,root,root) %{py3_sitedir}/lxml/objectify.so | |
130 | %{py3_sitedir}/lxml-*.egg-info | |
131 | %endif | |
9295daeb ER |
132 | |
133 | %if %{with apidocs} | |
134 | %files apidocs | |
135 | %defattr(644,root,root,755) | |
136 | %doc doc/html/* | |
137 | %endif |