Skip to content

Instantly share code, notes, and snippets.

@rohityadavcloud
Created May 23, 2017 08:26
Show Gist options
  • Save rohityadavcloud/57c5b904c1f25455126cbc6b1c0bb83f to your computer and use it in GitHub Desktop.
Save rohityadavcloud/57c5b904c1f25455126cbc6b1c0bb83f to your computer and use it in GitHub Desktop.
Debian-pkg recipe for CloudStack
# Using docker container: https://hub.docker.com/r/bhaisaab/ubuntu-cloudstack-slave/
set -e
#apt-get install -y software-properties-common python-software-properties
#add-apt-repository -y ppa:openjdk-r/ppa
#apt-get update -y
#apt-get install -y git debhelper openjdk-7-jdk genisoimage python python-mysql.connector python-mysqldb python-setuptools maven lsb-release dh-systemd sshpass jq curl wget
export ROOT=$PWD
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
echo $0
cat .java-version || true
pwd
whoami
echo $PATH
java -version
javac -version
mvn -version
export VERSION=$(grep '^ <version>' pom.xml| cut -d'>' -f2 |cut -d'<' -f1)
export BASE_VERSION=$(echo $VERSION | awk -F . '{print $1"."$2}')
export ACS_BUILD_OPTS="-Dnoredist -Dnonoss"
LIBS=NONOSS
git clone https://github.com/rhtyd/cloudstack-nonoss.git $LIBS
if [ "$BASE_VERSION" = "4.2" ]; then
cp -r $LIBS/*.jar $LIBS/awsapi-lib/ $LIBS/*.mar deps
fi
cd $LIBS
bash -x install-non-oss.sh
cd $ROOT
cp $LIBS/vhd-util scripts/vm/hypervisor/xenserver/
chmod +x scripts/vm/hypervisor/xenserver/vhd-util
echo "cloudstack (${VERSION}) unstable; urgency=low" > $ROOT/newchangelog
echo "" >> $ROOT/newchangelog
echo " * Update the version to ${PACKAGE_VERSION}" >> $ROOT/newchangelog
echo "" >> $ROOT/newchangelog
echo " -- Rohit Yadav <rohit.yadav@shapeblue.com> $(date +'%a, %-d %b %Y %H:%m:%S +0530')" >> $ROOT/newchangelog
echo "" >> $ROOT/newchangelog
cat $ROOT/debian/changelog >> $ROOT/newchangelog
mv $ROOT/newchangelog $ROOT/debian/changelog
cd $ROOT
dpkg-buildpackage -uc -us -b
# Pkgs will be at $ROOT/../*deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment