5 echo "usage: configure <package> <revision> [options]"
6 echo " -b <branch-rev>"
10 # to build a package you need ...
11 # <package>.co: checkout commands
12 # <package>.cp (optional): copy step for package production
13 # <package>.cpp.sh (optional): commands to setup the C++ compile environment
27 while getopts "b:a:" opt
32 b) echo "branching not implemented"
39 # checkout build utilities
40 if [ ! -d projects ]; then
41 git clone https://github.com/wagner-tech/projects/
43 ln -sf projects/tools/make/makefile .
45 # check standard files
48 echo "file $paket.co missing or not executable."
52 # clean dirs and check out
55 echo "Shall I delete src dir? [y]/n"
78 # load util functions for C/C++ - build
79 if [ -f $paket.cpp.sh ]
82 . projects/tools/make/c_configure.sh
86 # copy package control
87 control=$(find src -name $paket.control)
90 echo "warning: control file not found"
91 echo " this file is necessary for any package production."
93 sed "s/%BUILD%/$build/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
94 echo "$paket.control written."
97 version=$(grep Version $paket.control |sed "s/Version: //")
100 # check for copy file
101 copy=$(find src -name $paket.cp)
106 echo "warning: file $paket.cp missing or not executable:"
107 echo " this file is necessary for any package production."
111 postinst=$(find src -name $paket.postinst)
112 if [ -n "$postinst" ]
117 # create generic make.pre, if not existing
120 cat >>make.pre <<MAKE_PRE
121 # mBuild make.pre script (auto generated)
125 echo "make.pre written."
128 # append version to make.pre
129 echo "version = $version" >> make.pre