Skip to content

Commit

Permalink
Further fixes for Ububntu compliance. Closes ticket #59.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.opennebula.org/one/trunk@307 3034c82b-c49b-4eb3-8279-a7acafdc01c0
  • Loading branch information
tinova committed Jan 19, 2009
1 parent 154ad3d commit 19665b7
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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 \
Expand Down Expand Up @@ -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

Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 19665b7

Please sign in to comment.