2017-12-04 16:32:37 -06:00
|
|
|
CONFDIR = ${pkgdir}/usr/local/etc/TheRaven
|
2016-09-27 10:33:41 -05:00
|
|
|
|
2017-12-04 16:32:37 -06:00
|
|
|
compile: clean ./chatbot-support.bash ./math-support.bash /usr/sbin/pb
|
|
|
|
mkdir -p ${pkgdir}/usr/local/src/
|
2018-07-27 14:01:22 -05:00
|
|
|
(mcs -out:raven.mono /opt/aninix/SharedLibraries/CSharp/*.csharp *.csharp Raven.csharp 2>&1 | grep -v CS2002); printf ""
|
2016-08-04 11:08:14 -05:00
|
|
|
|
|
|
|
clean:
|
2016-12-04 19:55:52 -06:00
|
|
|
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
|
2017-12-04 16:32:37 -06:00
|
|
|
script -c "mono ./raven.mono -c raven-test.conf -v" ${pkgdir}/tmp/raven-test.log
|
2016-08-04 11:08:14 -05:00
|
|
|
|
2018-07-27 14:01:22 -05:00
|
|
|
install: compile /usr/sbin/pwgen
|
2017-12-04 16:32:37 -06:00
|
|
|
mkdir -p ${pkgdir}/opt
|
|
|
|
cp raven.mono ${pkgdir}/opt/raven.mono
|
|
|
|
if [ ! -d ${CONFDIR} ]; then mkdir -p ${CONFDIR}; cp sample-confs/* ${CONFDIR}; fi
|
2017-02-08 19:26:13 -06:00
|
|
|
# Hook to deprivilege bot
|
2018-07-27 14:01:22 -05:00
|
|
|
if ! getent passwd raven; then useradd -M -G git,ircd,api -d ${CONFDIR} raven; fi
|
|
|
|
echo "raven:$$(/usr/sbin/pwgen 24 1)" | chpasswd;
|
2016-09-27 10:33:41 -05:00
|
|
|
make checkperm
|
2017-02-08 19:26:13 -06:00
|
|
|
# Hook for Heartbeat
|
2017-12-04 16:32:37 -06:00
|
|
|
if [ -f ${pkgdir}/usr/local/etc/Heartbeat/services.list ] && [ `grep -c TheRaven ${pkgdir}/usr/local/etc/Heartbeat/services.list` -eq 0 ]; then echo "" >> ${pkgdir}/usr/local/etc/Heartbeat/services.list; fi
|
2017-02-08 19:26:13 -06:00
|
|
|
# Hook for Systemd
|
2017-12-04 16:32:37 -06:00
|
|
|
mkdir -p ${pkgdir}/usr/lib/systemd/system/
|
|
|
|
cp /usr/local/src/TheRaven/raven.service ${pkgdir}/usr/lib/systemd/system/raven.service
|
2016-09-27 10:33:41 -05:00
|
|
|
|
2017-12-04 16:32:37 -06:00
|
|
|
reverse: ${pkgdir}/usr/lib/systemd/system/raven.service
|
|
|
|
cp ${pkgdir}/usr/lib/systemd/system/raven.service .
|
2016-09-27 10:33:41 -05:00
|
|
|
|
2017-12-04 16:32:37 -06:00
|
|
|
checkperm: ${pkgdir}/opt/raven.mono
|
|
|
|
chown -R raven:raven ${pkgdir}/opt/raven.mono ${CONFDIR}*
|
|
|
|
chmod 0600 ${pkgdir}/opt/raven.mono ${CONFDIR}*/*
|
2016-09-27 10:33:41 -05:00
|
|
|
chmod 0700 ${CONFDIR}*
|
|
|
|
|
2017-12-04 16:32:37 -06:00
|
|
|
diff:
|
|
|
|
diff ./raven.service ${pkgdir}/usr/lib/systemd/system/raven.service
|
|
|
|
diff ./sample.conf ${pkgdir}/usr/local/etc/TheRaven/raven.conf
|