From: David Kastrup <dak@gnu.org>
To: git@vger.kernel.org
Subject: [PATCH] Makefile: create an install-symlinks target
Date: Sun, 29 Jul 2007 23:26:08 +0200 [thread overview]
Message-ID: <85lkcyvr4f.fsf@lola.goethe.zz> (raw)
[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@gnu.org>
---
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
next reply other threads:[~2007-07-29 21:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-29 21:26 David Kastrup [this message]
2007-07-29 21:27 ` [PATCH] Makefile: use $(FIND) instead of find David Kastrup
2007-07-29 22:22 ` Junio C Hamano
2007-07-29 22:15 ` [PATCH] Makefile: create an install-symlinks target Junio C Hamano
2007-07-29 22:30 ` David Kastrup
2007-07-29 23:44 ` Brian Gernhardt
2007-07-29 22:26 ` Peter Baumann
-- strict thread matches above, loose matches on Subject: below --
2007-07-18 10:41 David Kastrup
2007-07-18 12:41 ` David Kastrup
2007-07-18 12:48 ` Johannes Schindelin
2007-07-18 14:33 ` Peter Baumann
2007-07-18 13:08 ` Alex Riesen
2007-07-18 14:06 ` David Kastrup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85lkcyvr4f.fsf@lola.goethe.zz \
--to=dak@gnu.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.