cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject git commit: refs/heads/4.1 - BUG-ID: CLOUDSTACK-1252 Summary: Failed to download default template in VMware
Date Mon, 25 Mar 2013 17:32:49 GMT
Updated Branches:
  refs/heads/4.1 4d853d7d4 -> 8d3a7f29b


BUG-ID: CLOUDSTACK-1252 Summary: Failed to download default template in VMware

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

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/8d3a7f29
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8d3a7f29
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8d3a7f29

Branch: refs/heads/4.1
Commit: 8d3a7f29b8307bff10a66d7871ad9c83f26deb1c
Parents: 4d853d7
Author: Pradeep <pradeep.soundararajan@citrix.com>
Authored: Fri Mar 22 15:25:28 2013 +0530
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Mon Mar 25 17:32:28 2013 +0000

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d3a7f29/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index a7a6927..db37afc 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 "Executing mvn packaging for NONOSS ..."
+	mvn -P awsapi,systemvm -Dnonoss package
+else
+    echo "Executing mvn packaging for OSS ..."
+	mvn -P awsapi package -Dsystemvm
+fi
 
 %install
 [ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d3a7f29/packaging/centos63/package.sh
----------------------------------------------------------------------
diff --git a/packaging/centos63/package.sh b/packaging/centos63/package.sh
index 2515ecb..d9d5b1c 100755
--- a/packaging/centos63/package.sh
+++ b/packaging/centos63/package.sh
@@ -16,9 +16,56 @@
 # specific language governing permissions and limitations
 # under the License.
 
+function usage() {
+ echo ""
+ echo "usage: ./package.sh [-p|--pack] [-h|--help] [ARGS]"
+ echo ""
+ echo "The commonly used Arguments are:"
+ echo "oss|OSS         To package OSS specific"
+ echo "nonoss|NONOSS   To package NONOSS specific"
+ echo ""
+ echo "Examples: ./package.sh -p|--pack oss|OSS"
+ echo "          ./package.sh -p|--pack nonoss|NONOSS"
+ echo "          ./package.sh (Default OSS)"
+ 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]\.'`
+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]\.'`
@@ -42,4 +89,65 @@ mkdir -p $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
 
 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 "Doing CloudStack Packaging ....."
+		packageval=$2
+		if [ "$packageval" == "oss" -o "$packageval" == "OSS" ] ; then
+			defaultPackaging
+		elif [ "$packageval" == "nonoss" -o "$packageval" == "NONOSS" ] ; then
+			packaging
+		else
+			echo "Error: Incorrect value provided in package.sh script, Please see help ./package.sh
--help|-h for more details."
+			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 "Please, execute ./package.sh --help for more help"
+fi


Mime
View raw message