]>
Commit | Line | Data |
---|---|---|
1 | # | |
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 | ||
7 | %define module lxml | |
8 | Summary: A Pythonic binding for the libxml2 and libxslt libraries | |
9 | Summary(pl.UTF-8): Pythonowe wiązanie do bibliotek libxml2 i libxslt | |
10 | Name: python-%{module} | |
11 | Version: 2.2.7 | |
12 | Release: 2 | |
13 | License: BSD | |
14 | Group: Libraries/Python | |
15 | Source0: http://codespeak.net/lxml/%{module}-%{version}.tgz | |
16 | # Source0-md5: c1da56b823fdc00804938d2b788dbfd0 | |
17 | Patch0: python3.patch | |
18 | URL: http://codespeak.net/lxml/ | |
19 | BuildRequires: libxml2-devel | |
20 | BuildRequires: libxslt-devel | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-modules | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-Cython | |
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: 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 | ||
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 | ||
61 | %prep | |
62 | %setup -q -n %{module}-%{version} | |
63 | %patch0 -p1 | |
64 | ||
65 | %build | |
66 | %if %{with python2} | |
67 | %{__python} setup.py build | |
68 | %endif | |
69 | %if %{with python3} | |
70 | %{__python3} setup.py build | |
71 | %endif | |
72 | ||
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
76 | %if %{with python2} | |
77 | %{__python} setup.py \ | |
78 | install \ | |
79 | --root=$RPM_BUILD_ROOT \ | |
80 | --optimize=2 | |
81 | ||
82 | %py_postclean | |
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 | |
93 | ||
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 | ||
104 | %clean | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %files | |
109 | %defattr(644,root,root,755) | |
110 | %doc docs/* CHANGES.txt CREDITS.txt TODO.txt | |
111 | %dir %{py_sitedir}/lxml | |
112 | %{py_sitedir}/lxml/*.py[co] | |
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 | |
117 | %{py_sitedir}/lxml-*.egg-info | |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %files -n python3-%{module} | |
122 | %defattr(644,root,root,755) | |
123 | %doc docs/* CHANGES.txt CREDITS.txt TODO.txt | |
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 | |
132 | ||
133 | %if %{with apidocs} | |
134 | %files apidocs | |
135 | %defattr(644,root,root,755) | |
136 | %doc doc/html/* | |
137 | %endif |