a64ccff6ce200798cf3418c75aff0336740e973a
[platform/upstream/libxml2.git] / packaging / python-libxml2.spec
1 Name:           python-libxml2
2 Version:        2.9.2
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 touch configure.ac aclocal.m4 configure Makefile.am Makefile.in
33 %configure \
34     --with-fexceptions \
35     --with-history \
36     --enable-ipv6 \
37     --with-sax1 \
38     --with-regexps \
39     --with-threads \
40     --with-reader \
41     --with-http
42
43 # use libxml2 as built by libxml2 source package
44 mkdir .libs
45 cp -v %{_libdir}/libxml2.la .
46 make -C python %{?_smp_mflags}
47
48 %install
49 make -C python install \
50     DESTDIR=%{buildroot} \
51     pythondir=%{py_sitedir} \
52     PYTHON_SITE_PACKAGES=%{py_sitedir}
53 chmod a-x python/tests/*.py
54 # Unwanted doc stuff
55 rm -fr %{buildroot}%{_datadir}/doc
56 rm -f python/tests/Makefile*
57 # #223696
58 rm -f %{buildroot}%{py_sitedir}/*.{la,a}
59
60 %files
61 %defattr(-, root, root)
62 %doc python/libxml2class.txt
63 %doc python/tests
64 %{py_sitedir}/*
65
66 %changelog