Files
TheRaven/Makefile
T

41 lines
1.7 KiB
Makefile
Raw Normal View History

CONFDIR = /usr/local/etc/TheRaven
2017-02-08 19:26:13 -06:00
INSTALLER != bash -c `curl -s https://aninix.net/foundation/installer-test.bash`
2016-09-27 10:33:41 -05:00
2017-02-08 19:26:13 -06:00
compile: clean ./chatbot-support.bash ./math-support.bash
if [ ! -x /usr/bin/mcs ] || [ ! -x /usr/bin/mono ] || [ ! -x /usr/bin/lynx ] || [ ! -x /usr/bin/bash ] || [ ! -x /usr/bin/wget ]; then ${INSTALLER} mono wget lynx bash; fi
# Hook to use Djinni for notification
2016-09-27 10:33:41 -05:00
if [ ! -d ../Djinni ]; then git clone -C '..' https://aninix.net/foundation/Djinni; fi
git -C ../Djinni pull
2017-02-08 19:26:13 -06:00
cd /usr/local/src/Djinni; make install
2016-09-27 10:33:41 -05:00
if [ ! -d ../SharedLibraries ]; then git clone -C '..' https://aninix.net/foundation/SharedLibraries; fi
git -C ../SharedLibraries pull
mcs -out:raven.mono ../SharedLibraries/CSharp/*.csharp *.csharp Raven.csharp
2016-08-04 11:08:14 -05:00
clean:
for i in raven.mono; do if [ -f $$i ]; then rm $$i; fi; done
2016-08-04 11:08:14 -05:00
2016-09-27 10:33:41 -05:00
test: compile
script -c "mono ./raven.mono -c raven-test.conf -v" /tmp/raven-test.log
2016-08-04 11:08:14 -05:00
2016-09-27 10:33:41 -05:00
install: compile
2016-08-04 11:08:14 -05:00
cp raven.mono /opt/raven.mono
2017-02-08 19:26:13 -06:00
if [ ! -d ${CONFDIR} ]; then mkdir -p /usr/local/etc/TheRaven; cp ./sample-conf/* ${CONFDIR}; fi
# Hook to deprivilege bot
2016-09-27 10:33:41 -05:00
if ! getent passwd raven; then useradd -M -G git,ircd,api -d ${CONFDIR} raven; fi
make checkperm
2017-02-08 19:26:13 -06:00
# Hook for Heartbeat
if [ -f /usr/local/etc/Heartbeat/services.list ] && [ `grep -c TheRaven /usr/local/etc/Heartbeat/services.list` -eq 0 ]; then echo "" >> /usr/local/etc/Heartbeat/services.list; fi
# Hook for Systemd
2016-08-04 11:08:14 -05:00
cp ./raven.service /usr/lib/systemd/system/raven.service
systemctl daemon-reload
systemctl enable raven
2016-09-27 10:33:41 -05:00
reverse: /usr/lib/systemd/system/raven.service
cp /usr/lib/systemd/system/raven.service .
checkperm: /opt/raven.mono
chown -R raven:raven /opt/raven.mono ${CONFDIR}*
chmod 0600 /opt/raven.mono ${CONFDIR}*/*
chmod 0700 ${CONFDIR}*