5 echo "usage: configure <package> [options]"
15 build=$(git describe --tags 2>/dev/null)
16 test -n "$build" || build="TOP"
17 changes=$(git status -s |grep "^ *M") || true
18 test -z "$changes" || build="${build}M"
22 # to build a package you need ...
23 # <package>.cp (optional): copy step for package production
24 # <package>.cpp.sh (optional): commands to setup the C++ compile environment
39 echo "building $paket with build $build"
41 while getopts ":a" opt; do
45 \?) echo "Invalid option: -$OPTARG"
49 :) echo "Option -$OPTARG requires an argument."
56 # clean dirs and check out
57 if [ -d build -a $delete_src -eq 1 ]
63 pushd build >/dev/null
65 ln -sf /usr/share/mbuild/makefile .
74 # load util functions for C/C++ - build
75 if [ -f $paket.cpp.sh ]
78 . projects/tools/make/c_configure.sh
82 # copy package control
83 control=$(find -L src -name $paket.control)
84 build_number=${build#*_}
87 echo "warning: control file not found"
88 echo " this file is necessary for any package production."
90 sed "s/%BUILD%/$build_number/" $control |sed "s/%ARCH%/$ARCH/" >$paket.control
91 echo "$paket.control written."
94 version=$(grep Version $paket.control |sed "s/Version: //")
98 copy=$(find -L src -name $paket.cp)
103 echo "warning: file $paket.cp missing or not executable:"
104 echo " this file is necessary for any package production."
107 # check for installation scripts
108 files=$(find src -name $paket.preinst)
109 files="$files $(find -L src -name $paket.postinst)"
110 files="$files $(find -L src -name $paket.prerm)"
111 files="$files $(find -L src -name $paket.postrm)"
117 # create generic make.pre, if not existing
120 cat >>make.pre <<MAKE_PRE
121 # mBuild make.pre script (auto generated)
127 echo "arch = $ARCH" >>make.pre
128 echo "_arch = _${ARCH}" >>make.pre
130 echo "make.pre written."
133 # append version to make.pre
134 echo "version = $version" >> make.pre
135 echo "build = $build" >> make.pre