]>
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} |
00a871fa MK |
11 | Version: 2.3.1 |
12 | Release: 1 | |
7321ac76 | 13 | License: BSD |
eb4ef173 | 14 | Group: Libraries/Python |
7321ac76 | 15 | Source0: http://codespeak.net/lxml/%{module}-%{version}.tgz |
00a871fa | 16 | # Source0-md5: 87931fbf35df60cd71cfe7484b4b36ed |
7321ac76 | 17 | URL: http://codespeak.net/lxml/ |
0f893bb9 AM |
18 | BuildRequires: libxml2-devel |
19 | BuildRequires: libxslt-devel | |
ea280a0f | 20 | %if %{with python2} |
0f893bb9 | 21 | BuildRequires: python-devel |
7217b13f | 22 | BuildRequires: python-modules |
ea280a0f AF |
23 | %endif |
24 | %if %{with python3} | |
25 | BuildRequires: python3-Cython | |
26 | BuildRequires: python3-devel | |
27 | BuildRequires: python3-modules | |
28 | %endif | |
7217b13f | 29 | BuildRequires: rpm-pythonprov |
7321ac76 | 30 | BuildRequires: rpmbuild(macros) >= 1.219 |
7321ac76 AM |
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 | ||
9295daeb ER |
52 | %package apidocs |
53 | Summary: lxml API documentation | |
54 | Summary(pl.UTF-8): Dokumentacja API biblioteki lxml | |
55 | Group: Documentation | |
56 | ||
57 | %description apidocs | |
58 | API and internal documentation for lxml library. | |
59 | ||
7321ac76 AM |
60 | %prep |
61 | %setup -q -n %{module}-%{version} | |
62 | ||
63 | %build | |
ea280a0f AF |
64 | %if %{with python2} |
65 | %{__python} setup.py build | |
66 | %endif | |
67 | %if %{with python3} | |
68 | %{__python3} setup.py build | |
69 | %endif | |
7321ac76 AM |
70 | |
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
7321ac76 | 73 | |
ea280a0f AF |
74 | %if %{with python2} |
75 | %{__python} setup.py \ | |
76 | install \ | |
7321ac76 AM |
77 | --root=$RPM_BUILD_ROOT \ |
78 | --optimize=2 | |
79 | ||
80 | %py_postclean | |
ea280a0f AF |
81 | %endif |
82 | ||
83 | %if %{with python3} | |
84 | %{__python3} setup.py \ | |
85 | install \ | |
86 | --root=$RPM_BUILD_ROOT \ | |
87 | --optimize=2 | |
ea280a0f | 88 | %endif |
7321ac76 | 89 | |
9295daeb ER |
90 | # cleanup for packaging |
91 | rm -rf docs | |
92 | cp -a doc docs | |
93 | # apidocs packaged separately | |
94 | rm -rf docs/html | |
95 | # build docs not useful at runtime | |
96 | rm docs/build.txt | |
97 | # common licenses | |
98 | rm docs/licenses/{BSD,GPL}.txt | |
99 | ||
7321ac76 AM |
100 | %clean |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
ea280a0f | 103 | %if %{with python2} |
7321ac76 AM |
104 | %files |
105 | %defattr(644,root,root,755) | |
9295daeb | 106 | %doc docs/* CHANGES.txt CREDITS.txt TODO.txt |
0f893bb9 AM |
107 | %dir %{py_sitedir}/lxml |
108 | %{py_sitedir}/lxml/*.py[co] | |
ae91e877 | 109 | %{py_sitedir}/lxml/isoschematron |
75dd257f MB |
110 | %dir %{py_sitedir}/lxml/html |
111 | %{py_sitedir}/lxml/html/*.py[co] | |
112 | %attr(755,root,root) %{py_sitedir}/lxml/etree.so | |
113 | %attr(755,root,root) %{py_sitedir}/lxml/objectify.so | |
31980435 | 114 | %{py_sitedir}/lxml-*.egg-info |
ea280a0f AF |
115 | %endif |
116 | ||
117 | %if %{with python3} | |
118 | %files -n python3-%{module} | |
119 | %defattr(644,root,root,755) | |
9295daeb | 120 | %doc docs/* CHANGES.txt CREDITS.txt TODO.txt |
ea280a0f | 121 | %dir %{py3_sitedir}/lxml |
ae91e877 | 122 | %attr(755,root,root) %{py3_sitedir}/lxml/*.so |
ae91e877 | 123 | %{py3_sitedir}/lxml/*.py |
38e20aab | 124 | %{py3_sitedir}/lxml/__pycache__ |
ae91e877 | 125 | %{py3_sitedir}/lxml/isoschematron |
126 | %{py3_sitedir}/lxml/html | |
ea280a0f AF |
127 | %{py3_sitedir}/lxml-*.egg-info |
128 | %endif | |
9295daeb ER |
129 | |
130 | %if %{with apidocs} | |
131 | %files apidocs | |
132 | %defattr(644,root,root,755) | |
133 | %doc doc/html/* | |
134 | %endif |