Create the symlinks only at install time, directly in the installation
directory. The installation of non-symlink completion files is
unchanged.
---
bash/Makefile.am | 46 +++++++++++++++++-----------------------------
1 file changed, 17 insertions(+), 29 deletions(-)
diff --git a/bash/Makefile.am b/bash/Makefile.am
index 2da6726..7251e11 100644
--- a/bash/Makefile.am
+++ b/bash/Makefile.am
@@ -21,7 +21,10 @@ scripts = \
guestfish \
guestmount \
virt-alignment-scan \
- virt-builder \
+ virt-rescue \
+ virt-resize
+
+links_to_virt_alignment_scan = \
virt-cat \
virt-df \
virt-edit \
@@ -30,40 +33,16 @@ scripts = \
virt-inspector \
virt-log \
virt-ls \
- virt-rescue \
- virt-resize \
- virt-sparsify \
virt-sysprep
+links_to_virt_resize = \
+ virt-builder \
+ virt-sparsify
+
EXTRA_DIST = \
README \
$(scripts)
-# Some of the scripts are simply symbolic links.
-virt-cat:
- ln -sf virt-alignment-scan $@
-virt-df:
- ln -sf virt-alignment-scan $@
-virt-edit:
- ln -sf virt-alignment-scan $@
-virt-filesystems:
- ln -sf virt-alignment-scan $@
-virt-format:
- ln -sf virt-alignment-scan $@
-virt-inspector:
- ln -sf virt-alignment-scan $@
-virt-log:
- ln -sf virt-alignment-scan $@
-virt-ls:
- ln -sf virt-alignment-scan $@
-virt-sysprep:
- ln -sf virt-alignment-scan $@
-
-virt-builder:
- ln -sf virt-resize $@
-virt-sparsify:
- ln -sf virt-resize $@
-
if HAVE_BASH_COMPLETION
# Bash completion script.
@@ -71,4 +50,13 @@ if HAVE_BASH_COMPLETION
bashcompletiondir = $(BASH_COMPLETIONS_DIR)
bashcompletion_DATA = $(scripts)
+install-data-local:
+ $(mkdir_p) $(DESTDIR)$(bashcompletiondir)
+ for l in $(links_to_virt_alignment_scan); do \
+ $(LN_S) virt-alignment-scan $(DESTDIR)$(bashcompletiondir)/$$l; \
+ done
+ for l in $(links_to_virt_resize); do \
+ $(LN_S) virt-resize $(DESTDIR)$(bashcompletiondir)/$$l; \
+ done
+
endif
--
1.9.3