[rkward-cvs] rkward/rkward makerkwardscript.pl,NONE,1.1 rkward.sh.template,NONE,1.1 Makefile.am,1.61,1.62

Thomas Friedrichsmeier tfry at users.sourceforge.net
Thu Nov 10 22:38:18 UTC 2005


Update of /cvsroot/rkward/rkward/rkward
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9762/rkward

Modified Files:
	Makefile.am 
Added Files:
	makerkwardscript.pl rkward.sh.template 
Log Message:
Use wrapper script for rkward

--- NEW FILE: rkward.sh.template ---
#!/bin/sh
# Shell wrapper for rkward executable. Mostly copied from the wrapper for R executable.

R_HOME_DIR=###R_HOME_DIR###
if test -n "${R_HOME}" && \
   test "${R_HOME}" != "${R_HOME_DIR}"; then
  echo "WARNING: ignoring environment value of R_HOME"
fi
R_HOME="${R_HOME_DIR}"
export R_HOME
R_SHARE_DIR="${R_HOME_DIR}/share"
export R_SHARE_DIR
R_INCLUDE_DIR="${R_HOME_DIR}/include"
export R_INCLUDE_DIR
R_DOC_DIR="${R_HOME_DIR}/doc"
export R_DOC_DIR

# Adjust library path so libR.so can be located
## NOTE:
## We must set this here rather than in the main binary.
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
if test -z "${LD_LIBRARY_PATH}"; then
  LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
  LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

error () {
  echo "ERROR: $*" >&2
  exit 1
}

## R_HOME may have moved, so check
## (or you get "GUI X11 is not supported")
if test -x "${R_HOME}"; then
  :
else
  error "R_HOME ('${R_HOME}') not found. Most likely your installation of R has moved to a new location. Please rebuild rkward."
fi

## Create a per-session dir
: ${TMPDIR=/tmp}
{ tmp=`(umask 077 && mktemp -d -q "${TMPDIR}/RtmpXXXXXX") 2>/dev/null` \
    && test -n "${tmp}" && test -d "${tmp}" ; } ||
  { test -n "${RANDOM}" && tmp=${TMPDIR}/Rtmp$$-${RANDOM} \
      && (umask 077 && mkdir "${tmp}") ; } ||
  { tmp=${TMPDIR}/Rtmp$$ && (umask 077 && mkdir "${tmp}") ; } ||
  error "cannot create temporary R session directory"
R_SESSION_TMPDIR="${tmp}"
export R_SESSION_TMPDIR

## Start rkward
exec $0.bin "$@"

### Local Variables: ***
### mode: sh ***
### sh-indentation: 2 ***
### End: ***

--- NEW FILE: makerkwardscript.pl ---
#!/usr/bin/perl

$template = $ARGV[0];
$r_home = "\"$ARGV[1]\"";

open (TEMPLATE, "< $template") or die "Can't open template";
while (<TEMPLATE>) {
	$line = $_;
	$line =~ s/###R_HOME_DIR###/$r_home/;
	print ($line);
}
close (TEMPLATE);
Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/Makefile.am,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** Makefile.am	10 Nov 2005 21:22:38 -0000	1.61
--- Makefile.am	10 Nov 2005 22:38:16 -0000	1.62
***************
*** 63,69 ****
  bin_SCRIPTS = rkward
  
! # well, of course this is not the real thing yet. TODO: generate a wrapper
  rkward:
! 	echo "$(kde_bindir)/rkward.bin" > rkward; \
  	chmod 744 rkward
  
--- 63,69 ----
  bin_SCRIPTS = rkward
  
! # all the perl script does is fill in the placeholder for R_HOMEDIR
  rkward:
! 	./makerkwardscript.pl rkward.sh.template "$(R_HOMEDIR)" > rkward; \
  	chmod 744 rkward
  





More information about the rkward-tracker mailing list