summaryrefslogtreecommitdiff
path: root/templates/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-06 19:50:14 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-06 20:49:26 (GMT)
commitd3af621b147bb90a31fdc3b55e07853f45deb658 (patch)
tree26d8d69dd5288b5f6f9756ba75549618d808627f /templates/Makefile
parentf5b749560980a30d7472183e3d6360baa5a1f0d5 (diff)
downloadgit-d3af621b147bb90a31fdc3b55e07853f45deb658.zip
git-d3af621b147bb90a31fdc3b55e07853f45deb658.tar.gz
git-d3af621b147bb90a31fdc3b55e07853f45deb658.tar.bz2
Redo the templates generation and installation.
Per discussion with people interested in binary packaging, change the default template location from /etc/git-core to /usr/share/git-core hierarchy. If a user wants to run git before installing for whatever reason, in addition to adding $src to the PATH environment variable, git-init-db can be run with --template=$src/templates/blt/ parameter. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'templates/Makefile')
-rw-r--r--templates/Makefile43
1 files changed, 31 insertions, 12 deletions
diff --git a/templates/Makefile b/templates/Makefile
index 1243351..6b2a900 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -1,19 +1,38 @@
-# make
+# make and install sample templates
INSTALL=install
prefix=$(HOME)
-etcdir=$(prefix)/etc
-etcgitdir=$(etcdir)/git-core
-templatedir=$(etcgitdir)/templates
+template_dir=$(prefix)/share/git-core/templates/
# dest=
-all:
+all: boilerplates custom
+ find blt
+
+# Put templates that can be copied straight from the source
+# in a file direc--tory--file in the source. They will be
+# just copied to the destination.
+boilerplates:
+ ls *--* 2>/dev/null | \
+ while read boilerplate; \
+ do \
+ case "$$boilerplate" in *~) continue ;; esac && \
+ dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
+ dir=`expr "$$dst" : '\(.*\)/'` && \
+ mkdir -p blt/$$dir && \
+ case "$$boilerplate" in \
+ *--) ;; \
+ *) cp $$boilerplate blt/$$dst ;; \
+ esac || exit; \
+ done || exit
+
+# If you need build-tailored templates, build them into blt/
+# directory yourself here.
+custom:
+ : no custom templates yet
+
clean:
+ rm -rf blt
-install:
- $(INSTALL) -d -m755 $(dest)$(templatedir)/hooks/
- $(foreach s,$(wildcard hooks--*),\
- $(INSTALL) -m644 $s \
- $(dest)$(templatedir)/hooks/$(patsubst hooks--%,%,$s);)
- $(INSTALL) -d -m755 $(dest)$(templatedir)/info
- $(INSTALL) -d -m755 $(dest)$(templatedir)/branches
+install: all
+ $(INSTALL) -d -m755 $(dest)$(template_dir)
+ tar Ccf blt - . | tar Cxf $(dest)$(template_dir) -