summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Radej <tradej@redhat.com>2015-02-18 22:47:13 +0800
committerDaniel Veillard <veillard@redhat.com>2015-02-18 22:47:13 +0800
commitfb8e9e212fcad1b48638fb6fa27104e1d0c8853b (patch)
tree0a8d8115a415e6ed71d3ba9b72ae8484de8daa8f
parent3211973961d01b9c5efb5c5f3b8620a2a3c17561 (diff)
downloadlibxml2-fb8e9e212fcad1b48638fb6fa27104e1d0c8853b.tar.gz
Add Python 3 rpm subpackage
Allow compilation and packaging of both python2 and python3 when present
-rw-r--r--libxml.spec.in60
1 files changed, 54 insertions, 6 deletions
diff --git a/libxml.spec.in b/libxml.spec.in
index 242a4fee..9029a180 100644
--- a/libxml.spec.in
+++ b/libxml.spec.in
@@ -1,3 +1,5 @@
+%global with_python3 1
+
Summary: Library providing XML and HTML support
Name: libxml2
Version: @VERSION@
@@ -6,7 +8,13 @@ License: MIT
Group: Development/Libraries
Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
-BuildRequires: python python-devel zlib-devel pkgconfig xz-devel
+BuildRequires: python-devel
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+%endif # with_python3
+BuildRequires: zlib-devel
+BuildRequires: pkgconfig
+BuildRequires: xz-devel
URL: http://xmlsoft.org/
%description
@@ -55,8 +63,8 @@ Group: Development/Libraries
Requires: libxml2 = %{version}-%{release}
%description python
-The libxml2-python package contains a module that permits applications
-written in the Python programming language to use the interface
+The libxml2-python package contains a Python 2 module that permits applications
+written in the Python programming language, version 2, to use the interface
supplied by the libxml2 library to manipulate XML files.
This library allows to manipulate XML files. It includes support
@@ -64,6 +72,23 @@ to read, modify and write XML and HTML files. There is DTDs support
this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified.
+%if 0%{?with_python3}
+%package python3
+Summary: Python 3 bindings for the libxml2 library
+Group: Development/Libraries
+Requires: libxml2 = %{version}-%{release}
+
+%description python3
+The libxml2-python3 package contains a Python 3 module that permits
+applications written in the Python programming language, version 3, to use the
+interface supplied by the libxml2 library to manipulate XML files.
+
+This library allows to manipulate XML files. It includes support
+to read, modify and write XML and HTML files. There is DTDs support
+this includes parsing and validation even with complex DTDs, either
+at parse time or later once the document has been modified.
+%endif # with_python3
+
%prep
%setup -q
@@ -76,6 +101,13 @@ rm -fr %{buildroot}
make install DESTDIR=%{buildroot}
+%if 0%{?with_python3}
+make clean
+%configure --with-python=%{__python3}
+make install DESTDIR=%{buildroot}
+%endif # with_python3
+
+
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
@@ -136,14 +168,30 @@ rm -fr %{buildroot}
%files python
%defattr(-, root, root)
-%{_libdir}/python*/site-packages/libxml2.py*
-%{_libdir}/python*/site-packages/drv_libxml2.py*
-%{_libdir}/python*/site-packages/libxml2mod*
+%{_libdir}/python2*/site-packages/libxml2.py*
+%{_libdir}/python2*/site-packages/drv_libxml2.py*
+%{_libdir}/python2*/site-packages/libxml2mod*
+%doc python/TODO
+%doc python/libxml2class.txt
+%doc python/tests/*.py
+%doc doc/*.py
+%doc doc/python.html
+
+%if 0%{?with_python3}
+%files python3
+%defattr(-, root, root)
+
+%{_libdir}/python3*/site-packages/libxml2.py*
+%{_libdir}/python3*/site-packages/drv_libxml2.py*
+%{_libdir}/python3*/site-packages/__pycache__/libxml2.cpython-34.py*
+%{_libdir}/python3*/site-packages/__pycache__/drv_libxml2.cpython-34.py*
+%{_libdir}/python3*/site-packages/libxml2mod*
%doc python/TODO
%doc python/libxml2class.txt
%doc python/tests/*.py
%doc doc/*.py
%doc doc/python.html
+%endif # with_python3
%changelog
* @RELDATE@ Daniel Veillard <veillard@redhat.com>