<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffcc" text="#000066">
<tt>See my comments below.</tt><br>
<pre class="moz-signature" cols="72">Regards,

Marcos Eduardo Matsunaga

Oracle USA
Linux Engineering

“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”
</pre>
<br>
<br>
tristan.ye wrote:
<blockquote
 cite="mid:1225419596.6631.2.camel@tristan-laptop.cn.oracle.com"
 type="cite">
  <pre wrap="">On Thu, 2008-10-30 at 12:32 -0700, Marcos Matsunaga wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">The Makefile, Config.make and setup.sh need to be adapted to allow
RPM install, specially in the way that it does deal with the configuration
of the config.sh and config.py files and the install directory.

Signed-off-by: Marcos Matsunaga <a class="moz-txt-link-rfc2396E" href="mailto:Marcos.Matsunaga@oracle.com">&lt;Marcos.Matsunaga@oracle.com&gt;</a>
---
 programs/python_common/Config.make |    9 +++++++--
 programs/python_common/Makefile    |    2 ++
 programs/python_common/setup.sh    |   16 +++++++++++-----
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/programs/python_common/Config.make b/programs/python_common/Config.make
index 0121532..04384b3 100644
--- a/programs/python_common/Config.make
+++ b/programs/python_common/Config.make
@@ -5,9 +5,14 @@ CONFIG_SCRIPT := setup.sh
 
 CURDIR = $(shell pwd)
 
-config-script: $(CONFIG_SCRIPT)
+ifdef RPM_BUILD_ROOT
+INSTALLDIR = /usr/local
+endif
+
+config-script: $(CONFIG_SCRIPT) 
+
 ifdef CONFIG_SCRIPT
-        $(SHELL) $(CURDIR)/$(CONFIG_SCRIPT) $(DESTDIR)
+        $(SHELL) $(CURDIR)/$(CONFIG_SCRIPT) $(DESTDIR) $(INSTALLDIR)
 endif
 
         mkdir -p  $(DESTDIR)/workfiles $(DESTDIR)/log
diff --git a/programs/python_common/Makefile b/programs/python_common/Makefile
index 68493ca..a85deee 100644
--- a/programs/python_common/Makefile
+++ b/programs/python_common/Makefile
@@ -10,6 +10,8 @@ SUBDIRS =
 
 DIST_FILES =         config_py.skel \
                 config_shell.skel \
+                Config.make \
+                setup.sh \
                 o2tf.py \
                 single_run.sh \
                 multiple_run.sh \
diff --git a/programs/python_common/setup.sh b/programs/python_common/setup.sh
index 21f77f1..45ba6e1 100755
--- a/programs/python_common/setup.sh
+++ b/programs/python_common/setup.sh
@@ -18,8 +18,8 @@
 # Boston, MA 021110-1307, USA.
 
 #
-if [ $# -ne 1 ]; then
-   echo -e 'Usage: $0 &lt;DESTDIR&gt;';
+if [ $# -ne 1 -a $# -ne 2 ]; then
+   echo -e 'Usage: $0 &lt;DESTDIR&gt; [INSTALLDIR]';
    exit 1;
 fi;
 
@@ -34,14 +34,20 @@ else
         else
                 MPIDIR=/usr/bin
         fi
-fi
+fi;
+
+if [ $# -eq 1 ]; then
+        INSTALLDIR=DESTDIR;
    </pre>
  </blockquote>
  <pre wrap=""><!---->           should be INSTALLDIR=$[1} here?
  </pre>
</blockquote>
Yes.. Made the change.<br>
<blockquote
 cite="mid:1225419596.6631.2.camel@tristan-laptop.cn.oracle.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">+else
+        INSTALLDIR=${2};
+fi;
 
 BINDIR=${1}/bin
    </pre>
  </blockquote>
  <pre wrap=""><!---->        should be BINDIR=${INSTALLDIR}/bin here?
  </pre>
</blockquote>
No. This is the location where the config.py/config.sh will be
pre-installed for the RPM generation. The installdir is where the RPM
will install the programs. BINDIR was actually a bad name. I'm changing
it to make it less confuse.<br>
<blockquote
 cite="mid:1225419596.6631.2.camel@tristan-laptop.cn.oracle.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">-sed "s;&lt;DESTDIR&gt;;${1};g" ${BINDIR}/config_py.skel &gt;  ${BINDIR}/config.py
+sed "s;&lt;DESTDIR&gt;;${INSTALLDIR};g" ${BINDIR}/config_py.skel &gt;  ${BINDIR}/config.py
 mv ${BINDIR}/config.py  ${BINDIR}/config_py.skel
 sed "s;&lt;MPIDIR&gt;;${MPIDIR};g" ${BINDIR}/config_py.skel &gt;  ${BINDIR}/config.py
 #
-sed "s;&lt;DESTDIR&gt;;${1};g" ${BINDIR}/config_shell.skel &gt;  ${BINDIR}/config.sh
+sed "s;&lt;DESTDIR&gt;;${INSTALLDIR};g" ${BINDIR}/config_shell.skel &gt;  ${BINDIR}/config.sh
 mv ${BINDIR}/config.sh ${BINDIR}/config_shell.skel
 sed "s;&lt;MPIDIR&gt;;${MPIDIR};g" ${BINDIR}/config_shell.skel &gt;  ${BINDIR}/config.sh
 rm -f ${BINDIR}/config_py.skel ${BINDIR}/config_shell.skel
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
</body>
</html>