Commit eb875ff1 authored by Klaus Aehlig's avatar Klaus Aehlig

Add the version-independent symbolic links

According to our new upgrade design, a couple of links are
version-independent, and should be installed always.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 838d26ef
...@@ -61,7 +61,10 @@ else ...@@ -61,7 +61,10 @@ else
DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR) DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
endif endif
versiondir = $(libdir)/ganeti/$(DIRVERSION) versiondir = $(libdir)/ganeti/$(DIRVERSION)
defaultversiondir = $(libdir)/ganeti/default
versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION) versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
defaultversionedsharedir = $(prefix)/share/ganeti/default
# Note: these are automake-specific variables, and must be named after # Note: these are automake-specific variables, and must be named after
# the directory + 'dir' suffix # the directory + 'dir' suffix
...@@ -94,16 +97,15 @@ pytoolsdir = $(pkgpythondir)/tools ...@@ -94,16 +97,15 @@ pytoolsdir = $(pkgpythondir)/tools
docdir = $(versiondir)$(datadir)/doc/$(PACKAGE) docdir = $(versiondir)$(datadir)/doc/$(PACKAGE)
SYMLINK_TARGET_DIRS = \ SYMLINK_TARGET_DIRS = \
$(pythondir) \ $(sysconfdir)/ganeti \
$(libdir)/ganeti/iallocators \ $(libdir)/ganeti/iallocators \
$(libdir)/ganeti/tools \
$(prefix)/share/ganeti \
$(exec_prefix)/bin \ $(exec_prefix)/bin \
$(exec_prefix)/sbin \ $(exec_prefix)/sbin \
$(datarootdir)/man/man1 \ $(datarootdir)/man/man1 \
$(datarootdir)/man/man7 \ $(datarootdir)/man/man7 \
$(datarootdir)/man/man8 $(datarootdir)/man/man8
SYMLINK_DIRS = \
$(pythondir)/ganeti \
$(libdir)/ganeti/tools
# Delete output file if an error occurred while building it # Delete output file if an error occurred while building it
.DELETE_ON_ERROR: .DELETE_ON_ERROR:
...@@ -899,7 +901,7 @@ gnt_scripts = \ ...@@ -899,7 +901,7 @@ gnt_scripts = \
scripts/gnt-storage scripts/gnt-storage
gnt_scripts_basenames = \ gnt_scripts_basenames = \
$(patsubst scripts/%,%,$(gnt_scripts)) $(patsubst scripts/%,%,$(patsubst daemons/%,%,$(gnt_scripts) $(gnt_python_sbin_SCRIPTS)))
gnt_python_sbin_SCRIPTS = \ gnt_python_sbin_SCRIPTS = \
$(PYTHON_BOOTSTRAP_SBIN) $(PYTHON_BOOTSTRAP_SBIN)
...@@ -1064,10 +1066,14 @@ dist_tools_SCRIPTS = \ ...@@ -1064,10 +1066,14 @@ dist_tools_SCRIPTS = \
nodist_tools_python_SCRIPTS = \ nodist_tools_python_SCRIPTS = \
tools/node-cleanup tools/node-cleanup
tools_python_basenames = $(patsubst tools/%,%,$(nodist_tools_python_SCRIPTS))
nodist_tools_SCRIPTS = \ nodist_tools_SCRIPTS = \
tools/users-setup \ tools/users-setup \
tools/vcluster-setup tools/vcluster-setup
tools_basenames = $(patsubst tools/%,%,$(nodist_tools_SCRIPTS) $(dist_tools_SCRIPTS))
pkglib_python_scripts = \ pkglib_python_scripts = \
daemons/import-export \ daemons/import-export \
tools/check-cert-expired tools/check-cert-expired
...@@ -1077,6 +1083,10 @@ nodist_pkglib_python_scripts = \ ...@@ -1077,6 +1083,10 @@ nodist_pkglib_python_scripts = \
tools/node-daemon-setup \ tools/node-daemon-setup \
tools/prepare-node-join tools/prepare-node-join
pkglib_python_basenames = \
$(patsubst daemons/%,%,$(patsubst tools/%,%,\
$(pkglib_python_scripts) $(nodist_pkglib_python_scripts)))
myexeclib_SCRIPTS = \ myexeclib_SCRIPTS = \
daemons/daemon-util \ daemons/daemon-util \
tools/kvm-ifup \ tools/kvm-ifup \
...@@ -1084,10 +1094,9 @@ myexeclib_SCRIPTS = \ ...@@ -1084,10 +1094,9 @@ myexeclib_SCRIPTS = \
tools/net-common \ tools/net-common \
$(HS_MYEXECLIB_PROGS) $(HS_MYEXECLIB_PROGS)
# strip path prefixes off the lib python scripts # compute the basenames of the myexeclib_scripts
all_myexeclib_scripts = \ myexeclib_scripts_basenames = \
$(patsubst tools/%,%,$(patsubst daemons/%,%,\ $(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst src/%,%,$(myexeclib_SCRIPTS))))
$(patsubst src/%,%,$(myexeclib_SCRIPTS) $(nodist_myexeclib_SCRIPTS))))
EXTRA_DIST = \ EXTRA_DIST = \
NEWS \ NEWS \
...@@ -2276,28 +2285,39 @@ install-exec-local: ...@@ -2276,28 +2285,39 @@ install-exec-local:
@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \ @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
"$(DESTDIR)${localstatedir}/log/ganeti" \ "$(DESTDIR)${localstatedir}/log/ganeti" \
"$(DESTDIR)${localstatedir}/run/ganeti" "$(DESTDIR)${localstatedir}/run/ganeti"
if INSTALL_SYMLINKS
for dir in $(SYMLINK_TARGET_DIRS); do \ for dir in $(SYMLINK_TARGET_DIRS); do \
@mkdir_p@ $(DESTDIR)$$dir; \ @mkdir_p@ $(DESTDIR)$$dir; \
done done
$(LN_S) -f $(sysconfdir)/ganeti/lib $(DESTDIR)$(defaultversiondir)
$(LN_S) -f $(sysconfdir)/ganeti/share $(DESTDIR)$(defaultversionedsharedir)
for prog in $(HS_BIN_ROLES); do \ for prog in $(HS_BIN_ROLES); do \
$(LN_S) $(bindir)/$$prog $(DESTDIR)$(exec_prefix)/bin/$$prog; \ $(LN_S) -f $(defaultversiondir)$(exec_prefix)/bin/$$prog $(DESTDIR)$(exec_prefix)/bin/$$prog; \
done done
$(LN_S) $(bindir)/htools $(DESTDIR)$(libdir)/ganeti/iallocators/hail $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/iallocators/hail $(DESTDIR)$(libdir)/ganeti/iallocators/hail
for prog in $(all_sbin_scripts); do \ for prog in $(all_sbin_scripts); do \
$(LN_S) $(sbindir)/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \ $(LN_S) -f $(defaultversiondir)$(exec_prefix)/sbin/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \
done done
for link in $(SYMLINK_DIRS); do \ for prog in $(gnt_scripts_basenames); do \
$(LN_S) $(versiondir)$$link $(DESTDIR)$$link; \ $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(exec_prefix)/sbin/$$prog; \
done done
for prog in $(all_myexeclib_scripts); do \ for prog in $(pkglib_python_basenames); do \
$(LN_S) $(pkglibdir)/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \ $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
done
for prog in $(tools_python_basenames); do \
$(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
done
for prog in $(tools_basenames); do \
$(LN_S) -f $(defaultversiondir)/$(libdir)/ganeti/tools/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
done done
if ! test -n '$(ENABLE_MANPAGES)'; then \ if ! test -n '$(ENABLE_MANPAGES)'; then \
for man in $(manfullpath); do \ for man in $(manfullpath); do \
$(LN_S) $(versiondir)$(datarootdir)/man/$$man $(DESTDIR)$(datarootdir)/man/$$man; \ $(LN_S) -f $(defaultversionedsharedir)$(datarootdir)/man/$$man $(DESTDIR)$(datarootdir)/man/$$man; \
done; \ done; \
fi fi
for prog in $(myexeclib_scripts_basenames); do \
$(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
done
if INSTALL_SYMLINKS
endif endif
.PHONY: apidoc .PHONY: apidoc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment