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 src -name $paket.control)
94 echo "warning: control file not found"
95 echo " this file is necessary for any package production."
97 sed "s/%BUILD%/$build/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
98 echo "$paket.control written."
101 version=$(grep Version $paket.control |sed "s/Version: //")
104 # check for copy file
105 copy=$(find src -name $paket.cp)
110 echo "warning: file $paket.cp missing or not executable:"
111 echo " this file is necessary for any package production."
115 postinst=$(find src -name $paket.postinst)
116 if [ -n "$postinst" ]
121 # create generic make.pre, if not existing
124 cat >>make.pre <<MAKE_PRE
125 # mBuild make.pre script (auto generated)
129 echo "make.pre written."
132 # append version to make.pre
133 echo "version = $version" >> make.pre
134 echo "build = $build" >> make.pre