change build script for ubuntu

* Generalised the CODENAME to be taken out of /etc/lsb-release
* added building of xcat-dep, the script for that will be added later
* added for loop to create packages rather than one line per package

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12176 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
arifali 2012-04-10 11:00:00 +00:00
parent ae1b2cf9d5
commit f1152ae54d
2 changed files with 25 additions and 13 deletions

View File

@ -6,6 +6,7 @@
#
# Author: Leonardo Tonetto <tonetto@linux.vnet.ibm.com>
# Revisor: Adalberto Medeiros <adalbas@linux.vnet.ibm.com>
# Revisor2: Arif Ali <aali@ocf.co.uk>
#
# Input:
#
@ -60,21 +61,19 @@ function makedeb {
#
# Clean up
#
# Eliminate unnecessary directories and debian/files made by dpgk-buildpakcage
# Eliminate unnecessary directories and debian/files made by dpkg-buildpackage
find $SRC_ROOT -maxdepth 3 -type d -name "xcat-*" | grep debian | xargs rm -rf
find $SRC_ROOT -maxdepth 3 -type f -name "files" | grep debian | xargs rm -f
}
# build all debian packages
makedeb xCAT-client $PKG_LOCATION "$BUILD_STRING" $VERSION
makedeb xCAT-nbroot $PKG_LOCATION "$BUILD_STRING" $VERSION
makedeb perl-xCAT $PKG_LOCATION "$BUILD_STRING" $VERSION
makedeb xCAT-server $PKG_LOCATION "$BUILD_STRING" $VERSION
makedeb xCAT-UI $PKG_LOCATION "$BUILD_STRING" $VERSION
makedeb xCAT $PKG_LOCATION "$BUILD_STRING" $VERSION
makedeb xCATsn $PKG_LOCATION "$BUILD_STRING" $VERSION
makedeb xCAT-test $PKG_LOCATION "$BUILD_STRING" $VERSION
packages="xCAT-client xCAT-nbroot xCAT-nbroot2 perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-IBMhpc xCAT-rmc"
for file in `echo $packages`
do
makedeb $file $PKG_LOCATION "$BUILD_STRING" $VERSION
done
if [ -d debs ]; then
rm -rf debs

View File

@ -2,12 +2,17 @@
# Update GSA Ubuntu Repositories or create a local repository
#
# Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com)
# Revisor: Arif Ali (aali@ocf.co.uk)
#
# After running this script, add the following line to
# /etc/apt/sources.list for local repository
# deb file://<core_repo_path>/xcat-core/ maverick main
# deb file://<dep_repo_path>/xcat-dep/ maverick main
#
# For the purpose of getting the distribution name
. /etc/lsb-release
a_flag= # automatic flag - only update if repo was updated
c_flag= # xcat-core (trunk-delvel) path
d_flag= # xcat-dep (trunk) path
@ -131,7 +136,7 @@ then
cat << __EOF__ > $repo_xcat_core_path/conf/distributions
Origin: xCAT internal repository
Label: xcat-core bazaar repository
Codename: maverick
Codename: $DISTRIB_CODENAME
Architectures: i386 amd64
Components: main
Description: Repository automatically genereted conf
@ -143,7 +148,7 @@ basedir .
__EOF__
for file in `ls $repo_xcat_core_path/*.deb`; do
reprepro -b $repo_xcat_core_path includedeb maverick $file;
reprepro -b $repo_xcat_core_path includedeb $DISTRIB_CODENAME $file;
done
mv $xcat_core_path/latest_version $repo_xcat_core_path/xcat-core_latest-build
@ -174,6 +179,14 @@ else
fi
if [ "$d_flag" -a "$update_dep" ]
then
echo "##############################"
echo "# Building xcat-dep packages #"
echo "##############################"
CMD_PATH=`pwd`
cd $xcat_dep_path
./build-debs-all "snap" "Nightly_Builds"
echo "################################"
echo "# Creating xcat-dep repository #"
echo "################################"
@ -183,7 +196,7 @@ then
cat << __EOF__ > $repo_xcat_dep_path/conf/distributions
Origin: xCAT internal repository
Label: xcat-dep bazaar repository
Codename: maverick
Codename: $DISTRIB_CODENAME
Architectures: i386 amd64
Components: main
Description: Repository automatically genereted conf
@ -195,7 +208,7 @@ basedir .
__EOF__
for file in `ls $repo_xcat_dep_path/*.deb`; do
reprepro -b $repo_xcat_dep_path includedeb maverick $file;
reprepro -b $repo_xcat_dep_path includedeb $DISTRIB_CODENAME $file;
done
if [ -z "$local_flag" ]