Accepting request 575411 from Virtualization

- update to version 1.38.0:
  * Virt-builder-repository is a new tool allowing end users to
    create and update virt-builder repositories. (fate#318952)
  * Virt-rescue has been substantially rewritten, implementing job
    control, -m and -i options, escape keys, etc.
  * Virt-builder planner has been improved so that faster and more
    efficient build plans are chosen for complex cases, especially when
    either the tmpdir or output is on networked storage.
  * Virt-customize now sets a random /etc/machine-id for Linux guests, if
    one is not already set.
  * Virt-df now works correctly on filesystems with block sizes smaller
    than 1K.
  * Virt-dib has further compatibility enhancements with diskimage-builder.
  * Virt-sysprep removes "DHCP_HOSTNAME" from ifcfg-* files.
  * Virt-resize now correctly copies GPT partition attributes from the
    source to the destination. (bsc#1074585)
  * Bash tab completion implemented or enhanced for: virt-win-reg,
    virt-v2v-copy-to-local.
  * Both virt-v2v and virt-p2v are now able to pass through the source CPU
    vendor, model and topology.
  * Virt-v2v now supports encrypted guests.
  * Virt-v2v now detects the special Linux Xen PV-only kernels correctly
  * Virt-v2v -o glance now generates the right properties for UEFI guests
  * Virt-v2v -o null now avoids spooling the guest to a temporary file,
    instead it writes to the qemu "null block device".  This makes it
    faster and use almost no disk space.
  * Virt-v2v -i libvirtxml can now open network disks over http or https.
  * Virt-v2v will now give a warning about host passthrough devices
  * Inspection support was rewritten in OCaml and included inside the
    daemon.  This makes inspection considerably faster, more robust and

OBS-URL: https://build.opensuse.org/request/show/575411
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libguestfs?expand=0&rev=59
This commit is contained in:
Dominique Leuenberger 2018-02-12 09:15:50 +00:00 committed by Git OBS Bridge
commit 141d554312
10 changed files with 114 additions and 425 deletions

View File

@ -1,103 +0,0 @@
From 531316cc3f25db22d94310334dc8b61596dc263f Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Mon, 25 Sep 2017 14:29:47 +0200
Subject: [PATCH] build: improve and simplify distro detection
Add a --with-distro=ID argument for configure, so it is possible to
manually specify the distro to use for the packages (in case os-release
does not provide ID=.., or the ID is not recognized yet).
In the case when --with-distro is not set, keep doing the autodetection,
but using os-release only, i.e. dropping the checks for all the other
-release files -- since there is --with-distro, older distros with no
os-release can still be used.
RWMJ: Add documentation to guestfs-building(1).
---
docs/guestfs-building.pod | 14 ++++++++++++++
m4/guestfs_appliance.m4 | 44 +++++++++++++++++++-------------------------
2 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
index ecc27f9d6..187da37be 100644
--- a/docs/guestfs-building.pod
+++ b/docs/guestfs-building.pod
@@ -648,6 +648,20 @@ Note that despite this setting, all backends are built into
libguestfs, and you can override the backend at runtime by setting the
C<$LIBGUESTFS_BACKEND> environment variable (or using API methods).
+=item B<--with-distro=REDHAT|DEBIAN|...>
+
+Libguestfs needs to know which Linux distro is in use so it can choose
+package names for the appliance correctly (see for example
+F<appliance/packagelist.in>). It normally does this automatically.
+
+However if you can building or packaging libguestfs on a new distro
+then you can use I<--with-distro> to specify that the distro is
+similar to an existing one (eg. I<--with-distro=REDHAT> if the distro
+is a new Red Hat or CentOS derivative).
+
+Note that if your distro is completely new then it may still require
+upstream modifications.
+
=item B<--with-extra=">I<distroname>=I<version>,libvirt,...B<">
=item B<--with-extra="local">
diff --git a/m4/guestfs_appliance.m4 b/m4/guestfs_appliance.m4
index fbba3373f..4993f57a1 100644
--- a/m4/guestfs_appliance.m4
+++ b/m4/guestfs_appliance.m4
@@ -94,31 +94,25 @@ dnl names vary slightly across distros. (See
dnl appliance/packagelist.in, appliance/excludefiles.in,
dnl appliance/hostfiles.in)
AC_MSG_CHECKING([which Linux distro for package names])
-if test -f /etc/os-release; then
- ( . /etc/os-release && echo $ID | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@' ) >&AS_MESSAGE_LOG_FD
- DISTRO="`. /etc/os-release && echo $ID | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@'`"
- AS_CASE([$DISTRO],
- [FEDORA | RHEL | CENTOS],[DISTRO=REDHAT],
- [OPENSUSE | SLED | SLES],[DISTRO=SUSE],
- [ARCH],[DISTRO=ARCHLINUX])
-elif test -f /etc/debian_version; then
- DISTRO=DEBIAN
- if grep -q 'DISTRIB_ID=Ubuntu' /etc/lsb-release 2>&AS_MESSAGE_LOG_FD; then
- DISTRO=UBUNTU
- fi
-elif test -f /etc/arch-release; then
- DISTRO=ARCHLINUX
-elif test -f /etc/SuSE-release; then
- DISTRO=SUSE
-elif test -f /etc/frugalware-release; then
- DISTRO=FRUGALWARE
-elif test -f /etc/mageia-release; then
- DISTRO=MAGEIA
-else
-dnl fallback option
- DISTRO=REDHAT
-fi
-AC_MSG_RESULT([$DISTRO])
+AC_ARG_WITH([distro],
+ [AS_HELP_STRING([--with-distro="DISTRO_ID"],
+ [distro ID @<:@default=ID in /etc/os-release@:>@])],[
+ DISTRO="$withval"
+ AC_MSG_RESULT([$DISTRO (manually specified)])
+ ],[
+ if test -f /etc/os-release; then
+ ( . /etc/os-release && echo $ID | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@' ) >&AS_MESSAGE_LOG_FD
+ DISTRO="`. /etc/os-release && echo $ID | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@'`"
+ AS_CASE([$DISTRO],
+ [FEDORA | RHEL | CENTOS],[DISTRO=REDHAT],
+ [OPENSUSE | SLED | SLES],[DISTRO=SUSE],
+ [ARCH],[DISTRO=ARCHLINUX])
+ AC_MSG_RESULT([$DISTRO (from /etc/os-release)])
+ else
+ AC_MSG_ERROR([/etc/os-release not available, please specify the distro using --with-distro=DISTRO])
+ fi
+ ]
+)
AC_SUBST([DISTRO])
dnl Add extra packages to the appliance.
--
2.13.2

View File

@ -1,261 +0,0 @@
From 9d25b4e56471f9c33ea6229a8b620fc800c240f8 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 9 May 2017 15:12:40 +0200
Subject: [PATCH] python: add simple wrappers for PyObject<->string functions
The current need for #ifdef's based on the presence of
PyString_FromString makes both the OCaml code of the generator, and the
generated C code a mess to read.
Hence, add three simple wrappers to make both the OCaml, and C code more
readable, and easier to tweak in the future.
This should be just refactoring, with no actual behaviour changes.
Thanks to: Matteo Cafasso
---
generator/python.ml | 72 ++++++++++++-----------------------------------------
python/handle.c | 65 ++++++++++++++++++++++++++---------------------
2 files changed, 53 insertions(+), 84 deletions(-)
diff --git a/generator/python.ml b/generator/python.ml
index 0162733f9..cf0829489 100644
--- a/generator/python.ml
+++ b/generator/python.ml
@@ -91,6 +91,9 @@ extern PyObject *guestfs_int_py_event_to_string (PyObject *self, PyObject *args)
extern char **guestfs_int_py_get_string_list (PyObject *obj);
extern PyObject *guestfs_int_py_put_string_list (char * const * const argv);
extern PyObject *guestfs_int_py_put_table (char * const * const argv);
+extern PyObject *guestfs_int_py_fromstring (const char *str);
+extern PyObject *guestfs_int_py_fromstringsize (const char *str, size_t size);
+extern char *guestfs_int_py_asstring (PyObject *obj);
";
@@ -178,31 +181,16 @@ and generate_python_structs () =
function
| name, FString ->
pr " PyDict_SetItemString (dict, \"%s\",\n" name;
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " PyString_FromString (%s->%s));\n"
- typ name;
- pr "#else\n";
- pr " PyUnicode_FromString (%s->%s));\n"
- typ name;
- pr "#endif\n"
+ pr " guestfs_int_py_fromstring (%s->%s));\n"
+ typ name
| name, FBuffer ->
pr " PyDict_SetItemString (dict, \"%s\",\n" name;
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " PyString_FromStringAndSize (%s->%s, %s->%s_len));\n"
- typ name typ name;
- pr "#else\n";
- pr " PyBytes_FromStringAndSize (%s->%s, %s->%s_len));\n"
- typ name typ name;
- pr "#endif\n"
+ pr " guestfs_int_py_fromstringsize (%s->%s, %s->%s_len));\n"
+ typ name typ name
| name, FUUID ->
pr " PyDict_SetItemString (dict, \"%s\",\n" name;
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " PyString_FromStringAndSize (%s->%s, 32));\n"
- typ name;
- pr "#else\n";
- pr " PyBytes_FromStringAndSize (%s->%s, 32));\n"
- typ name;
- pr "#endif\n"
+ pr " guestfs_int_py_fromstringsize (%s->%s, 32));\n"
+ typ name
| name, (FBytes|FUInt64) ->
pr " PyDict_SetItemString (dict, \"%s\",\n" name;
pr " PyLong_FromUnsignedLongLong (%s->%s));\n"
@@ -229,15 +217,9 @@ and generate_python_structs () =
pr " PyDict_SetItemString (dict, \"%s\", Py_None);\n" name;
pr " }\n"
| name, FChar ->
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " PyDict_SetItemString (dict, \"%s\",\n" name;
- pr " PyString_FromStringAndSize (&%s->%s, 1));\n"
- typ name;
- pr "#else\n";
pr " PyDict_SetItemString (dict, \"%s\",\n" name;
- pr " PyUnicode_FromStringAndSize (&%s->%s, 1));\n"
- typ name;
- pr "#endif\n"
+ pr " guestfs_int_py_fromstringsize (&%s->%s, 1));\n"
+ typ name
) cols;
pr " return dict;\n";
pr "};\n";
@@ -419,13 +401,7 @@ and generate_python_actions actions () =
pr " optargs_s.%s = PyLong_AsLongLong (py_%s);\n" n n;
pr " if (PyErr_Occurred ()) goto out;\n"
| OString _ ->
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " optargs_s.%s = PyString_AsString (py_%s);\n" n n;
- pr "#else\n";
- pr " PyObject *bytes;\n";
- pr " bytes = PyUnicode_AsUTF8String (py_%s);\n" n;
- pr " optargs_s.%s = PyBytes_AS_STRING (bytes);\n" n;
- pr "#endif\n";
+ pr " optargs_s.%s = guestfs_int_py_asstring (py_%s);\n" n n
| OStringList _ ->
pr " optargs_s.%s = guestfs_int_py_get_string_list (py_%s);\n" n n;
pr " if (!optargs_s.%s) goto out;\n" n;
@@ -480,30 +456,18 @@ and generate_python_actions actions () =
| RBool _ -> pr " py_r = PyLong_FromLong ((long) r);\n"
| RInt64 _ -> pr " py_r = PyLong_FromLongLong (r);\n"
| RConstString _ ->
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " py_r = PyString_FromString (r);\n";
- pr "#else\n";
- pr " py_r = PyUnicode_FromString (r);\n";
- pr "#endif\n";
+ pr " py_r = guestfs_int_py_fromstring (r);\n";
pr " if (py_r == NULL) goto out;\n";
| RConstOptString _ ->
pr " if (r) {\n";
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " py_r = PyString_FromString (r);\n";
- pr "#else\n";
- pr " py_r = PyUnicode_FromString (r);\n";
- pr "#endif\n";
+ pr " py_r = guestfs_int_py_fromstring (r);\n";
pr " } else {\n";
pr " Py_INCREF (Py_None);\n";
pr " py_r = Py_None;\n";
pr " }\n";
pr " if (py_r == NULL) goto out;\n";
| RString _ ->
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " py_r = PyString_FromString (r);\n";
- pr "#else\n";
- pr " py_r = PyUnicode_FromString (r);\n";
- pr "#endif\n";
+ pr " py_r = guestfs_int_py_fromstring (r);\n";
pr " free (r);\n";
pr " if (py_r == NULL) goto out;\n";
| RStringList _ ->
@@ -519,11 +483,7 @@ and generate_python_actions actions () =
pr " py_r = guestfs_int_py_put_table (r);\n";
pr " guestfs_int_free_string_list (r);\n"
| RBufferOut _ ->
- pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
- pr " py_r = PyString_FromStringAndSize (r, size);\n";
- pr "#else\n";
- pr " py_r = PyBytes_FromStringAndSize (r, size);\n";
- pr "#endif\n";
+ pr " py_r = guestfs_int_py_fromstringsize (r, size);\n";
pr " free (r);\n";
pr " if (py_r == NULL) goto out;\n";
);
diff --git a/python/handle.c b/python/handle.c
index 806408f91..f347c00d1 100644
--- a/python/handle.c
+++ b/python/handle.c
@@ -241,11 +241,7 @@ guestfs_int_py_event_to_string (PyObject *self, PyObject *args)
return NULL;
}
-#ifdef HAVE_PYSTRING_ASSTRING
- py_r = PyString_FromString (str);
-#else
- py_r = PyUnicode_FromString (str);
-#endif
+ py_r = guestfs_int_py_fromstring (str);
free (str);
return py_r;
@@ -298,9 +294,6 @@ guestfs_int_py_get_string_list (PyObject *obj)
{
size_t i, len;
char **r;
-#ifndef HAVE_PYSTRING_ASSTRING
- PyObject *bytes;
-#endif
assert (obj);
@@ -321,14 +314,8 @@ guestfs_int_py_get_string_list (PyObject *obj)
return NULL;
}
- for (i = 0; i < len; ++i) {
-#ifdef HAVE_PYSTRING_ASSTRING
- r[i] = PyString_AsString (PyList_GetItem (obj, i));
-#else
- bytes = PyUnicode_AsUTF8String (PyList_GetItem (obj, i));
- r[i] = PyBytes_AS_STRING (bytes);
-#endif
- }
+ for (i = 0; i < len; ++i)
+ r[i] = guestfs_int_py_asstring (PyList_GetItem (obj, i));
r[len] = NULL;
return r;
@@ -345,11 +332,7 @@ guestfs_int_py_put_string_list (char * const * const argv)
list = PyList_New (argc);
for (i = 0; i < argc; ++i) {
-#ifdef HAVE_PYSTRING_ASSTRING
- PyList_SetItem (list, i, PyString_FromString (argv[i]));
-#else
- PyList_SetItem (list, i, PyUnicode_FromString (argv[i]));
-#endif
+ PyList_SetItem (list, i, guestfs_int_py_fromstring (argv[i]));
}
return list;
@@ -367,15 +350,41 @@ guestfs_int_py_put_table (char * const * const argv)
list = PyList_New (argc >> 1);
for (i = 0; i < argc; i += 2) {
item = PyTuple_New (2);
-#ifdef HAVE_PYSTRING_ASSTRING
- PyTuple_SetItem (item, 0, PyString_FromString (argv[i]));
- PyTuple_SetItem (item, 1, PyString_FromString (argv[i+1]));
-#else
- PyTuple_SetItem (item, 0, PyUnicode_FromString (argv[i]));
- PyTuple_SetItem (item, 1, PyUnicode_FromString (argv[i+1]));
-#endif
+ PyTuple_SetItem (item, 0, guestfs_int_py_fromstring (argv[i]));
+ PyTuple_SetItem (item, 1, guestfs_int_py_fromstring (argv[i+1]));
PyList_SetItem (list, i >> 1, item);
}
return list;
}
+
+PyObject *
+guestfs_int_py_fromstring (const char *str)
+{
+#ifdef HAVE_PYSTRING_ASSTRING
+ return PyString_FromString (str);
+#else
+ return PyUnicode_FromString (str);
+#endif
+}
+
+PyObject *
+guestfs_int_py_fromstringsize (const char *str, size_t size)
+{
+#ifdef HAVE_PYSTRING_ASSTRING
+ return PyString_FromStringAndSize (str, size);
+#else
+ return PyString_FromStringAndSize (str, size);
+#endif
+}
+
+char *
+guestfs_int_py_asstring (PyObject *obj)
+{
+#ifdef HAVE_PYSTRING_ASSTRING
+ return PyString_AsString (obj);
+#else
+ PyObject *bytes = PyUnicode_AsUTF8String (obj);
+ return PyBytes_AS_STRING (bytes);
+#endif
+}
--
2.13.2

