From: Josh Triplett <josh@freedesktop.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Create a sysconfdir variable, and use it for ETC_GITCONFIG
Date: Tue, 24 Apr 2007 00:51:35 -0700 [thread overview]
Message-ID: <462DB707.4000008@freedesktop.org> (raw)
In-Reply-To: <462DB07C.5060500@freedesktop.org>
[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]
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>
---
Makefile | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 65bd2db..60c41fd 100644
--- a/Makefile
+++ b/Makefile
@@ -141,7 +141,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
@@ -160,7 +165,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
--
1.5.1.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2007-04-24 7:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-24 2:11 [PATCH] Only use ETC_GITCONFIG=$(prefix)/etc/gitconfig ifeq ($(prefix),$(HOME)) Josh Triplett
2007-04-24 4:27 ` Junio C Hamano
2007-04-24 5:44 ` Josh Triplett
2007-04-24 5:59 ` Junio C Hamano
2007-04-24 7:23 ` Josh Triplett
2007-04-24 7:51 ` Josh Triplett [this message]
2007-04-24 8:12 ` [PATCH] Create a sysconfdir variable, and use it for ETC_GITCONFIG Junio C Hamano
2007-04-24 6:08 ` [PATCH] Only use ETC_GITCONFIG=$(prefix)/etc/gitconfig ifeq ($(prefix),$(HOME)) Junio C Hamano
2007-04-24 6:17 ` Junio C Hamano
2007-04-24 9:05 ` Sergio Callegari
2007-04-24 6:19 ` Shawn O. Pearce
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=462DB707.4000008@freedesktop.org \
--to=josh@freedesktop.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).