cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [1/6] git commit: updated refs/heads/master to 3165435
Date Sat, 21 Sep 2013 04:47:03 GMT
Updated Branches:
  refs/heads/master 9a7f304b8 -> 316543541


Simplify package.sh


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

Branch: refs/heads/master
Commit: d0b896ed36a54f1191994b1a400513684177b07d
Parents: e209a2c
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Thu Sep 19 15:11:40 2013 +0800
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Sat Sep 21 12:32:09 2013 +0800

----------------------------------------------------------------------
 packaging/centos63/package.sh | 48 +++++++-------------------------------
 1 file changed, 8 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0b896ed/packaging/centos63/package.sh
----------------------------------------------------------------------
diff --git a/packaging/centos63/package.sh b/packaging/centos63/package.sh
index 8337944..7c5fac3 100755
--- a/packaging/centos63/package.sh
+++ b/packaging/centos63/package.sh
@@ -18,7 +18,7 @@
 
 function usage() {
  echo ""
- echo "usage: ./package.sh [-p|e-pack] [-h|--help] [ARGS]"
+ echo "usage: ./package.sh [-p|-pack] [-h|--help] [ARGS]"
  echo ""
  echo "The commonly used Arguments are:"
  echo "oss|OSS             To package OSS specific"
@@ -30,45 +30,14 @@ function usage() {
  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
-  REALVER=$VERSION
-  DEFVER="-D_ver $REALVER"
-  DEFREL="-D_rel 1"
-fi
-
-mkdir -p $RPMDIR/SPECS
-mkdir -p $RPMDIR/BUILD
-mkdir -p $RPMDIR/SRPMS
-mkdir -p $RPMDIR/RPMS
-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 --define "_topdir $RPMDIR" "${DEFVER}" "${DEFREL}" ${DEFPRE+"${DEFPRE}"}
-ba SPECS/cloud.spec)
-
-exit
-}
-
 function packaging() {
 	 
 CWD=`pwd`
 RPMDIR=$CWD/../../dist/rpmbuild
 PACK_PROJECT=cloudstack
-DEFOSSNOSS="-D_ossnoss $packageval"
+if [ -n "$1" ] ; then
+  DEFOSSNOSS="-D_ossnoss $packageval"
+fi
 
 
 VERSION=`(cd ../../; mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version)
| grep '^[0-9]\.'`
@@ -95,7 +64,7 @@ mkdir -p $RPMDIR/SOURCES/$PACK_PROJECT-$VERSION
 
 cp cloud.spec $RPMDIR/SPECS
 
-(cd $RPMDIR; rpmbuild --define "_topdir $RPMDIR" "${DEFVER}" "${DEFREL}" ${DEFPRE+\"${DEFPRE}\"}
"${DEFOSSNOSS}" -bb SPECS/cloud.spec)
+(cd $RPMDIR; rpmbuild --define "_topdir $RPMDIR" "${DEFVER}" "${DEFREL}" ${DEFPRE+"${DEFPRE}"}
${DEFOSSNOSS+"$DEFOSSNOSS"} -bb SPECS/cloud.spec)
 
 exit
 }
@@ -103,7 +72,7 @@ exit
 
 if [ $# -lt 1 ] ; then
 
-	defaultPackaging
+	packaging
 
 elif [ $# -gt 0 ] ; then
 
@@ -114,7 +83,6 @@ elif [ $# -gt 0 ] ; then
 	eval set -- "$ARGS"
 
 	while [ $# -gt 0 ] ; do
-        echo $1
 	case "$1" in
 	-h | --help)
 		usage
@@ -124,9 +92,9 @@ elif [ $# -gt 0 ] ; then
 		echo "Doing CloudStack Packaging ....."
 		packageval=$2
 		if [ "$packageval" == "oss" -o "$packageval" == "OSS" ] ; then
-			defaultPackaging
-		elif [ "$packageval" == "noredist" -o "$packageval" == "NOREDIST" ] ; then
 			packaging
+		elif [ "$packageval" == "noredist" -o "$packageval" == "NOREDIST" ] ; then
+			packaging noredist
 		else
 			echo "Error: Incorrect value provided in package.sh script, Please see help ./package.sh
--help|-h for more details."
 			exit 1


Mime
View raw message