View File

@ -1,15 +1,14 @@
Index: libguestfs-1.36.5/appliance/init Index: libguestfs-1.38.0/appliance/init
=================================================================== ===================================================================
--- libguestfs-1.36.5.orig/appliance/init --- libguestfs-1.38.0.orig/appliance/init
+++ libguestfs-1.36.5/appliance/init +++ libguestfs-1.38.0/appliance/init
@@ -206,7 +206,9 @@ else @@ -234,7 +234,8 @@ else
echo echo "Note: The contents of / (root) are the rescue appliance."
echo "Note: The contents of / are the rescue appliance." if ! test -d "/sysroot/dev"; then
echo "You have to mount the guest's partitions under /sysroot" echo "You have to mount the guests partitions under /sysroot"
- echo "before you can examine them." - echo "before you can examine them."
+ echo "before you can examine them. A helper script for that exists:" + echo "before you can examine them. A helper script for that exists:"
+ echo "mount-rootfs-and-chroot.sh /dev/sda2" + echo "mount-rootfs-and-chroot.sh /dev/sda2"
+ else
echo echo "Use 'cd /sysroot' or 'chroot /sysroot' to see guest filesystems."
run_bash_with_ctty fi
echo

View File

@ -0,0 +1,30 @@
From d0e5a819e8b16b38c22cb7309e88bf49a6fdcc4a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 9 Feb 2018 15:55:38 +0000
Subject: [PATCH] python: Fix missing & additional backslashes which broke
python sdist.
Fixes commit e6c89f96316c3eda6049d0c3ed4de4cda6f4f973.
---
python/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/Makefile.am b/python/Makefile.am
index 5d2716e20..ef500d65d 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -101,9 +101,9 @@ stamp-extra-files: \
cleanups.h \
config.h \
guestfs-internal-all.h \
- guestfs-utils.h
+ guestfs-utils.h \
ignore-value.h \
- utils.c \
+ utils.c
touch $@
config.h:
--
2.15.1

