[CLUE-Cert] simple build script

Dennis J Perkins djperkins at americanisp.net
Thu May 22 20:39:42 MDT 2003


Here is an example build script for building a package using the conf 
and build files.  It expects the .build file to initialize variables 
like confopts and makeopts.  The  build file can also override the 
default preconfigure, do_config, precompile, compile, postcompile and 
install functions.


-------------- next part --------------
#!/bin/bash
#
# build
#
# Version 0.1
#
#
# Dennis J Perkins
# 22 May 2003
#




compile() {
    make $makeopts
}



do_config() {
    ./configure $confopts
}


install() {
    make install
}



install_patches() {
    patch -Np1 -i ../${1}.patch
}




postcompile() {
    :
}



preconfigure() {
    :
}

precompile() {
    :
}


unpack() {

	
    while read keyword param
    do
	if [ $keyword = "VERSION" ]
	then
		version=$param
	fi
    done < pkgs/${package}.conf

    tar -xzf $package-${version}.tar.gz
}



package=$1


if [ ! -f pkgs/${package}.conf ]
then
    echo "Cannot find ${package}.conf"
    exit 1
fi    

if [ ! -f pkgs/${package}.build ]
then
    echo "Cannot find ${package}.build"
    exit 1
fi    


if [ ! -f pkgs/${package}.build ]
then
    echo "Cannot find ${package}.build"
    exit 1
fi


# Read build file for package.  Overwrites default build step functions.

source pkgs/${file}.build

unpack &
install_patches &&
preconfigure &&
do_config &&
precompile &&
compile &&
postcompile &&
install


exit 0


More information about the clue-cert mailing list