#!/bin/sh #----------------------------------------------------------------------------- # _ADMIN/_do_lzma.sh - additional lzma build script # # Copyright (c) 2009 the eisfair team, team(at)eisfair(dot)org> # # Creation : 2009-07-11 starwarsfan # Last update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #----------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # DO NOT REMOVE THIS LINE OF TEXT! # IT IS REQUIRED TO DISTINGUISH BETWEEN THE OLD AND NEW STYLE OF ADDITIONAL # BUILD SCRIPTS AND MUST BE LOCATED BEFORE LINE 20. # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # This function is called _before_ package build. # Fill it up with whatever you want to do before packaging the content of the # actual folder into the package archive. # ---------------------------------------------------------------------------- doPreBuildSteps () { #echo "+++++++++++++++++++++++++++++++" #echo "${packageName} custom build script in directory '`pwd`'." #echo "+++++++++++++++++++++++++++++++" # Get the package cd ${localTrunkPath}/install/_ADMIN/ ./fetch-package.sh main/l/lzma/lzma_4.43-12ubuntu1_i386.deb >/dev/null 2>&1 cd - # Copy content to where we need it cp -R $baseDir/my-fetched-packages/data/* . # Clean up extracted content rm -fr ${localTrunkPath}/install/my-fetched-packages/* # Remove not necessary content rm -fr usr/share/doc rm -fr usr/share/man rm -fr $baseDir/my-fetched-packages/* # Add content temporarily to version control to be able to create # the file list right svn -q add ./* --force # ----------------------------------------------------------------------- # Option '--no-debug' is necessary in case someone has debug mode enabled # on his build settings! ${localTrunkPath}/_ADMIN/create-list-new.sh --quiet --no-debug --no-svn -p $packageName --path $callDir return $? } # ---------------------------------------------------------------------------- # This function is called _after_ package build # Fill it up with whatever you want to do after packaging the content of the # actual folder into the package archive. # ---------------------------------------------------------------------------- doPostBuildSteps () { svn -q del ./usr --force rm -rf ./usr # Remove created file list and restore the old one rm -f ./_ADMIN/${packageName}-files.txt svn up _ADMIN } # ---------------------------------------------------------------------------- # MAIN # ---------------------------------------------------------------------------- doPreBuild=false doPostBuild=false dateToUse='' localTrunkPath='' rtc=0 # --------------- # Read parameters while [ $# -ne 0 ] do case $1 in '--pre-build' ) doPreBuild=true ;; '--post-build' ) doPostBuild=true ;; '--date' ) if [ $# -ge 2 ] then dateToUse=$2 shift fi ;; '--trunk' ) if [ $# -ge 2 ] then localTrunkPath=$2 shift fi ;; * ) ;; esac shift done # --------------------------------------------------------------------- # Here you can insert code which should always be executed _before_ the # requested additional build step: # -------------------------------------------------------------------------- # At the begin we are at the folder '...///'. This means # that on the actual folder the '_ADMIN' folder is located where this script # is stored. # set -x scriptName=`basename $0` callDir=`pwd` packageName='lzma' eislerBaseDir=/project/eis/install eislerHostname=eisler.nettworks.org homeBaseDir=$HOME/eis-install if [ -e $eislerBaseDir ] then eisler=yes baseDir=$eislerBaseDir else eisler=no baseDir=$homeBaseDir localSettings=$baseDir/settings fi # ---------------------------------------- # Now lets execute the requested functions if [ ${doPreBuild} == true ] then echo "Executing pre build steps..." doPreBuildSteps rtc=$? if [ ${rtc} -ne 0 ] then # -------------------------------------------- # PreBuildSteps failed, so we have to clean up doPostBuildSteps fi fi if [ ${doPostBuild} == true ] then echo "Executing post build steps..." doPostBuildSteps rtc=$? fi # -------------------------------------------------------------------- # Here you can insert code which should always be executed _after_ the # requested additional build step: echo "Script ${scriptName} finished, exiting with rtc ${rtc}" exit ${rtc} #---------------------------------------------------------------------------- # end #----------------------------------------------------------------------------