Adding libguestfs

This commit is contained in:
Gerardo J. Puerta
2020-01-15 18:07:31 +01:00
parent 31334171d5
commit fef65a64e7
20 changed files with 756 additions and 0 deletions

View File

@ -0,0 +1,10 @@
--- a/configure.ac 2014-01-24 19:04:05.633056872 +0100
+++ b/configure.ac 2014-01-24 19:04:34.685691757 +0100
@@ -24,6 +24,7 @@
AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
AC_CONFIG_AUX_DIR([build-aux])
+AM_GNU_GETTEXT_VERSION(0.18.3)
dnl Initialize automake. automake < 1.12 didn't have serial-tests and
dnl gives an error if it sees this, but for automake >= 1.13

View File

@ -0,0 +1,15 @@
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -482,6 +482,11 @@
DISTRO=UBUNTU
fi
fi
+
+if test -f /etc/gentoo-release; then
+ DISTRO=GENTOO
+fi
+
if test -f /etc/arch-release; then
DISTRO=ARCHLINUX
fi

View File

@ -0,0 +1,16 @@
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1487,8 +1487,10 @@
dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files
dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html
-LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
-AC_SUBST([LIBTOOL])
+dnl LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
+dnl AC_SUBST([LIBTOOL])
+LT_INIT
+
dnl Produce output files.
AC_CONFIG_HEADERS([config.h])

View File

