From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Julia Lawall <julia.lawall@inria.fr>
Subject: [PATCH] trace-cmd: Have /etc paths honor $(prefix) if not the default
Date: Wed, 29 Jan 2020 10:43:12 -0500 [thread overview]
Message-ID: <20200129104312.2ba4a7a1@gandalf.local.home> (raw)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
As some files need to be placed in the root directory to take effect (like
the bash_completion) and not the normal /usr/local directory, they ignore
the $(prefix) and install directly. Unfortunately, this means that if
someone does a build like "make O=/tmp/mydir install" those files will still
try to be installed in the root "/etc" directory, and that will not work if
the user installing does not have permission.
Have the "/etc" directory change if prefix is something other than
"/usr/local".
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206277
Fixes: 77bdcb9b2 ("trace-cmd: Install trace-cmd.bash when installing")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Makefile | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 477625f7..d75f1437 100644
--- a/Makefile
+++ b/Makefile
@@ -51,6 +51,13 @@ libdir_SQ = '$(subst ','\'',$(libdir))'
includedir = $(prefix)/include
includedir_SQ = '$(subst ','\'',$(includedir))'
+ifeq ($(prefix),/usr/local)
+etcdir ?= /etc
+else
+etcdir ?= $(prefix)/etc
+endif
+etcdir_SQ = '$(subst ','\'',$(etcdir))'
+
export man_dir man_dir_SQ html_install html_install_SQ INSTALL
export img_install img_install_SQ
export DESTDIR DESTDIR_SQ
@@ -87,8 +94,8 @@ HELP_DIR = -DHELP_DIR=$(html_install)
HELP_DIR_SQ = '$(subst ','\'',$(HELP_DIR))'
#' emacs highlighting gets confused by the above escaped quote.
-BASH_COMPLETE_DIR ?= /etc/bash_completion.d
-LD_SO_CONF_DIR ?= /etc/ld.so.conf.d
+BASH_COMPLETE_DIR ?= $(etcdir)/bash_completion.d
+LD_SO_CONF_DIR ?= $(etcdir)/ld.so.conf.d
TRACE_LD_FILE ?= trace.conf
export PLUGIN_DIR_TRACEEVENT
--
2.20.1
reply other threads:[~2020-01-29 15:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200129104312.2ba4a7a1@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=julia.lawall@inria.fr \
--cc=linux-trace-devel@vger.kernel.org \
/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).