[fedora-virt-maint] [libguestfs/el5/master] Backport missed patch which fixes build on old Python 2.4 in RHEL 5.

Richard W.M. Jones rjones at fedoraproject.org
Tue Aug 17 17:58:31 UTC 2010


commit b1594902707ff95bbcb8e4b12e2c42cf4501b50d
Author: Richard Jones <rjones at redhat.com>
Date:   Tue Aug 17 18:57:31 2010 +0100

    Backport missed patch which fixes build on old Python 2.4 in RHEL 5.

 ...uestfs-1.2.11-build-workaround-python-2.4.patch |   29 ++++++++++++++++++++
 libguestfs.spec                                    |   10 +++++-
 2 files changed, 37 insertions(+), 2 deletions(-)
---
diff --git a/libguestfs-1.2.11-build-workaround-python-2.4.patch b/libguestfs-1.2.11-build-workaround-python-2.4.patch
new file mode 100644
index 0000000..8d34f42
--- /dev/null
+++ b/libguestfs-1.2.11-build-workaround-python-2.4.patch
@@ -0,0 +1,29 @@
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Fri, 21 May 2010 17:20:28 +0000 (+0100)
+Subject: Build workaround for Python 2.4.x in RHEL 5.
+X-Git-Tag: 1.3.14~4
+X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=012b1c71f4eda3ae779da51d7d81c199d90f667d
+
+Build workaround for Python 2.4.x in RHEL 5.
+
+See:
+http://www.python.org/dev/peps/pep-0353/#conversion-guidelines
+---
+
+diff --git a/src/generator.ml b/src/generator.ml
+index d2da8ec..1212a5a 100755
+--- a/src/generator.ml
++++ b/src/generator.ml
+@@ -9113,6 +9113,12 @@ and generate_python_c () =
+ #define PY_SSIZE_T_CLEAN 1
+ #include <Python.h>
+ 
++#if PY_VERSION_HEX < 0x02050000
++typedef int Py_ssize_t;
++#define PY_SSIZE_T_MAX INT_MAX
++#define PY_SSIZE_T_MIN INT_MIN
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <assert.h>
diff --git a/libguestfs.spec b/libguestfs.spec
index c5902d7..ce3c041 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -42,7 +42,7 @@ Summary:       Access and modify virtual machine disk images
 Name:          libguestfs
 Epoch:         1
 Version:       1.2.11
-Release:       1%{?dist}
+Release:       1.1%{?dist}
 License:       LGPLv2+
 Group:         Development/Libraries
 URL:           http://libguestfs.org/
@@ -64,6 +64,10 @@ Patch1:        libguestfs-1.2.9-aug-clear-full.patch
 Patch2:        libguestfs-1.2.7-link_local_addresses.patch
 Patch3:        libguestfs-1.2.7-use_old_slirp_syntax.patch
 
+# Backport of a patch which was missed from libguestfs 1.2 branch
+# so far.  This fixes build for old Python 2.4 in RHEL 5.
+Patch4:        libguestfs-1.2.11-build-workaround-python-2.4.patch
+
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
 BuildRequires: /usr/bin/pod2text
@@ -403,6 +407,7 @@ Requires:      jpackage-utils
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 mkdir -p daemon/m4
 
@@ -698,8 +703,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
-* Tue Aug 17 2010 Richard W.M. Jones <rjones at redhat.com> - 1:1.2.11-1
+* Tue Aug 17 2010 Richard W.M. Jones <rjones at redhat.com> - 1:1.2.11-1.1
 - New stable branch version 1.2.11.
+- Backport missed patch which fixes build on old Python 2.4 in RHEL 5.
 
 * Tue Jul 20 2010 Richard W.M. Jones <rjones at redhat.com> - 1:1.2.10-1.1
 - Requires binutils (RHBZ#616437).


More information about the virt-maint mailing list