5         echo "usage: configure <package> <revision> [options]"
 
   6         echo "  -b <branch-rev>"
 
   8         echo "  -g <alternative repository>"
 
   9         echo "  -n : do not delete src dir"
 
  12 # to build a package you need ...
 
  13 # <package>.co: checkout commands
 
  14 # <package>.cp (optional): copy step for package production
 
  15 # <package>.cpp.sh (optional): commands to setup the C++ compile environment
 
  31 while getopts ":a:b:g:n" opt; do
 
  37                 g) alt_repos="-g $OPTARG"
 
  41                 \?) echo "Invalid option: -$OPTARG"
 
  45                 :) echo "Option -$OPTARG requires an argument."
 
  52 ln -sf projects/tools/make/makefile .
 
  54 # check standard files
 
  57         echo "file $paket.co missing or not executable."
 
  61 # clean dirs and check out
 
  62 if [ -d src -a $delete_src -eq 1 ]
 
  79         ../$paket.co $alt_repos $build 
 
  82 # load util functions for C/C++ - build
 
  83 if [ -f $paket.cpp.sh ]
 
  86         . projects/tools/make/c_configure.sh
 
  90 # copy package control
 
  91 control=$(find -L src -name $paket.control)
 
  92 build_number=${build#*_}
 
  95         echo "warning: control file not found"
 
  96         echo "  this file is necessary for any package production."
 
  98         sed "s/%BUILD%/$build_number/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
 
  99         echo "$paket.control written."
 
 102         version=$(grep Version $paket.control |sed "s/Version: //")
 
 105 # check for copy file
 
 106 copy=$(find -L src -name $paket.cp)
 
 111         echo "warning: file $paket.cp missing or not executable:"
 
 112         echo "  this file is necessary for any package production."
 
 116 postinst=$(find -L src -name $paket.postinst)
 
 117 if [ -n "$postinst" ]
 
 122 # create generic make.pre, if not existing
 
 125         cat  >>make.pre <<MAKE_PRE
 
 126 # mBuild make.pre script (auto generated)
 
 130         echo "make.pre written."
 
 133 # append version to make.pre
 
 134 echo "version = $version" >> make.pre
 
 135 echo "build = $build" >> make.pre