When installing, be prepared that template_dir may be relative.
Since the Makefile in the template/ subdirectory is only used to install the templates, we do not simply pass down the setting of template_dir when it is relative, but construct the intended destination in a new variable: A relative template_dir is relative to gitexecdir. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Johannes Sixt committed
Jan 1, 2008 at 22:15 UTC
0b50b860a505d4a1d6fa595a400f3968333e7128
2 files changed
+12
-5
Makefile
+8
-1
@@ -205,7 +205,7 @@ GITWEB_FAVICON = git-favicon.png
205
GITWEB_SITE_HEADER =
206
GITWEB_SITE_FOOTER =
207
208
-export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
208
+export prefix bindir gitexecdir sharedir htmldir sysconfdir
209
210
CC = gcc
211
AR = ar
@@ -1297,6 +1297,13 @@ remove-dashes:
1297
1298
### Installation rules
1299
1300
+ifeq ($(firstword $(subst /, ,$(template_dir))),..)
1301
+template_instdir = $(gitexecdir)/$(template_dir)
1302
+else
1303
+template_instdir = $(template_dir)
1304
+endif
1305
+export template_instdir
1306
+
1307
install: all
1308
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
1309
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
templates/Makefile
+4
-4
@@ -8,12 +8,12 @@ INSTALL ?= install
8
TAR ?= tar
9
RM ?= rm -f
10
prefix ?= $(HOME)
11
-template_dir ?= $(prefix)/share/git-core/templates
11
+template_instdir ?= $(prefix)/share/git-core/templates
12
# DESTDIR=
13
14
# Shell quote (do not use $(call) to accommodate ancient setups);
15
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
16
-template_dir_SQ = $(subst ','\'',$(template_dir))
16
+template_instdir_SQ = $(subst ','\'',$(template_instdir))
17
18
all: boilerplates.made custom
19
@@ -46,6 +46,6 @@ clean:
46
$(RM) -r blt boilerplates.made
47
48
install: all
49
- $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_dir_SQ)'
49
+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
50
(cd blt && $(TAR) cf - .) | \
51
- (cd '$(DESTDIR_SQ)$(template_dir_SQ)' && umask 022 && $(TAR) xf -)
51
+ (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xf -)