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."
115 # check for installation scripts
116 files=$(find -L src -name $paket.preinst)
117 files="$files $(find -L src -name $paket.postinst)"
118 files="$files $(find -L src -name $paket.prerm)"
119 files="$files $(find -L src -name $paket.postrm)"
125 # create generic make.pre, if not existing
128 cat >>make.pre <<MAKE_PRE
129 # mBuild make.pre script (auto generated)
133 echo "make.pre written."
136 # append version to make.pre
137 echo "version = $version" >> make.pre
138 echo "build = $build" >> make.pre