1 # Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
4 PHANTOMJS= ../node_modules/phantomjs/bin/phantomjs
6 SCREENSHOT_WIDTH_HEIGHT= 1000 1200
7 PERL_SCRIPTS= ../bin/bomb.pl
8 PROG= ../phantom/screenshot.js
9 MD5= $(shell which md5 md5sum)
10 TESTS= koha demos mike # koha.url
14 PHANTOMJS_URL= http://cph.koha.indexdata.com/cgi-bin/koha/opac-search.pl?q=sushi
15 PHANTOMJS_URL= http://www.indexdata.com/
24 rm -f ${IMAGES}/*.png.tmp
29 file=${PREFIX}.$$(echo "${PHANTOMJS_URL}" | perl -npe 's,(\W),-,g; s/-$$//;'); \
30 ${PHANTOMJS} ${PROG} ${PHANTOMJS_URL} ${IMAGES}/tmp.$$file.png ${SCREENSHOT_WIDTH_HEIGHT} ${TIMEOUT}; \
31 mv -f ${IMAGES}/tmp.$$file.png ${IMAGES}/$$file.png
33 screenshots: clean estimate-time iframe
34 for t in ${TESTS}; do \
35 for i in $$(cat url.$$t); do \
36 ${MAKE} PHANTOMJS_URL="$$i" TIMEOUT=4 PREFIX=$$t screenshot; \
38 ${MAKE} PREFIX=$$t index; \
42 @wc -l url.* | tail -n1 | awk '{print "Estimeate run time: " $$1 * (1 + '${TIMEOUT}'), "seconds" }'
46 ( cd ${IMAGES}; ls -tr ${PREFIX}.*.png | perl -ne 'chomp; print qq{<h2>$$_</h2><img src="'${IMAGES}/'$$_"/><br/><br/><p/>\n}' ) > index-${PREFIX}.html
48 iframe: index-iframe-demo
50 ( cat url.demos | perl -ne 'chomp; print qq{<h2>$$_</h2><iframe width="900px" height="600px" src="$$_"></iframe>\n}' ) > iframe-demos.html
53 @echo "make [ all | clean | distclean ]"
54 @echo " [ screenshots ]"
55 @echo " [ screenshot | index | iframe ]"
59 @echo "make TESTS=mike screenshots"