#!/bin/sh

echo "making dirs"
mkdir /etc/jsb
mkdir /var/log/jsb
chown jsb:jsb /var/log/jsb
mkdir /var/run/jsb
chown jsb:jsb /var/run/jsb
mkdir /var/cache/jsb
chown jsb:jsb /var/cache/jsb
mkdir /usr/lib/jsb
chown jsb:jsb /usr/lib/jsb
echo "running setup.py"
python setup.py install
echo "copying files"
cp files/debian/init.d/jsonbot /etc/init.d/
cp files/debian/default/jsonbot /etc/default/
cd files/debian/man
if [ -f jsb.1 ] ; then gzip *.1
fi
cp *.gz /usr/share/man/man1
echo "done"
