forked from pld-linux/python-lxml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-lxml.spec
More file actions
142 lines (122 loc) · 3.48 KB
/
python-lxml.spec
File metadata and controls
142 lines (122 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#
# Conditional build:
%bcond_without apidocs # do not build and package API docs
%bcond_without python2 # Python 2 package
%bcond_without python3 # Python 3 package
%define module lxml
Summary: Python 2 binding for the libxml2 and libxslt libraries
Summary(pl.UTF-8): Wiązanie Pythona 2 do bibliotek libxml2 i libxslt
Name: python-%{module}
Version: 3.2.4
Release: 2
License: BSD
Group: Libraries/Python
Source0: http://lxml.de/files/%{module}-%{version}.tgz
# Source0-md5: cc363499060f615aca1ec8dcc04df331
Patch0: %{name}-add-handle_failures-option-to-make_links_absolute-to.patch
URL: http://lxml.de/
BuildRequires: libxml2-devel >= 1:2.7.8
BuildRequires: libxslt-devel >= 1.1.26
%if %{with python2}
BuildRequires: python-devel >= 1:2.4
BuildRequires: python-modules
%endif
%if %{with python3}
BuildRequires: python3-Cython > 0.17
BuildRequires: python3-devel
BuildRequires: python3-modules
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.219
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
lxml is a Pythonic binding for the libxml2 and libxslt libraries.
%description -l pl.UTF-8
lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt.
%package -n python3-%{module}
Summary: Python 3 binding for the libxml2 and libxslt libraries
Summary(pl.UTF-8): Wiązanie Pythona 3 do bibliotek libxml2 i libxslt
Group: Libraries/Python
%description -n python3-%{module}
lxml is a Pythonic binding for the libxml2 and libxslt libraries.
%description -n python3-%{module} -l pl.UTF-8
lxml to pythonowe wiązanie do bibliotek libxml2 i libxslt.
%package apidocs
Summary: lxml API documentation
Summary(pl.UTF-8): Dokumentacja API modułu lxml
Group: Documentation
%description apidocs
lxml API documentation.
%description apidocs -l pl.UT8-8
Dokumentacja API modułu lxml.
%prep
%setup -q -n %{module}-%{version}
%patch0 -p1
%build
%if %{with python2}
%{__python} setup.py build
%endif
%if %{with python3}
%{__python3} setup.py build
%endif
%install
rm -rf $RPM_BUILD_ROOT
%if %{with python2}
%{__python} setup.py \
install \
--root=$RPM_BUILD_ROOT \
--optimize=2
%py_postclean
%endif
%if %{with python3}
%{__python3} setup.py \
install \
--root=$RPM_BUILD_ROOT \
--optimize=2
%endif
# cleanup for packaging
rm -rf docs
cp -a doc docs
# apidocs packaged separately
rm -rf docs/html
# build docs not useful at runtime
rm docs/build.txt
# common licenses
rm docs/licenses/{BSD,GPL}.txt
%clean
rm -rf $RPM_BUILD_ROOT
%if %{with python2}
%files
%defattr(644,root,root,755)
%doc docs/* CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt
%dir %{py_sitedir}/lxml
%{py_sitedir}/lxml/*.py[co]
%{py_sitedir}/lxml/lxml.etree*.h
%{py_sitedir}/lxml/includes
%{py_sitedir}/lxml/isoschematron
%dir %{py_sitedir}/lxml/html
%{py_sitedir}/lxml/html/*.py[co]
%attr(755,root,root) %{py_sitedir}/lxml/etree.so
%attr(755,root,root) %{py_sitedir}/lxml/objectify.so
%{py_sitedir}/lxml-*.egg-info
%endif
%if %{with python3}
%files -n python3-%{module}
%defattr(644,root,root,755)
%doc docs/* CHANGES.txt CREDITS.txt LICENSES.txt README.rst TODO.txt
%dir %{py3_sitedir}/lxml
%attr(755,root,root) %{py3_sitedir}/lxml/etree.cpython-*.so
%attr(755,root,root) %{py3_sitedir}/lxml/objectify.cpython-*.so
%{py3_sitedir}/lxml/*.py
%{py3_sitedir}/lxml/__pycache__
%{py3_sitedir}/lxml/lxml.etree*.h
%{py3_sitedir}/lxml/includes
%{py3_sitedir}/lxml/isoschematron
%{py3_sitedir}/lxml/html
%{py3_sitedir}/lxml-*.egg-info
%endif
%if %{with apidocs}
%files apidocs
%defattr(644,root,root,755)
%doc doc/html/*
%endif