@ -0,0 +1,21 @@
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1491,11 +1491,12 @@
])
# check for gtk-doc
-m4_ifdef([GTK_DOC_CHECK], [
- GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
-],[
- AM_CONDITIONAL([ENABLE_GTK_DOC], false)
-])
+#m4_ifdef([GTK_DOC_CHECK], [
+# GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+#],[
+# AM_CONDITIONAL([ENABLE_GTK_DOC], false)
+#])
+GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
dnl Library versioning.
MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`

View File

@ -0,0 +1,13 @@
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -88,9 +88,6 @@
if HAVE_HASKELL
SUBDIRS += haskell
endif
-if HAVE_PHP
-SUBDIRS += php
-endif
if HAVE_ERLANG
SUBDIRS += erlang erlang/examples
endif

View File

@ -0,0 +1,29 @@
From a5fd133e001bb62d13c47ebc392fbb696a513640 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <g.dartiguelongue@lexfo.fr>
Date: Wed, 30 Aug 2017 11:30:56 +0200
Subject: [PATCH 1/3] Update libtool initialization
Use the recommanded macro post libtool-2 release.
---
m4/guestfs_misc.m4 | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/m4/guestfs_misc.m4 b/m4/guestfs_misc.m4
index 5dce207d7..a2bb39c0d 100644
--- a/m4/guestfs_misc.m4
+++ b/m4/guestfs_misc.m4
@@ -17,10 +17,7 @@
dnl Miscellaneous configuration that doesn't fit anywhere else.
-dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files
-dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html
-LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
-AC_SUBST([LIBTOOL])
+LT_INIT
dnl Only build boot-analysis program on x86-64 and aarch64. It
dnl requires custom work to port to each architecture.
--
2.14.1

View File

@ -0,0 +1,25 @@
From 9c423cd2d24b6de924afc6e0d715594bb056288d Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <g.dartiguelongue@lexfo.fr>
Date: Wed, 30 Aug 2017 11:27:50 +0200
Subject: [PATCH 2/3] Add support for Gentoo in distribution detection
---
m4/guestfs_appliance.m4 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/m4/guestfs_appliance.m4 b/m4/guestfs_appliance.m4
index 890b1999c..9b79e1a41 100644
--- a/m4/guestfs_appliance.m4
+++ b/m4/guestfs_appliance.m4
@@ -114,6 +114,8 @@ elif test -f /etc/frugalware-release; then
DISTRO=FRUGALWARE
elif test -f /etc/mageia-release; then
DISTRO=MAGEIA
+elif test -f /etc/gentoo-release; then
+ DISTRO=GENTOO
else
dnl fallback option
DISTRO=REDHAT
--
2.14.1

View File

@ -0,0 +1,40 @@
From dc35ce2ba774a9284360bfd6532acb527a2f73d7 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Fri, 7 Dec 2018 11:21:25 +0100
Subject: [PATCH 3/4] Fix install failure when not built with OCaml support
Makefile rules in po/ require builder/index-parse.c to be generated to
allow translation utilities to work on it, however builder/ is
completely masked behind OCaml conditional build even if some tools do
not require it and proper guards are in place already.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1614502
---
Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 7eefacbeb..c0a68151f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -155,7 +155,6 @@ if HAVE_OCAML
SUBDIRS += \
mllib \
customize \
- builder builder/templates \
get-kernel \
resize \
sparsify \
@@ -169,6 +168,9 @@ SUBDIRS += dib
endif
endif
+# Tools mixed with more OCAML based tools
+SUBDIRS += builder builder/templates
+
# Perl tools.
if HAVE_TOOLS
SUBDIRS += tools
--
2.19.2

View File

@ -0,0 +1,42 @@
From 9bfa78095f6090c377fb40970653d1105a343cb7 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <g.dartiguelongue@lexfo.fr>
Date: Wed, 30 Aug 2017 11:33:58 +0200
Subject: [PATCH 3/3] Workaround autotools-utils detection of gtk-doc
---
configure.ac | 3 +++
m4/guestfs_gobject.m4 | 7 -------
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 268e6a182..65f4231bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,6 +121,9 @@ m4_include([m4/guestfs_lua.m4])
m4_include([m4/guestfs_golang.m4])
m4_include([m4/guestfs_gobject.m4])
+dnl check for gtk-doc
+GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+
dnl Bash completion.
m4_include([m4/guestfs_bash_completion.m4])
diff --git a/m4/guestfs_gobject.m4 b/m4/guestfs_gobject.m4
index 4b4eab80d..4304f7b00 100644
--- a/m4/guestfs_gobject.m4
+++ b/m4/guestfs_gobject.m4
@@ -59,10 +59,3 @@ m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
],[
AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
])
-
-# check for gtk-doc
-m4_ifdef([GTK_DOC_CHECK], [
- GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
-],[
- AM_CONDITIONAL([ENABLE_GTK_DOC], false)
-])
--
2.14.1

View File

@ -0,0 +1,45 @@
From 1f51b8ef921ad804022fc39b7465f9f731cbb6be Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Fri, 7 Dec 2018 12:14:15 +0100
Subject: [PATCH 4/5] Loosen build time requirement on bash-completion
Distributions might avoid pulling bash-completion during build as it is
an optional feature and would only make sense at runtime anyway. Since
this setting is well-known across a given distribution, allow them to
provide the value and avoid the dependency.
---
m4/guestfs_bash_completion.m4 | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/m4/guestfs_bash_completion.m4 b/m4/guestfs_bash_completion.m4
index 1f171b79d..9e877f6ab 100644
--- a/m4/guestfs_bash_completion.m4
+++ b/m4/guestfs_bash_completion.m4
@@ -16,14 +16,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
dnl Bash completion.
-PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
- bash_completion=yes
- AC_MSG_CHECKING([for bash-completions directory])
- BASH_COMPLETIONS_DIR="`pkg-config --variable=completionsdir bash-completion`"
- AC_MSG_RESULT([$BASH_COMPLETIONS_DIR])
- AC_SUBST([BASH_COMPLETIONS_DIR])
-],[
- bash_completion=no
- AC_MSG_WARN([bash-completion not installed])
-])
-AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"])
+AC_ARG_WITH([bashcompletiondir],
+ AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
+ [],
+ [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
+ with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
+ ] , [
+ with_bashcompletiondir=${datadir}/bash-completion/completions
+ ])])
+AC_SUBST([BASH_COMPLETIONS_DIR], [$with_bashcompletiondir])
+AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test -n "$with_bashcompletiondir"])
--
2.19.2

View File

@ -0,0 +1,40 @@
From 3b06e1cbb25615495ef108d6ee194bb718e46408 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Fri, 7 Dec 2018 11:21:25 +0100
Subject: [PATCH 1/2] Fix install failure when not built with OCaml support
Makefile rules in po/ require builder/index-parse.c to be generated to
allow translation utilities to work on it, however builder/ is
completely masked behind OCaml conditional build even if some tools do
not require it and proper guards are in place already.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1614502
---
Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index cc363341f..5d96093a1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -164,7 +164,6 @@ SUBDIRS += common/mlvisit
SUBDIRS += common/mlxml
SUBDIRS += common/mltools
SUBDIRS += customize
-SUBDIRS += builder builder/templates
SUBDIRS += get-kernel
SUBDIRS += resize
SUBDIRS += sparsify
@@ -178,6 +177,9 @@ SUBDIRS += dib
endif
endif
+# Tools mixed with more OCAML based tools
+SUBDIRS += builder builder/templates
+
# Perl tools.
if HAVE_TOOLS
SUBDIRS += tools
--
2.19.2

View File

@ -0,0 +1,45 @@
From b8a31fcfe81a680ffed1fa0879ac20a3e0e8753a Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Fri, 7 Dec 2018 12:14:15 +0100
Subject: [PATCH 2/2] Loosen build time requirement on bash-completion
Distributions might avoid pulling bash-completion during build as it is
an optional feature and would only make sense at runtime anyway. Since
this setting is well-known across a given distribution, allow them to
provide the value and avoid the dependency.
---
m4/guestfs-bash-completion.m4 | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/m4/guestfs-bash-completion.m4 b/m4/guestfs-bash-completion.m4
index 1975b8c03..9a38ab2d6 100644
--- a/m4/guestfs-bash-completion.m4
+++ b/m4/guestfs-bash-completion.m4
@@ -16,14 +16,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
dnl Bash completion.
-PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
- bash_completion=yes
- AC_MSG_CHECKING([for bash-completions directory])
- BASH_COMPLETIONS_DIR="`pkg-config --variable=completionsdir bash-completion`"
- AC_MSG_RESULT([$BASH_COMPLETIONS_DIR])
- AC_SUBST([BASH_COMPLETIONS_DIR])
-],[
- bash_completion=no
- AC_MSG_WARN([bash-completion not installed])
-])
-AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"])
+AC_ARG_WITH([bashcompletiondir],
+ AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
+ [],
+ [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
+ with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
+ ] , [
+ with_bashcompletiondir=${datadir}/bash-completion/completions
+ ])])
+AC_SUBST([BASH_COMPLETIONS_DIR], [$with_bashcompletiondir])
+AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test -n "$with_bashcompletiondir"])
--
2.19.2

View File

@ -0,0 +1,40 @@
From 3b06e1cbb25615495ef108d6ee194bb718e46408 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Fri, 7 Dec 2018 11:21:25 +0100
Subject: [PATCH 1/2] Fix install failure when not built with OCaml support
Makefile rules in po/ require builder/index-parse.c to be generated to
allow translation utilities to work on it, however builder/ is
completely masked behind OCaml conditional build even if some tools do
not require it and proper guards are in place already.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1614502
---
Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index cc363341f..5d96093a1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -164,7 +164,6 @@ SUBDIRS += common/mlvisit
SUBDIRS += common/mlxml
SUBDIRS += common/mltools
SUBDIRS += customize
-SUBDIRS += builder builder/templates
SUBDIRS += get-kernel
SUBDIRS += resize
SUBDIRS += sparsify
@@ -178,6 +177,9 @@ SUBDIRS += dib
endif
endif
+# Tools mixed with more OCAML based tools
+SUBDIRS += builder builder/templates
+
# Perl tools.
if HAVE_TOOLS
SUBDIRS += tools
--
2.19.2

View File

@ -0,0 +1,45 @@
From b8a31fcfe81a680ffed1fa0879ac20a3e0e8753a Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Fri, 7 Dec 2018 12:14:15 +0100
Subject: [PATCH 2/2] Loosen build time requirement on bash-completion
Distributions might avoid pulling bash-completion during build as it is
an optional feature and would only make sense at runtime anyway. Since
this setting is well-known across a given distribution, allow them to
provide the value and avoid the dependency.
---
m4/guestfs-bash-completion.m4 | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/m4/guestfs-bash-completion.m4 b/m4/guestfs-bash-completion.m4
index 1975b8c03..9a38ab2d6 100644
--- a/m4/guestfs-bash-completion.m4
+++ b/m4/guestfs-bash-completion.m4
@@ -16,14 +16,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
dnl Bash completion.
-PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
- bash_completion=yes
- AC_MSG_CHECKING([for bash-completions directory])
- BASH_COMPLETIONS_DIR="`pkg-config --variable=completionsdir bash-completion`"
- AC_MSG_RESULT([$BASH_COMPLETIONS_DIR])
- AC_SUBST([BASH_COMPLETIONS_DIR])
-],[
- bash_completion=no
- AC_MSG_WARN([bash-completion not installed])
-])
-AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"])
+AC_ARG_WITH([bashcompletiondir],
+ AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
+ [],
+ [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
+ with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
+ ] , [
+ with_bashcompletiondir=${datadir}/bash-completion/completions
+ ])])
+AC_SUBST([BASH_COMPLETIONS_DIR], [$with_bashcompletiondir])
+AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test -n "$with_bashcompletiondir"])
--
2.19.2