2017-12-04 16:32:37 -06:00
|
|
|
CONFDIR = ${pkgdir}/usr/local/etc/TheRaven
|
|
|
|
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash
|
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/
|
|
|
|
if [ ! -d ${pkgdir}/usr/local/src/SharedLibraries ]; then git -C ${pkgdir}/usr/local/src/ clone https://aninix.net/foundation/SharedLibraries; fi
|
|
|
|
git -C ${pkgdir}/usr/local/src/SharedLibraries pull
|
|
|
|
mcs -out:raven.mono ${pkgdir}/usr/local/src/SharedLibraries/CSharp/*.csharp *.csharp Raven.csharp
|
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
|
|
|
|
2016-09-27 10:33:41 -05:00
|
|
|
install: compile
|
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
|
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
|
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
|