server/s/install

29 lines
695 B
Bash
Executable File

#!/bin/sh
ROOT=$(pwd)
while [ ! -d $ROOT/.git ]; do
ROOT=$(dirname $ROOT)
if [ "$ROOT" == "/" ; then
echo "could not find root, are you in the git repository?"
exit
fi
done
DEST=$(dirname $ROOT)/server
MACHINE=`uname -m`
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
BIN_DIR="build-$MACHINE-$CC-Debug"
cd $ROOT/$BIN_DIR
make install
[ -d $DEST/bin ] || mkdir -p $DEST/bin
install -v $ROOT/process/cron/*.cron $DEST/bin/
programs="create-orders backup-eressea run-turn"
for prg in ${programs} ; do
install -v $ROOT/process/$prg $DEST/bin/
done
crontab $ROOT/process/cron/crontab