[commit text mostly pinched from INSTALL] An alternative global installation method making it much easier to uninstall is to use a package-specific prefix like /opt/git, then create symlinks from /usr/local into that hierarchy. Uninstalling can then be achieved by # rm -rf /opt/git; find /usr/local -xtype l -delete You can create a setup like that after having used one of the above install recipes with prefix=/opt/git by writing # make prefix=/opt/git symlinkprefix=/usr/local install-symlinks This works by copying the directory hierarchy of $prefix to $symlinkprefix (not copying or descending to any directories of the name git* matched case-insensitively), then linking all the rest. Signed-off-by: David Kastrup <dak@xxxxxxx> --- INSTALL | 12 ++++++++++++ Makefile | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletions(-) diff --git a/INSTALL b/INSTALL index 79e71b6..22df145 100644 --- a/INSTALL +++ b/INSTALL @@ -21,6 +21,18 @@ set up install paths (via config.mak.autogen), so you can write instead $ make all doc ;# as yourself # make install install-doc ;# as root +An alternative global installation method making it much easier to +uninstall is to use a package-specific prefix like /opt/git, then +create symlinks from /usr/local into that hierarchy. Uninstalling can +then be achieved by + + # rm -rf /opt/git; find /usr/local -xtype l -delete + +You can create a setup like that after having used one of the above +install recipes with prefix=/opt/git by writing + + # make prefix=/opt/git symlinkprefix=/usr/local install-symlinks + Issues of note: diff --git a/Makefile b/Makefile index 73b487f..87b317f 100644 --- a/Makefile +++ b/Makefile @@ -142,6 +142,7 @@ ALL_LDFLAGS = $(LDFLAGS) STRIP ?= strip prefix = $(HOME) +symlinkprefix = /usr/local bindir = $(prefix)/bin gitexecdir = $(bindir) sharedir = $(prefix)/share @@ -692,6 +693,7 @@ bindir_SQ = $(subst ','\'',$(bindir)) gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) template_dir_SQ = $(subst ','\'',$(template_dir)) prefix_SQ = $(subst ','\'',$(prefix)) +symlinkprefix_SQ = $(subst ','\'',$(symlinkprefix)) SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) @@ -996,7 +998,13 @@ install-doc: quick-install-doc: $(MAKE) -C Documentation quick-install - +# The somewhat strange looking lines start with an ignored $(MAKE) in +# order to be executed also in make -n calls. +install-symlinks: + @: $(MAKE) && echo cd '$(prefix_SQ)' && cd '$(prefix_SQ)' && find . -type d ! \( -iname 'git*' -prune \) -exec echo $(INSTALL) -m 755 -d '$(symlinkprefix_SQ)/{}' \; + @cd '$(prefix_SQ)' && find . -type d ! \( -iname 'git*' -prune \) -exec $(INSTALL) -m 755 -d '$(symlinkprefix_SQ)/{}' \; + @: $(MAKE) && echo cd '$(prefix_SQ)' && cd '$(prefix_SQ)' && find . \( -type d -iname 'git*' -prune -o ! -type d \) -exec echo $(RM) -r '$(symlinkprefix_SQ)/{}' \; -exec echo ln -s '$(prefix_SQ)/{}' '$(symlinkprefix_SQ)/{}' \; + @cd '$(prefix_SQ)' && find . \( -type d -iname 'git*' -prune -o ! -type d \) -exec $(RM) -r '$(symlinkprefix_SQ)/{}' \; -exec ln -s '$(prefix_SQ)/{}' '$(symlinkprefix_SQ)/{}' \; ### Maintainer's dist rules -- 1.5.3.rc2.84.g6497 - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html