Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 51 lines (35 sloc) 955 Bytes
#!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir>
set -e
set -o pipefail
BUILD_DIR=$1
CACHE_DIR=$2
BUILDPACKS_DIR=$(dirname $(dirname $0))
function indent() {
sed -u 's/^/ /'
}
error() {
echo " ! $*" >&2
exit 1
}
cd $BUILD_DIR
if [[ ! -f cppcms.js ]] ; then
error "could not find `cppcms.js`, which is required for this buildpack."
fi
CPPCMS_VERSION=1.0.5
TARBALL="${BUILDPACKS_DIR}/vendor/${CF_STACK}/cppcms-${CPPCMS_VERSION}-linux-x64.tgz"
if [[ ! -f $TARBALL ]] ; then
ls ${BUILDPACKS_DIR}/vendor/${CF_STACK}
error "could not find a cppcms libary for the '${CF_STACK}' stack."
fi
mkdir -p cppcms
tar -m --directory cppcms -zxf $TARBALL
if [[ -f configure ]] ; then
echo "-----> configuring ..."
./configure | indent
fi
echo "-----> compiling with make ..."
make | indent
echo "-----> setting up .profile.d ..."
mkdir -p ${BUILD_DIR}/.profile.d
cp ${BUILDPACKS_DIR}/bin/cppcms.sh ${BUILD_DIR}/.profile.d