-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpython-lxml.spec
More file actions
122 lines (102 loc) · 3.37 KB
/
python-lxml.spec
File metadata and controls
122 lines (102 loc) · 3.37 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
#
# Conditional build:
%bcond_without apidocs # API documentation
%bcond_without tests # unit tests
%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}
# keep 5.0.x here for python2 support
Version: 5.0.2
Release: 2
License: BSD
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/lxml/
Source0: https://files.pythonhosted.org/packages/source/l/lxml/%{module}-%{version}.tar.gz
# Source0-md5: d6ad8a1b8a013f47e6614752a8164431
URL: https://lxml.de/
BuildRequires: libxml2-devel >= 1:2.9.2
BuildRequires: libxslt-devel >= 1.1.28
BuildRequires: pkgconfig
BuildRequires: python-Cython >= 3.0.9
BuildRequires: python-devel >= 1:2.7
BuildRequires: python-modules >= 1:2.7
BuildRequires: python-setuptools
BuildRequires: rpm-build >= 4.6
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.752
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
BuildArch: noarch
%description apidocs
lxml API documentation.
%description apidocs -l pl.UT8-8
Dokumentacja API modułu lxml.
%prep
%setup -q -n %{module}-%{version}
# force cython regeneration
%{__rm} src/lxml/{_elementpath.c,builder.c,etree.c,etree.h,etree_api.h,lxml.etree.h,lxml.etree_api.h,objectify.c,sax.c}
%build
%py_build
%if %{with tests}
install -d testdir-2/src/lxml
cd testdir-2/src/lxml
ln -snf ../../../build-2/lib.linux-*/lxml/* ../../../src/lxml/tests .
cd ../..
ln -snf ../doc ../samples ../test.py .
LC_ALL=C.UTF-8 \
%{__python} test.py -v
cd ..
%endif
%if %{with apidocs}
PYTHONPATH=$(echo $(pwd)/build-2/lib.linux-*) \
%{__python} doc/mkhtml.py doc/html $(pwd) %{version}
%endif
%install
rm -rf $RPM_BUILD_ROOT
%py_install
%py_postclean
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc CHANGES.txt CREDITS.txt LICENSE.txt LICENSES.txt README.rst TODO.txt doc/licenses/{BSD,elementtree}.txt
%dir %{py_sitedir}/lxml
%{py_sitedir}/lxml/*.pxi
%{py_sitedir}/lxml/*.py[co]
%{py_sitedir}/lxml/etree.pyx
%{py_sitedir}/lxml/objectify.pyx
%{py_sitedir}/lxml/etree*.h
%{py_sitedir}/lxml/lxml.etree*.h
%{py_sitedir}/lxml/includes
%{py_sitedir}/lxml/isoschematron
%attr(755,root,root) %{py_sitedir}/lxml/_elementpath.so
%attr(755,root,root) %{py_sitedir}/lxml/builder.so
%attr(755,root,root) %{py_sitedir}/lxml/etree.so
%attr(755,root,root) %{py_sitedir}/lxml/objectify.so
%attr(755,root,root) %{py_sitedir}/lxml/sax.so
%dir %{py_sitedir}/lxml/html
%{py_sitedir}/lxml/html/*.py[co]
%attr(755,root,root) %{py_sitedir}/lxml/html/clean.so
%attr(755,root,root) %{py_sitedir}/lxml/html/diff.so
%{py_sitedir}/lxml-%{version}-py*.egg-info
%if %{with apidocs}
%files apidocs
%defattr(644,root,root,755)
%doc doc/html/*
%endif