From c00858d0f7894fe3568b0fc2a9c52f4bb0ac22cd Mon Sep 17 00:00:00 2001 From: arifali Date: Tue, 10 Apr 2012 21:11:28 +0000 Subject: [PATCH] Add build script for building debs in xcat-dep Former-commit-id: 123c9eea8b2e5171c3d3d5a4382f5f650a510f99 --- build-debs-all | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 build-debs-all diff --git a/build-debs-all b/build-debs-all new file mode 100755 index 0000000..51c7a35 --- /dev/null +++ b/build-debs-all @@ -0,0 +1,60 @@ +#!/bin/bash +########### +# +# This script call makedeb and create the deb packages +# for xCAT +# +# Author: Arif Ali +# +# Original Work taken from the xcat-core repo done by Leonardo +# +# Input: +# +# $1 is the build type/location +# $2 is the string added to the debian/changelog of each package +# +############ + +function makedeb { + SRC_ROOT=$1 + + # + # Make DEBs + # + # build perl-xCAT - deps are libsoap-lite-perl, libdigest-sha1-perl, libdbi-perl + # + + find $SRC_ROOT -maxdepth 2 -name make_deb.sh -type f | while read DEBIAN_SCRIPT + do + DIR=`echo ${DEBIAN_SCRIPT} | sed -e 's/[/]make_deb.sh$//'` + cd ${DIR} + chmod a+x make_deb.sh + ./make_deb.sh + cd - + RC=$? + if [ ${RC} -gt 0 ] + then + echo "Warning: ${DIR} failed exit code ${RC}" + fi + done +} + +packages=`find . -maxdepth 2 -name make_deb.sh | cut -d/ -f 2 | xargs` + +# build all debian packages +for file in `echo $packages` +do + makedeb $file $PKG_LOCATION "$BUILD_STRING" $VERSION +done + +if [ -d debs ]; then + rm -rf debs +fi + +mkdir debs +for file in `echo $packages` +do + mv $file/*.deb debs +done + +exit 0