33a4c80df4dc3f023e7f7808b11df9b111fffd1a
[platform/upstream/libxml2.git] / packaging / python-libxml2.spec
1 Name:           python-libxml2
2 Version:        2.9.4
3 Release:        0
4 Summary:        Python Bindings for libxml2
5 License:        MIT
6 Group:          Development/Python
7 Url:            http://xmlsoft.org
8 Source:         ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
9 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
10 BuildRequires:  libxml2-devel
11 BuildRequires:  python-devel
12 BuildRequires:  python-xml
13 Requires:       libxml2 = %{version}
14 Obsoletes:      libxml2-python < %{version}
15 Provides:       libxml2-python = %{version}
16
17 %description
18 The libxml2-python package contains a module that permits applications
19 written in the Python programming language to use the interface
20 supplied by the libxml2 library to manipulate XML files.
21
22 This library allows manipulation of XML files. It includes support for
23 reading, modifying, and writing XML and HTML files. There is DTD
24 support that includes parsing and validation even with complex DTDs,
25 either at parse time or later once the document has been modified.
26
27 %prep
28 %setup -q -n libxml2-%{version}
29
30 %build
31 export CFLAGS="%{optflags} -fno-strict-aliasing"
32 %configure \
33     --with-fexceptions \
34     --with-history \
35     --enable-ipv6 \
36     --with-sax1 \
37     --with-regexps \
38     --with-threads \
39     --with-reader \
40     --with-http
41
42 # use libxml2 as built by libxml2 source package
43 mkdir .libs
44 cp -v %{_libdir}/libxml2.la .
45 make -C python %{?_smp_mflags}
46
47 %install
48 make -C python install \
49     DESTDIR=%{buildroot} \
50     pythondir=%{py_sitedir} \
51     PYTHON_SITE_PACKAGES=%{py_sitedir}
52 chmod a-x python/tests/*.py
53 # Unwanted doc stuff
54 rm -fr %{buildroot}%{_datadir}/doc
55 rm -f python/tests/Makefile*
56 # #223696
57 rm -f %{buildroot}%{py_sitedir}/*.{la,a}
58
59 %files
60 %defattr(-, root, root)
61 %doc python/libxml2class.txt
62 %doc python/tests
63 %{py_sitedir}/*
64
65 %changelog