cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [32/50] [abbrv] git commit: refs/heads/ui-multiple-pod-ranges - CLOUDSTACK-1252: Failed to download default template in VMware
Date Mon, 25 Mar 2013 17:52:32 GMT
CLOUDSTACK-1252: Failed to download default template in VMware

Proposing to modify package.sh script. Package as per OSS or NONOSS arguments.

Now package.sh will act based on the below usage i.e. with or without
arguments:

 ./package.sh -h

usage: ./package.sh [-p|--pack] [-h|--help] [ARGS]

oss|OSS         To package OSS specific
nonoss|NONOSS   To package NONOSS specific

Examples: ./package.sh -p|--pack oss|OSS
          ./package.sh -p|--pack nonoss|NONOSS
          ./package.sh (Default OSS)

Signed-off-by: Pradeep <pradeep.soundararajan@citrix.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/01ea7232
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/01ea7232
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/01ea7232

Branch: refs/heads/ui-multiple-pod-ranges
Commit: 01ea7232d9a7e956277f03c8471d8d4e2b60d699
Parents: 1c845d4
Author: Pradeep <pradeep.soundararajan@citrix.com>
Authored: Fri Mar 22 16:11:51 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Fri Mar 22 16:14:07 2013 +0530

----------------------------------------------------------------------
 packaging/centos63/cloud.spec |    9 ++-
 packaging/centos63/package.sh |  140 ++++++++++++++++++++++++++++++-----
 2 files changed, 128 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01ea7232/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index 16c3602..9b10a67 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -165,7 +165,14 @@ echo Doing CloudStack build
 cp packaging/centos63/replace.properties build/replace.properties
 echo VERSION=%{_maventag} >> build/replace.properties
 echo PACKAGE=%{name} >> build/replace.properties
