moth/Makefile

57 lines
1.5 KiB
Makefile
Raw Normal View History

2009-09-29 15:36:25 -06:00
DESTDIR = target
2009-10-05 13:33:20 -06:00
PYCDIR = $(DESTDIR)/usr/lib/python3.1/site-packages
2009-09-29 15:36:25 -06:00
CTFDIR = $(DESTDIR)/usr/lib/ctf
WWWDIR = $(DESTDIR)/usr/lib/www
FAKE = fakeroot -s fake -i fake
INSTALL = $(FAKE) install
2009-10-05 13:33:20 -06:00
PYC = __init__.pyc
PYC += config.pyc points.pyc teams.pyc
2009-09-29 15:36:25 -06:00
PYC += register.pyc scoreboard.pyc puzzler.pyc
PYC += flagd.pyc pointsd.pyc pointscli.pyc
2009-10-05 16:51:45 -06:00
PYC += histogram.pyc irc.pyc
2009-09-29 15:36:25 -06:00
all: ctf.tce
target: $(PYC)
$(INSTALL) -d --mode=0755 --owner=100 $(DESTDIR)/var/lib/ctf
$(INSTALL) -d $(DESTDIR)/var/lib/ctf/disabled
2009-10-01 13:52:34 -06:00
touch $(DESTDIR)/var/lib/ctf/disabled/survey
2009-09-29 15:36:25 -06:00
2009-10-05 13:33:20 -06:00
$(INSTALL) -d $(PYCDIR)/ctf
$(INSTALL) $(PYC) $(PYCDIR)/ctf
$(INSTALL) -d $(DESTDIR)/usr/sbin
$(INSTALL) ctfd.py $(DESTDIR)/usr/sbin
2009-09-29 15:36:25 -06:00
$(INSTALL) -d $(WWWDIR)
2009-10-01 12:17:03 -06:00
$(INSTALL) index.html intro.html ctf.css grunge.png $(WWWDIR)
2009-09-29 15:36:25 -06:00
$(FAKE) ln -s /var/lib/ctf/histogram.png $(WWWDIR)
$(INSTALL) register.cgi scoreboard.cgi puzzler.cgi $(WWWDIR)
$(INSTALL) -d $(DESTDIR)/var/service/ctf
2009-09-30 13:58:16 -06:00
$(INSTALL) run.ctfd $(DESTDIR)/var/service/ctf/run
2009-09-29 15:36:25 -06:00
2009-10-01 12:17:03 -06:00
$(INSTALL) -d $(DESTDIR)/var/service/ctf/log
$(INSTALL) run.log.ctfd $(DESTDIR)/var/service/ctf/log/run
2009-09-29 15:36:25 -06:00
rm -rf $(WWWDIR)/puzzler
$(INSTALL) -d $(WWWDIR)/puzzler
2009-10-05 13:33:20 -06:00
$(INSTALL) -d $(CTFDIR)
2009-09-29 15:36:25 -06:00
./mkpuzzles.py --htmldir=$(WWWDIR)/puzzler --keyfile=$(CTFDIR)/puzzler.keys
ctf.tce: target
$(FAKE) sh -c 'cd target && tar -czf - --exclude=placeholder --exclude=*~ .' > $@
clean:
rm -rf target
rm -f fake ctf.tce $(PYC)
2009-10-05 13:33:20 -06:00
ctf/%.pyc: ctf/%.py
python3 -c 'from ctf import $(notdir $*)'
%.pyc: ctf/%.pyc
cp $< $@