./configure expands @datadir@ and @libdir@ to "${prefix}/share" and
"${exec_prefix}/lib" by default (verbatim); $prefix and $exec_prefix are
supposed to be substituted by the shell when the generated shell scripts
are executed.
For this, capture the prefix and exec_prefix values at the time
./configure runs.
This fixes failures such as
$ virt-p2v-make-kickstart fedora
base64: /share/virt-p2v/issue: No such file or directory
for such scripts that were installed with "make install".
Note that the patch does not help when running virt-p2v-make-* from a git
checkout that was just built, such as
$ ./virt-p2v-make-kickstart fedora
In that case, VIRT_P2V_DATA_DIR still needs to be set to $PWD, as there is
no "share" subdirectory in the checkout.
Suggested-by: Richard W.M. Jones <rjones(a)redhat.com>
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
virt-p2v-make-disk.in | 2 ++
virt-p2v-make-kickstart.in | 2 ++
virt-p2v-make-kiwi.in | 2 ++
3 files changed, 6 insertions(+)
diff --git a/virt-p2v-make-disk.in b/virt-p2v-make-disk.in
index ac477eb39be8..218ff1531872 100644
--- a/virt-p2v-make-disk.in
+++ b/virt-p2v-make-disk.in
@@ -20,6 +20,8 @@ unset CDPATH
program="virt-p2v-make-disk"
version="@PACKAGE_VERSION@"
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
if [ -n "$VIRT_P2V_DATA_DIR" ]; then
datadir="$VIRT_P2V_DATA_DIR"
diff --git a/virt-p2v-make-kickstart.in b/virt-p2v-make-kickstart.in
index d139c9bb554b..1706102d05c7 100644
--- a/virt-p2v-make-kickstart.in
+++ b/virt-p2v-make-kickstart.in
@@ -20,6 +20,8 @@ unset CDPATH
program="virt-p2v-make-kickstart"
version="@PACKAGE_VERSION@"
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
# Parse the command line arguments.
shortopts=o:vV
diff --git a/virt-p2v-make-kiwi.in b/virt-p2v-make-kiwi.in
index 987de11b54aa..a648f6a3886c 100644
--- a/virt-p2v-make-kiwi.in
+++ b/virt-p2v-make-kiwi.in
@@ -20,6 +20,8 @@ unset CDPATH
program="virt-p2v-make-kiwi"
version="@PACKAGE_VERSION@"
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
# Parse the command line arguments.
shortopts=o:V
--
2.19.1.3.g30247aa5d201