@matheusbsbs / matheus-bagliano / commits / b51b8bbf14
Fork 0

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 <josh@freedesktop.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Josh Triplett committed Apr 24, 2007 at 00:51 UTC b51b8bbf146d17556226bff14f97957e84aa0207
1 file changed +7 -2
Makefile
+7 -2
@@ -133,7 +133,12 @@ prefix = $(HOME)
133 bindir = $(prefix)/bin
134 gitexecdir = $(bindir)
135 template_dir = $(prefix)/share/git-core/templates/
136 -ETC_GITCONFIG = $(prefix)/etc/gitconfig
136 +ifeq ($(prefix),/usr)
137 +sysconfdir = /etc
138 +else
139 +sysconfdir = $(prefix)/etc
140 +endif
141 +ETC_GITCONFIG = $(sysconfdir)/gitconfig
142 # DESTDIR=
143
144 # default configuration for gitweb
@@ -152,7 +157,7 @@ GITWEB_FAVICON = git-favicon.png
157 GITWEB_SITE_HEADER =
158 GITWEB_SITE_FOOTER =
159
155 -export prefix bindir gitexecdir template_dir
160 +export prefix bindir gitexecdir template_dir sysconfdir
161
162 CC = gcc
163 AR = ar