Adding packaging on onos*.zip file.
Modified Version.java to allow 3-segment version.
Changed onos-next to onos as default for ONOS_ROOT.
Change-Id: Ifbde9dfbc7af9a5891e9f41db6932859c0f59660
diff --git a/tools/build/envDefaults b/tools/build/envDefaults
index b4881a7..bef5223 100644
--- a/tools/build/envDefaults
+++ b/tools/build/envDefaults
@@ -1,7 +1,7 @@
# Environmental defaults for ONOS build, package and test
# Root of the ONOS source tree
-export ONOS_ROOT=${ONOS_ROOT:-~/onos-next}
+export ONOS_ROOT=${ONOS_ROOT:-~/onos}
# M2 repository and Karaf gold bits
export M2_REPO=${M2_REPO:-~/.m2/repository}
@@ -24,6 +24,7 @@
export ONOS_STAGE_ROOT=${ONOS_STAGE_ROOT:-/tmp}
export ONOS_STAGE=$ONOS_STAGE_ROOT/$ONOS_BITS
export ONOS_TAR=$ONOS_STAGE.tar.gz
+export ONOS_ZIP=$ONOS_STAGE.zip
# Defaults for ONOS testing using remote machines.
# if [ -n "${ONOS_CELL}" -a -f $ONOS_ROOT/tools/test/cells/${ONOS_CELL} ]; then
diff --git a/tools/build/onos-package b/tools/build/onos-package
index 9bc8fd5..8bbb4b4 100755
--- a/tools/build/onos-package
+++ b/tools/build/onos-package
@@ -72,5 +72,6 @@
# Now package up the ONOS tar file
cd $ONOS_STAGE_ROOT
COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS
-ls -l $ONOS_TAR >&2
+which -s zip && zip -rq $ONOS_ZIP $ONOS_BITS
+ls -l $ONOS_TAR $ONOS_ZIP >&2
rm -r $ONOS_STAGE
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index dbd65c4..2bb2059 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -3,7 +3,7 @@
# Simply include in your own .bash_aliases or .bash_profile
# Root of the ONOS source tree
-export ONOS_ROOT=${ONOS_ROOT:-~/onos-next}
+export ONOS_ROOT=${ONOS_ROOT:-~/onos}
# Setup some environmental context for developers
if [ -z "${JAVA_HOME}" ]; then
diff --git a/tools/package/bin/onos-service b/tools/package/bin/onos-service
index 7ce1b15..b9156ec 100755
--- a/tools/package/bin/onos-service
+++ b/tools/package/bin/onos-service
@@ -6,5 +6,7 @@
#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}
export JAVA_OPTS="${JAVA_OPTS:--Xms256m -Xmx2048m}"
-cd /opt/onos
-/opt/onos/apache-karaf-$KARAF_VERSION/bin/karaf "$@"
+ONOS_HOME=/opt/onos
+
+[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..
+${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@"