3.4 Editing the build file during pre-build

You can edit the ‘build’ file during pre-build. The file is copied from the repository to the build directory named as ‘.build.cpt’. You can use ‘sed’ or any other tool to edit the build file. After the build is complete, a ‘diff’ file will be placed to the package database named as ‘build.diff’. Here is an example ‘build’ file manipulation during the pre-build hook.

cat <<EOF> .build.cpt
#!/bin/sh -e

for patch in bash50-0??; do
    patch -p0 < "\$patch"
done

export LDFLAGS=-static

./configure \
    --prefix=/usr \
    --without-bash-malloc \
    --disable-nls

export MAKEFLAGS="TERMCAP_LIB=/usr/lib/libncursesw.a $MAKEFLAGS"

make
make DESTDIR="\$1" install

ln -s bash "\$1/usr/bin/sh"
EOF