From b51b8bbf146d17556226bff14f97957e84aa0207 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 24 Apr 2007 00:51:35 -0700 Subject: [PATCH] Create a sysconfdir variable, and use it for ETC_GITCONFIG ETC_GITCONFIG defaults to $(prefix)/etc/gitconfig, so if you just set prefix=/usr, you end up with a git that looks in /usr/etc/gitconfig, rather than /etc/gitconfig as specified by the FHS. Furthermore, setting ETC_GITCONFIG does not fix the paths to any future system-wide configuration files. Factor out the path to the system-wide configuration directory into a variable sysconfdir, normally set to $(prefix)/etc, but set to /etc when prefix=/usr . This fixes the prefix=/usr problem for ETC_GITCONFIG, and allows centralized configuration of any future system-wide configuration files without requiring further action from package maintainers or other people building and installing git. Signed-off-by: Josh Triplett Signed-off-by: Junio C Hamano --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dcdaa02e47..b61c5d4cd2 100644 --- a/Makefile +++ b/Makefile @@ -133,7 +133,12 @@ prefix = $(HOME) bindir = $(prefix)/bin gitexecdir = $(bindir) template_dir = $(prefix)/share/git-core/templates/ -ETC_GITCONFIG = $(prefix)/etc/gitconfig +ifeq ($(prefix),/usr) +sysconfdir = /etc +else +sysconfdir = $(prefix)/etc +endif +ETC_GITCONFIG = $(sysconfdir)/gitconfig # DESTDIR= # default configuration for gitweb @@ -152,7 +157,7 @@ GITWEB_FAVICON = git-favicon.png GITWEB_SITE_HEADER = GITWEB_SITE_FOOTER = -export prefix bindir gitexecdir template_dir +export prefix bindir gitexecdir template_dir sysconfdir CC = gcc AR = ar -- 2.11.4.GIT