View File

@ -1,29 +0,0 @@
From f3f99a09eadb17bd80d5939ea00499da5ee1408e Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 9 May 2017 17:47:32 +0200
Subject: [PATCH] python: use right func when PyString_FromStringAndSize is not
there
Fixes commit 9d25b4e56471f9c33ea6229a8b620fc800c240f8.
Thanks to: Matteo Cafasso
---
python/handle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/handle.c b/python/handle.c
index f347c00d1..88024e184 100644
--- a/python/handle.c
+++ b/python/handle.c
@@ -374,7 +374,7 @@ guestfs_int_py_fromstringsize (const char *str, size_t size)
#ifdef HAVE_PYSTRING_ASSTRING
return PyString_FromStringAndSize (str, size);
#else
- return PyString_FromStringAndSize (str, size);
+ return PyUnicode_FromStringAndSize (str, size);
#endif
}
--
2.13.2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c2f7c10c42de04567a9b5cfd8345a995fb951ded9a7fbe72fae061d66dfe8f98
size 23012703

3
libguestfs-1.38.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a31a1ab256ca3565569e31d7576e487b8d67a130b89e042a7faff4d154bcea31
size 23898136

View File

@ -1,3 +1,48 @@
-------------------------------------------------------------------
Fri Feb 9 19:39:31 UTC 2018 - cbosdonnat@suse.com
- update to version 1.38.0:
* Virt-builder-repository is a new tool allowing end users to
create and update virt-builder repositories. (fate#318952)
* Virt-rescue has been substantially rewritten, implementing job
control, -m and -i options, escape keys, etc.
* Virt-builder planner has been improved so that faster and more
efficient build plans are chosen for complex cases, especially when
either the tmpdir or output is on networked storage.
* Virt-customize now sets a random /etc/machine-id for Linux guests, if
one is not already set.
* Virt-df now works correctly on filesystems with block sizes smaller
than 1K.
* Virt-dib has further compatibility enhancements with diskimage-builder.
* Virt-sysprep removes "DHCP_HOSTNAME" from ifcfg-* files.
* Virt-resize now correctly copies GPT partition attributes from the
source to the destination. (bsc#1074585)
* Bash tab completion implemented or enhanced for: virt-win-reg,
virt-v2v-copy-to-local.
* Both virt-v2v and virt-p2v are now able to pass through the source CPU
vendor, model and topology.
* Virt-v2v now supports encrypted guests.
* Virt-v2v now detects the special Linux Xen PV-only kernels correctly
* Virt-v2v -o glance now generates the right properties for UEFI guests
* Virt-v2v -o null now avoids spooling the guest to a temporary file,
instead it writes to the qemu "null block device". This makes it
faster and use almost no disk space.
* Virt-v2v -i libvirtxml can now open network disks over http or https.
* Virt-v2v will now give a warning about host passthrough devices
* Inspection support was rewritten in OCaml and included inside the
daemon. This makes inspection considerably faster, more robust and
more easily extensible in future.
* The libguestfs API is now thread-safe (although not parallel). You can
call APIs on the same handle from multiple threads without needing to
take a lock.
- Removed patches:
531316cc-build-improve-and-simplify-distro-detection.patch
9d25b4e5-python-add-simple-wrappers-for-PyObject-string-funct.patch
f3f99a09-python-use-right-func-when-PyString_FromStringAndSiz.patch
- Added patches:
d0e5a819-python-Fix-missing-additional-backslashes.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Dec 4 17:18:57 UTC 2017 - cbosdonnat@suse.com Mon Dec 4 17:18:57 UTC 2017 - cbosdonnat@suse.com

View File

@ -2,3 +2,4 @@ addFilter("shlib-policy-nonversioned-dir")
addFilter("shlib-policy-missing-lib") addFilter("shlib-policy-missing-lib")
# This script is supposed to be run from within the appliance only # This script is supposed to be run from within the appliance only
addFilter("non-executable-script /usr/share/virt-p2v/launch-virt-p2v") addFilter("non-executable-script /usr/share/virt-p2v/launch-virt-p2v")
addFilter("non-standard-group Development/Languages")

View File

@ -1,7 +1,7 @@
# #
# spec file for package libguestfs # spec file for package libguestfs
# #
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2011 Michal Hrusecky <mhrusecky@novell.com> # Copyright (c) 2011 Michal Hrusecky <mhrusecky@novell.com>
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
@ -18,7 +18,7 @@
# needsbinariesforbuild # needsbinariesforbuild
Version: 1.36.5 Version: 1.38.0
Release: 0 Release: 0
%{ocaml_preserve_bytecode} %{ocaml_preserve_bytecode}
@ -33,7 +33,7 @@ Release: 0
%bcond_without ruby_bindings %bcond_without ruby_bindings
%bcond_without p2v %bcond_with p2v
%bcond_without bash_completion %bcond_without bash_completion
# The following defines are overridden in the individual subpackages # The following defines are overridden in the individual subpackages
@ -91,7 +91,7 @@ BuildRequires: libacl-devel
BuildRequires: libcap-devel BuildRequires: libcap-devel
BuildRequires: libconfig-devel BuildRequires: libconfig-devel
BuildRequires: libtool BuildRequires: libtool
BuildRequires: libvirt-devel >= 0.10.2 BuildRequires: libvirt-devel >= 1.2.20
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
%if %{with perl_bindings} %if %{with perl_bindings}
@ -109,8 +109,12 @@ BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(yajl) >= 2.0.4 BuildRequires: pkgconfig(yajl) >= 2.0.4
# Required to build tools, its independent from bindings # Required to build tools, its independent from bindings
BuildRequires: glib2-devel BuildRequires: glib2-devel
BuildRequires: ocaml BuildRequires: ocaml >= 4.01
BuildRequires: ocaml-findlib BuildRequires: ocaml-findlib
BuildRequires: ocaml-gettext-devel
BuildRequires: ocaml-gettext-stub-devel
BuildRequires: ocaml-hivex-devel
BuildRequires: ocaml-libvirt-devel
# #
BuildRequires: ocaml-rpm-macros >= 4.03 BuildRequires: ocaml-rpm-macros >= 4.03
@ -138,14 +142,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: Compatibility package for guestfs-tools Summary: Compatibility package for guestfs-tools
License: GPL-2.0 License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
# PATCH-FIX-UPSTREAM - python3 fixes Patch0: d0e5a819-python-Fix-missing-additional-backslashes.patch
Patch1: 9d25b4e5-python-add-simple-wrappers-for-PyObject-string-funct.patch
Patch2: f3f99a09-python-use-right-func-when-PyString_FromStringAndSiz.patch
# PATCH-FIX-UPSTREAM - add configure --with-distro parameter
Patch3: 531316cc-build-improve-and-simplify-distro-detection.patch
Patch100: appliance.patch Patch100: appliance.patch
Source0: http://download.libguestfs.org/1.36-stable/libguestfs-%{version}.tar.gz Source0: http://download.libguestfs.org/1.38-stable/libguestfs-%{version}.tar.gz
Source1: libguestfs.rpmlintrc Source1: libguestfs.rpmlintrc
Source100: mount-rootfs-and-chroot.sh Source100: mount-rootfs-and-chroot.sh
Source101: README Source101: README
@ -302,6 +302,7 @@ Group: Development/Languages/Python
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: python BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
%define _configure_python --enable-python %define _configure_python --enable-python
# #
@ -316,6 +317,8 @@ Allows Python 2 scripts to directly use libguestfs.
Summary: Python 3 bindings for libguestfs Summary: Python 3 bindings for libguestfs
License: GPL-2.0 License: GPL-2.0
Group: Development/Languages/Python Group: Development/Languages/Python
BuildRequires: python3
BuildRequires: python3-devel
%define _configure_python --enable-python %define _configure_python --enable-python
# #
Obsoletes: libguestfs-python < %{version} Obsoletes: libguestfs-python < %{version}
@ -542,9 +545,7 @@ It can import a variety of guest operating systems from libvirt-managed hosts.
%prep %prep
: _ignore_exclusive_arch '%{?_ignore_exclusive_arch}' : _ignore_exclusive_arch '%{?_ignore_exclusive_arch}'
%setup -q -a 789653 %setup -q -a 789653
%patch1 -p1 %patch0 -p1
%patch2 -p1
%patch3 -p1
%patch100 -p1 %patch100 -p1
%build %build
@ -653,6 +654,9 @@ sed 's/\(#define HAVE_PYSTRING_ASSTRING 1\)/\/* \1 *\//' -i config.h
popd popd
%endif %endif
# Don't package the test harness (yet)
rm -rf %{buildroot}/%{_libdir}/ocaml/v2v_test_harness
# #
find %{buildroot}/ -name "*.la" -print -delete find %{buildroot}/ -name "*.la" -print -delete
rm -fv %{buildroot}/%{_libdir}/*.a rm -fv %{buildroot}/%{_libdir}/*.a
@ -797,7 +801,6 @@ rm %{buildroot}/%{_datadir}/virt-p2v/p2v.ks.in
%{_includedir}/guestfs.h %{_includedir}/guestfs.h
%{_includedir}/guestfs-gobject %{_includedir}/guestfs-gobject
%{_includedir}/guestfs-gobject.h %{_includedir}/guestfs-gobject.h
%{_datadir}/gtk-doc/html/guestfs
%{_mandir}/man3/* %{_mandir}/man3/*
%files -n guestfsd %files -n guestfsd
@ -812,7 +815,9 @@ rm %{buildroot}/%{_datadir}/virt-p2v/p2v.ks.in
%{_sbindir}/libguestfs-make-fixed-appliance %{_sbindir}/libguestfs-make-fixed-appliance
%{_bindir}/* %{_bindir}/*
%exclude %{_bindir}/virt-v2v %exclude %{_bindir}/virt-v2v
%if %{with p2v}
%exclude %{_bindir}/virt-p2v-* %exclude %{_bindir}/virt-p2v-*
%endif
%config(noreplace) /etc/libguestfs-tools.conf %config(noreplace) /etc/libguestfs-tools.conf
/etc/virt-builder /etc/virt-builder
%dir /etc/xdg/virt-builder %dir /etc/xdg/virt-builder
@ -824,7 +829,9 @@ rm %{buildroot}/%{_datadir}/virt-p2v/p2v.ks.in
%endif %endif
%{_mandir}/man1/* %{_mandir}/man1/*
%exclude %{_mandir}/man1/virt-v2v.* %exclude %{_mandir}/man1/virt-v2v.*
%if %{with p2v}
%exclude %{_mandir}/man1/virt-p2v* %exclude %{_mandir}/man1/virt-p2v*
%endif
%{_mandir}/man5/* %{_mandir}/man5/*
%files -n virt-v2v %files -n virt-v2v