2009-09-29 15:36:25 -06:00
|
|
|
DESTDIR = target
|
|
|
|
|
2009-10-15 15:22:07 -06:00
|
|
|
PYDIR = $(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
|
|
|
|
|
|
|
|
all: ctf.tce
|
|
|
|
|
2009-10-15 15:22:07 -06:00
|
|
|
push: ctf.tce
|
|
|
|
netcat -l -q 0 -p 3333 < ctf.tce
|
|
|
|
|
|
|
|
target:
|
2009-09-29 15:36:25 -06:00
|
|
|
$(INSTALL) -d --mode=0755 --owner=100 $(DESTDIR)/var/lib/ctf
|
2009-10-07 15:45:02 -06:00
|
|
|
|
|
|
|
$(INSTALL) -d --mode=0755 --owner=100 $(DESTDIR)/var/lib/ctf/survey
|
|
|
|
|
2009-09-29 15:36:25 -06:00
|
|
|
$(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-15 15:22:07 -06:00
|
|
|
$(INSTALL) -d $(PYDIR)/ctf
|
|
|
|
$(INSTALL) ctf/*.py $(PYDIR)/ctf
|
2009-10-05 13:33:20 -06:00
|
|
|
|
2009-10-09 08:47:19 -06:00
|
|
|
$(INSTALL) -d $(DESTDIR)/usr/lib/python2.6/site-packages/ctf
|
|
|
|
$(INSTALL) ctf/__init__.py $(DESTDIR)/usr/lib/python2.6/site-packages/ctf
|
|
|
|
$(INSTALL) ctf/config.py $(DESTDIR)/usr/lib/python2.6/site-packages/ctf
|
|
|
|
|
2009-10-05 13:33:20 -06:00
|
|
|
$(INSTALL) -d $(DESTDIR)/usr/sbin
|
|
|
|
$(INSTALL) ctfd.py $(DESTDIR)/usr/sbin
|
2009-10-07 11:10:18 -06:00
|
|
|
$(INSTALL) new-contest $(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
|
2009-10-15 15:22:07 -06:00
|
|
|
rm -f fake ctf.tce
|
2009-09-29 15:36:25 -06:00
|
|
|
|
2009-10-05 13:33:20 -06:00
|
|
|
ctf/%.pyc: ctf/%.py
|
|
|
|
python3 -c 'from ctf import $(notdir $*)'
|
|
|
|
|
|
|
|
%.pyc: ctf/%.pyc
|
|
|
|
cp $< $@
|