X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zebra%2FMakefile;h=35a4a2584a0664af03d2524be57e7ae76678152c;hb=45c7ffc5aa4562b03a9add900b463d6eca2bae12;hp=0e24ddd1d071006ee88653508c4e109f5b1dc419;hpb=1f7d32fe1763d1d22ba3464d2251775101fa4833;p=irspy-moved-to-github.git diff --git a/zebra/Makefile b/zebra/Makefile index 0e24ddd..35a4a25 100644 --- a/zebra/Makefile +++ b/zebra/Makefile @@ -1,10 +1,14 @@ -IRSPY_ARCHIVE= records-2010-04-06 +IRSPY_ARCHIVE= records-2013-08-13 IRSPY_ARCHIVE_EXT= .tar.gz DUMP_DIR= irspy-dump ZEBRA_DIR= db ZEBRAIDX= zebraidx-2.0 ZEBRAIDX_TEST= zebraidx-2.0 -c zebra-test.cfg +IRSPY_DATABASE= $${IRSpyDbName-"localhost:8018/IR-Explain---1"} +ZEBRA_LOGFILE= irspy-zebra.log +ZEBRA_PID_FILE= ${ZEBRA_DIR}/lock/zebrasrv.pid + # debugging ZEBRA_TEST_DIR= db-test @@ -36,19 +40,44 @@ newdb-test: ${ZEBRAIDX_TEST} update ${IRSPY_ARCHIVE} ${ZEBRAIDX_TEST} commit +# note: the test database use localhost:8019/IR-Explain---1 dump: rm -rf records-${DATE}.old -test -e records-${DATE} && mv records-${DATE} records-${DATE}.old mkdir records-${DATE} - cd records-${DATE} && ../../bin/irspy-dump.pl irspy.indexdata.com:8018/IR-Explain---1 - tar cfz records-${DATE} records-${DATE} + cd records-${DATE} && ../../bin/irspy-dump.pl ${IRSPY_DATABASE} + cd records-${DATE}; find . -name '*.xml' -print0 | \ + xargs -n1 -0 -P4 tidy -xml -i -m -w 140 > /dev/null 2>&1 + tar cf - records-${DATE} | gzip > records-${DATE}.tar.gz clean: rm -f terse.properties +check-running-zebrasrv: + @if zoomsh -e "open localhost:8018" "quit" >/dev/null; then \ + echo ""; \ + echo "There is already a running zebrasrv on localhost:8018"; \ + echo "You may need to run: killall zebrasrv-2.0"; \ + false; \ + else \ + true; \ + fi + +start-zebra: check-running-zebrasrv + zebrasrv-2.0 -f $$(pwd)/yazserver.xml > ${ZEBRA_LOGFILE} 2>&1 & + +stop-zebra: + kill `cat ${ZEBRA_PID_FILE}` + sleep 0.5 + -kill -9 `cat ${ZEBRA_PID_FILE}` + +check: newdb start-zebra dump stop-zebra distclean + distclean: clean - rm -rf ${IRSPY_ARCHIVE} ${ZEBRA_DIR} ${ZEBRA_DIR} + rm -rf ${IRSPY_ARCHIVE} ${ZEBRA_DIR} ${ZEBRA_DIR} ${ZEBRA_TEST_DIR} ${ZEBRA_LOGFILE} help: - @echo "make [ dump | test | newdb | newdb-test | clean | distclean ]" + @echo "make [ newdb | newdb-test | dump | check ]" + @echo " [ start-zebra | stop-zebra ]" + @echo " [ clean | distclean ]"