From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 3/6 v2] trace-cmd: Add a make-trace-cmd.sh script to simplify creating a trace-cmd package
Date: Wed, 16 Dec 2020 18:19:45 -0500 [thread overview]
Message-ID: <20201216232145.409840117@goodmis.org> (raw)
In-Reply-To: 20201216231942.127326802@goodmis.org
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Add a script "make-trace-cmd.sh" and a help file "PACKAGKING" to describe
what it does. The make-trace-cmd.sh will help create a full directory that
has libtraceevent, libtracefs, libtracecmd and trace-cmd binary without
needing to install them on the host machine.
As described in PACKAGING, the steps to do so are:
git clone git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git
git clone git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git
git clone git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git
cd libtraceevent
INSTALL_PATH=/tmp/install ../trace-cmd/make-trace-cmd.sh install
cd ../libtracefs
INSTALL_PATH=/tmp/install ../trace-cmd/make-trace-cmd.sh install
cd ../trace-cmd
INSTALL_PATH=/tmp/install ./make-trace-cmd.sh install install_libs
cd /tmp/install
tar cvjf /tmp/trace-cmd-files.tar.bz2 .
And then the tarball of /tmp/trace-cmd-files.tar.bz2 will can be extracted
on another machine at the root directory, and trace-cmd will be installed there.
Note, the above process uses the /usr prefix. To have the package be
installed in /usr/local, add:
PREFIX=/usr/local
in front of each of the make-trace-cmd.sh commands.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
PACKAGING | 30 ++++++++++++++++++++++++++++++
make-trace-cmd.sh | 31 +++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 PACKAGING
create mode 100755 make-trace-cmd.sh
diff --git a/PACKAGING b/PACKAGING
new file mode 100644
index 000000000000..7e7d20653017
--- /dev/null
+++ b/PACKAGING
@@ -0,0 +1,30 @@
+The libtracefs and libtraceevent packages are required for trace-cmd
+and libtracecmd.so
+
+In order to create a package directory with libtraceevent, libtracefs
+and libtracecmd and trace-cmd, you can follow these steps:
+
+ git clone git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git
+ git clone git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git
+ git clone git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git
+
+ cd libtraceevent
+ INSTALL_PATH=/tmp/install ../trace-cmd/make-trace-cmd.sh install
+
+ cd ../libtracefs
+ INSTALL_PATH=/tmp/install ../trace-cmd/make-trace-cmd.sh install
+
+ cd ../trace-cmd
+ INSTALL_PATH=/tmp/install ./make-trace-cmd.sh install install_libs
+
+ cd /tmp/install
+ tar cvjf /tmp/trace-cmd-files.tar.bz2 .
+
+And then the tarball of /tmp/trace-cmd-files.tar.bz2 will can be extracted
+on another machine at the root directory, and trace-cmd will be installed there.
+
+Note, to define a prefix, add a PREFIX variable before calling make-trace-cmd.sh
+
+ For example:
+
+ PREFIX=/usr/local INSTALL_PATH=/tmp/install ./make-trace-cmd.sh install
diff --git a/make-trace-cmd.sh b/make-trace-cmd.sh
new file mode 100755
index 000000000000..ddff18146c84
--- /dev/null
+++ b/make-trace-cmd.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+if [ -z "$INSTALL_PATH" ]; then
+ echo
+ echo 'Error: No $INSTALL_PATH defined'
+ echo
+ echo " usage: [PREFIX=prefix][BUILD_PATH=/path/to/build] INSTALL_PATH=/path/to/install make-trace-cmd.sh install|install_libs|clean|uninstall"
+ echo
+ echo " Used to create a self contained directory to copy to other machines."
+ echo
+ echo " Please read PACKAGING for more information."
+ echo
+ exit
+fi
+
+if [ ! -d $INSTALL_PATH ]; then
+ mkdir $INSTALL_PATH
+fi
+
+if [ ! -z "$BUILD_PATH" ]; then
+ if [ ! -d $BUILD_PATH ]; then
+ mkdir $BUILD_PATH
+ fi
+ O_PATH="O=$BUILD_PATH"
+fi
+
+if [ -z "$PREFIX" ]; then
+ PREFIX="/usr"
+fi
+
+PKG_CONFIG="pkg-config --with-path $INSTALL_PATH/usr/lib64/pkgconfig --define-variable=prefix=$INSTALL_PATH/$PREFIX" CFLAGS="-g -Wall -I$INSTALL_PATH/$PREFIX/include" make DESTDIR=$INSTALL_PATH $O_PATH prefix=$PREFIX $@
--
2.29.2
next prev parent reply other threads:[~2020-12-16 23:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 23:19 [PATCH 0/6 v2] trace-cmd/kernelshark: Fixed build, cleanups and fix kernelshark Steven Rostedt
2020-12-16 23:19 ` [PATCH 1/6 v2] trace-cmd: Move add_event_pid() out of #ifndef NO_PTRACE Steven Rostedt
2020-12-16 23:19 ` [PATCH 2/6 v2] trace-cmd: Add #include <fcntl.h> to trace-cmd-private.h Steven Rostedt
2020-12-16 23:19 ` Steven Rostedt [this message]
2020-12-16 23:19 ` [PATCH 4/6 v2] trace-cmd: Do not have local builds of libtraceevent or libtracefs use system headers Steven Rostedt
2020-12-16 23:19 ` [PATCH 5/6 v2] kernelshark: Build libtraceevent and libtracefs locally Steven Rostedt
2020-12-16 23:19 ` [PATCH 6/6 v2] trace-cmd: Re-enable the build of KernelShark v1 Steven Rostedt
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=20201216232145.409840117@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=y.karadz@gmail.com \
/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).