mirror of https://github.com/apache/cloudstack.git
updated packge scripts to support simularot rpm build
(cherry picked from commit f96c65416a)
This commit is contained in:
parent
eb447f14e2
commit
dfdf9edd52
|
|
@ -206,12 +206,23 @@ touch build/gitrev.txt
|
||||||
echo $(git rev-parse HEAD) > build/gitrev.txt
|
echo $(git rev-parse HEAD) > build/gitrev.txt
|
||||||
|
|
||||||
if [ "%{_ossnoss}" == "NOREDIST" -o "%{_ossnoss}" == "noredist" ] ; then
|
if [ "%{_ossnoss}" == "NOREDIST" -o "%{_ossnoss}" == "noredist" ] ; then
|
||||||
echo "Executing mvn packaging with non-redistributable libraries ..."
|
echo "Executing mvn packaging with non-redistributable libraries"
|
||||||
mvn -Pawsapi,systemvm -Dnoredist clean package
|
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
|
else
|
||||||
echo "Executing mvn packaging ..."
|
if [ "%{_sim}" == "SIMULATOR" -o "%{_sim}" == "simulator" ] ; then
|
||||||
mvn -Pawsapi,systemvm clean package
|
echo "Executing mvn default packaging simulator ..."
|
||||||
fi
|
mvn -Pawsapi,systemvm -Dsimulator clean package
|
||||||
|
else
|
||||||
|
echo "Executing mvn default packaging without simulator ..."
|
||||||
|
mvn -Pawsapi,systemvm clean package
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
%install
|
%install
|
||||||
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ function usage() {
|
||||||
echo "-p|--pack noredist|NOREDIST To package with non-redistributable libraries"
|
echo "-p|--pack noredist|NOREDIST To package with non-redistributable libraries"
|
||||||
echo "-o default|DEFAULT To build in default Operating System mode"
|
echo "-o default|DEFAULT To build in default Operating System mode"
|
||||||
echo "-o rhel7|RHEL7 To build for rhel7"
|
echo "-o rhel7|RHEL7 To build for rhel7"
|
||||||
|
echo "-s simulator|SIMULATOR To build for Simulator"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Examples: ./package.sh -p|--pack oss|OSS"
|
echo "Examples: ./package.sh -p|--pack oss|OSS"
|
||||||
echo " ./package.sh -p|--pack noredist|NOREDIST"
|
echo " ./package.sh -p|--pack noredist|NOREDIST"
|
||||||
|
|
@ -44,6 +45,10 @@ function packaging() {
|
||||||
DEFOSSNOSS="-D_ossnoss $2"
|
DEFOSSNOSS="-D_ossnoss $2"
|
||||||
echo "$DEFOSSNOSS"
|
echo "$DEFOSSNOSS"
|
||||||
fi
|
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]\.'`
|
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
|
if echo $VERSION | grep -q SNAPSHOT ; then
|
||||||
|
|
@ -90,7 +95,7 @@ if [ $# -lt 1 ] ; then
|
||||||
packaging "default"
|
packaging "default"
|
||||||
elif [ $# -gt 0 ] ; then
|
elif [ $# -gt 0 ] ; then
|
||||||
SHORTOPTS="hp:o:"
|
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 -- "$@")
|
ARGS=$(getopt -s bash -u -a --options $SHORTOPTS --longoptions $LONGOPTS --name $0 -- "$@")
|
||||||
eval set -- "$ARGS"
|
eval set -- "$ARGS"
|
||||||
echo "$ARGS"
|
echo "$ARGS"
|
||||||
|
|
@ -127,6 +132,19 @@ elif [ $# -gt 0 ] ; then
|
||||||
fi
|
fi
|
||||||
shift
|
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..."
|
echo "Unrecognized option..."
|
||||||
usage
|
usage
|
||||||
|
|
@ -142,8 +160,8 @@ elif [ $# -gt 0 ] ; then
|
||||||
echo "Setting os to default"
|
echo "Setting os to default"
|
||||||
os="default"
|
os="default"
|
||||||
fi
|
fi
|
||||||
echo "Passed OS = $os and packageval = $packageval"
|
echo "Passed OS = $os, packageval = $packageval and Simulator build = $sim"
|
||||||
packaging $os $packageval
|
packaging $os $packageval $sim
|
||||||
else
|
else
|
||||||
echo "Incorrect choice. Nothing to do." >&2
|
echo "Incorrect choice. Nothing to do." >&2
|
||||||
echo "Please, execute ./package.sh --help for more help"
|
echo "Please, execute ./package.sh --help for more help"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue