#!/bin/sh

PREFIX=$1

cd $PREFIX/control-panel-1.0
if [ $PWD != $PREFIX/control-panel-1.0 ]; then
	echo "Bailing... directory $PREFIX/control-panel-1.0 does not exist!"
	exit 1
fi
touch .$$bogus
if [ ! -f .$$bogus ]; then
	echo "Bailing... directory $PREFIX/control-panel-1.0 not writeable!"
	exit 1
fi
rm -f .$$bogus
echo "Configuring control-panel-1.0 for prefix ${PREFIX%%/src*}"
sed "s^@@@prefix@@@^${PREFIX%%/src*}^" < Makefile.rpp > Makefile
