From 19665b7ca8af6c94857aef9629adf4835ddf6761 Mon Sep 17 00:00:00 2001 From: tinova Date: Mon, 19 Jan 2009 16:40:46 +0000 Subject: [PATCH] Further fixes for Ububntu compliance. Closes ticket #59. git-svn-id: http://svn.opennebula.org/one/trunk@307 3034c82b-c49b-4eb3-8279-a7acafdc01c0 --- install.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index ea2faa8..a3d3bdf 100755 --- a/install.sh +++ b/install.sh @@ -48,7 +48,7 @@ while true ; do -r) UNINSTALL="yes" ; shift ;; -u) ONEADMIN_USER="$2" ; shift 2;; -g) ONEADMIN_GROUP="$2"; shift 2;; - -d) DST_DIR="$2" ; shift 2 ;; + -d) ROOT="$2" ; shift 2 ;; --) shift ; break ;; *) usage; exit 1 ;; esac @@ -58,7 +58,7 @@ done # Definition of locations #------------------------------------------------------------------------------- -if [ -z "$DST_DIR" ] ; then +if [ -z "$ROOT" ] ; then BIN_LOCATION="/usr/bin" LIB_LOCATION="/usr/lib/one" ETC_LOCATION="/etc/one" @@ -68,22 +68,23 @@ if [ -z "$DST_DIR" ] ; then INCLUDE_LOCATION="/usr/include" SHARE_LOCATION="/usr/share/doc/opennebula" - MAKE_DIRS="$LIB_LOCATION $ETC_LOCATION $LOG_LOCATION \ - $VAR_LOCATION $RUN_LOCATION $SHARE_LOCATION" + MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \ + $INCLUDE_LOCATION $SHARE_LOCATION \ + $LOG_LOCATION $RUN_LOCATION" CHOWN_DIRS="$LOG_LOCATION $VAR_LOCATION $RUN_LOCATION" else - BIN_LOCATION="$DST_DIR/bin" - LIB_LOCATION="$DST_DIR/lib" - ETC_LOCATION="$DST_DIR/etc" - VAR_LOCATION="$DST_DIR/var" - INCLUDE_LOCATION="$DST_DIR/include" - SHARE_LOCATION="$DST_DIR/share" + BIN_LOCATION="$ROOT/bin" + LIB_LOCATION="$ROOT/lib" + ETC_LOCATION="$ROOT/etc" + VAR_LOCATION="$ROOT/var" + INCLUDE_LOCATION="$ROOT/include" + SHARE_LOCATION="$ROOT/share" MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \ $INCLUDE_LOCATION $SHARE_LOCATION" - CHOWN_DIRS="$DST_DIR" + CHOWN_DIRS="$ROOT" fi SHARE_DIRS="$SHARE_LOCATION/examples \ @@ -307,7 +308,7 @@ TM_EXAMPLE_SHARE_FILES="share/examples/tm/tm_clone.sh \ if [ "$UNINSTALL" = "no" ] ; then for d in $MAKE_DIRS; do - mkdir -p $d + mkdir -p $DESTDIR$d done fi @@ -317,7 +318,7 @@ do_file() { if [ "$UNINSTALL" = "yes" ]; then rm $2/`basename $1` else - cp $SRC_DIR/$1 $2 + cp $SRC_DIR/$1 $DESTDIR$2 fi } @@ -348,7 +349,9 @@ fi # --- Set ownership or remove OpenNebula directories --- if [ "$UNINSTALL" = "no" ] ; then - /bin/chown -R $ONEADMIN_USER:$ONEADMIN_GROUP $CHOWN_DIRS + for d in $CHOWN_DIRS; do + /bin/chown -R $ONEADMIN_USER:$ONEADMIN_GROUP $DESTDIR$d + done else for d in `echo $MAKE_DIRS | awk '{for (i=NF;i>=1;i--) printf $i" "}'`; do rmdir $d