updated packge scripts to support simularot rpm build

This commit is contained in:
rayeesn 2014-09-18 15:02:35 -07:00 committed by Frank Zhang
parent 123ec8b3d3
commit f96c65416a
2 changed files with 37 additions and 8 deletions

View File

@ -206,11 +206,22 @@ touch build/gitrev.txt
echo $(git rev-parse HEAD) > build/gitrev.txt
if [ "%{_ossnoss}" == "NOREDIST" -o "%{_ossnoss}" == "noredist" ] ; then
echo "Executing mvn packaging with non-redistributable libraries ..."
mvn -Pawsapi,systemvm -Dnoredist clean package
echo "Executing mvn packaging with non-redistributable libraries"
if [ "%{_sim}" == "SIMULATOR" -o "%{_sim}" == "simulator" ] ; then
echo "Executing mvn noredist packaging with simulator ..."
mvn -Pawsapi,systemvm -Dnoredist -Dsimulator clean package
else
echo "Executing mvn noredist packaging without simulator..."
mvn -Pawsapi,systemvm -Dnoredist clean package
fi
else
echo "Executing mvn packaging ..."
mvn -Pawsapi,systemvm clean package
if [ "%{_sim}" == "SIMULATOR" -o "%{_sim}" == "simulator" ] ; then
echo "Executing mvn default packaging simulator ..."
mvn -Pawsapi,systemvm -Dsimulator clean package
else
echo "Executing mvn default packaging without simulator ..."
mvn -Pawsapi,systemvm clean package
fi
fi
%install

View File

@ -25,6 +25,7 @@ function usage() {
echo "-p|--pack noredist|NOREDIST To package with non-redistributable libraries"
echo "-o default|DEFAULT To build in default Operating System mode"
echo "-o rhel7|RHEL7 To build for rhel7"
echo "-s simulator|SIMULATOR To build for Simulator"
echo ""
echo "Examples: ./package.sh -p|--pack oss|OSS"
echo " ./package.sh -p|--pack noredist|NOREDIST"
@ -44,6 +45,10 @@ function packaging() {
DEFOSSNOSS="-D_ossnoss $2"
echo "$DEFOSSNOSS"
fi
if [ -n "$3" ] ; then
DEFSIM="-D_sim $3"
echo "$DEFSIM"
fi
VERSION=`(cd ../../; mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version) | grep --color=none '^[0-9]\.'`
if echo $VERSION | grep -q SNAPSHOT ; then
@ -90,7 +95,7 @@ if [ $# -lt 1 ] ; then
packaging "default"
elif [ $# -gt 0 ] ; then
SHORTOPTS="hp:o:"
LONGOPTS="help,pack:,operating-system:"
LONGOPTS="help,pack:,operating-system:,simulator:"
ARGS=$(getopt -s bash -u -a --options $SHORTOPTS --longoptions $LONGOPTS --name $0 -- "$@")
eval set -- "$ARGS"
echo "$ARGS"
@ -127,6 +132,19 @@ elif [ $# -gt 0 ] ; then
fi
shift
;;
-s | --simulator)
sim=$2
echo "$sim"
if [ "$sim" == "default" -o "$sim" == "DEFAULT" ] ; then
sim = "false"
elif [ "$sim" == "simulator" -o "$sim" == "SIMULATOR" ] ; then
sim="simulator"
else
echo "Error: Incorrect value provided in package.sh script for -o, Please see help ./package.sh --help|-h for more details."
exit 1
fi
shift
;;
-)
echo "Unrecognized option..."
usage
@ -142,8 +160,8 @@ elif [ $# -gt 0 ] ; then
echo "Setting os to default"
os="default"
fi
echo "Passed OS = $os and packageval = $packageval"
packaging $os $packageval
echo "Passed OS = $os, packageval = $packageval and Simulator build = $sim"
packaging $os $packageval $sim
else
echo "Incorrect choice. Nothing to do." >&2
echo "Please, execute ./package.sh --help for more help"