-mvn -P awsapi package -Dsystemvm
+
+if [ "%{_ossnoss}" == "NONOSS" -o "%{_ossnoss}" == "nonoss" ] ; then
+    echo "Packaging nonoss components"
+   mvn -Pawsapi,systemvm -Dnonoss package
+else
+    echo "Packaging oss components"
+   mvn -Pawsapi package -Dsystemvm
+fi
 
 %install
 [ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01ea7232/packaging/centos63/package.sh
----------------------------------------------------------------------
diff --git a/packaging/centos63/package.sh b/packaging/centos63/package.sh
index 2515ecb..802cf7e 100755
--- a/packaging/centos63/package.sh
+++ b/packaging/centos63/package.sh
@@ -16,30 +16,130 @@
 # specific language governing permissions and limitations
 # under the License.
 
-CWD=`pwd`
-RPMDIR=$CWD/../../dist/rpmbuild
-PACK_PROJECT=cloudstack
+function usage() {
+ echo ""
+ echo "usage: ./package.sh [-p|--pack] [-h|--help] [ARGS]"
+ echo ""
+ echo "oss|OSS         To package oss components only"
+ echo "nonoss|NONOSS   To package non-oss and oss components"
+ echo ""
+ echo "Examples: ./package.sh -p|--pack oss|OSS"
+ echo "          ./package.sh -p|--pack nonoss|NONOSS"
+ echo "          ./package.sh (Default OSS)"
+ echo ""
+ exit 1
+}
 
+function defaultPackaging() {
+ CWD=`pwd`
+ RPMDIR=$CWD/../../dist/rpmbuild
+ PACK_PROJECT=cloudstack
+ VERSION=`(cd ../../; mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version)
| grep '^[0-9]\.'`
 
-VERSION=`(cd ../../; mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version)
| grep '^[0-9]\.'`
-if echo $VERSION | grep SNAPSHOT ; then
-  REALVER=`echo $VERSION | cut -d '-' -f 1`
-  DEFVER="-D_ver $REALVER"
-  DEFPRE="-D_prerelease 1"
-  DEFREL="-D_rel SNAPSHOT"
-else
-  DEFVER="-D_ver $REALVER"
-  DEFPRE=
-  DEFREL=
-fi
+ if echo $VERSION | grep SNAPSHOT ; then
+   REALVER=`echo $VERSION | cut -d '-' -f 1`
+   DEFVER="-D_ver $REALVER"
+   DEFPRE="-D_prerelease 1"
+   DEFREL="-D_rel SNAPSHOT"
+ else
+   DEFVER="-D_ver $REALVER"
+   DEFPRE=
+   DEFREL=
+ fi
+ mkdir -p $RPMDIR/SPECS
+ mkdir -p $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
+
+ (cd ../../; tar -c --exclude .git --exclude dist  .  | tar -C $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
-x)
+ (cd $RPMDIR/SOURCES/; tar -czf $PACK_PROJECT-$VERSION.tgz $PACK_PROJECT-$VERSION)
+
+ cp cloud.spec $RPMDIR/SPECS
+
+ (cd $RPMDIR; rpmbuild -ba SPECS/cloud.spec "-D_topdir $RPMDIR" "$DEFVER" "$DEFREL" "$DEFPRE")
+
+ exit
+}
+
+function packaging() {
+ CWD=`pwd`
+ RPMDIR=$CWD/../../dist/rpmbuild
+ PACK_PROJECT=cloudstack
+ DEFOSSNOSS="-D_ossnoss $packageval"
+ VERSION=`(cd ../../; mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version)
| grep '^[0-9]\.'`
 
-mkdir -p $RPMDIR/SPECS
-mkdir -p $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
+ if echo $VERSION | grep SNAPSHOT ; then
+   REALVER=`echo $VERSION | cut -d '-' -f 1`
+   DEFVER="-D_ver $REALVER"
+   DEFPRE="-D_prerelease 1"
+   DEFREL="-D_rel SNAPSHOT"
+ else
+   DEFVER="-D_ver $REALVER"
+   DEFPRE=
+   DEFREL=
+ fi
 
+ mkdir -p $RPMDIR/SPECS
+ mkdir -p $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
 
-(cd ../../; tar -c --exclude .git --exclude dist  .  | tar -C $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
-x )
-(cd $RPMDIR/SOURCES/; tar -czf $PACK_PROJECT-$VERSION.tgz $PACK_PROJECT-$VERSION)
+ (cd ../../; tar -c --exclude .git --exclude dist  .  | tar -C $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
-x )
+ (cd $RPMDIR/SOURCES/; tar -czf $PACK_PROJECT-$VERSION.tgz $PACK_PROJECT-$VERSION)
 
-cp cloud.spec $RPMDIR/SPECS
+ cp cloud.spec $RPMDIR/SPECS
 
-(cd $RPMDIR; rpmbuild -ba SPECS/cloud.spec "-D_topdir $RPMDIR" "$DEFVER" "$DEFREL" "$DEFPRE")
+ (cd $RPMDIR; rpmbuild -ba SPECS/cloud.spec "-D_topdir $RPMDIR" "$DEFVER" "$DEFREL" "$DEFPRE"
"$DEFOSSNOSS")
+
+ exit
+}
+
+
+if [ $# -lt 1 ] ; then
+  defaultPackaging
+elif [ $# -gt 0 ] ; then
+  SHORTOPTS="hp:"
+  LONGOPTS="help,pack:"
+  ARGS=$(getopt -s bash -u -a --options $SHORTOPTS  --longoptions $LONGOPTS --name $0 --
"$@" )
+
+  eval set -- "$ARGS"
+
+  while [ $# -gt 0 ] ; do
+   case "$1" in
+    -h | --help)
+       usage
+       exit 0
+       ;;
+    -p | --pack)
+       echo "Packaging Apache CloudStack"
+      packageval=$2
+      if [ "$packageval" == "oss" -o "$packageval" == "OSS" ] ; then
+         defaultPackaging
+      elif [ "$packageval" == "nonoss" -o "$packageval" == "NONOSS" ] ; then
+         packaging
+      else
+         echo "Error: Incorrect usage. See help ./package.sh --help|-h."
+         exit 1
+      fi
+      ;;
+    -)
+       echo "Unrecognized option."
+      usage
+      exit 1
+       ;;
+    --)
+       echo "Unrecognized option."
+      usage
+      exit 1
+       ;;
+    -*)
+      echo "Unrecognized option."
+     usage
+     exit 1
+     ;;
+     *)
+       shift
+       break
+       ;;
+    esac
+  done
+else
+   echo "Incorrect choice. Nothing to do." >&2
+   echo "./package.sh --help for details"
+fi


Mime
View raw message