PSQL=psql -q -1 --set ON_ERROR_STOP=1 -d news default: test all: postgres configdl: active newsgroups control.ctl reset: stop preserve start load: stop newsdb schema activesync start active newsgroups: wget -N ftp://ftp.isc.org/pub/usenet/CONFIG/$@.bz2 bzip2 -dfk $@.bz2 control.ctl: wget -N ftp://ftp.isc.org/pub/usenet/CONFIG/$@ newsdb: -dropdb news createdb -O news -T template0 -E SQL_ASCII news $(PSQL) -c 'alter database news set search_path to nntp,public' $(PSQL) -c 'alter database news set client_min_messages to warning' preserve: sudo su -c 'psql -1 --set ON_ERROR_STOP=1 -U news -d news -f preserve.sql' news activesync: loadactive loadnewsgroups loadactive: active cat active | DBI_DSN='dbi:Pg:dbname=news' perl convactive touch $@ loadnewsgroups: newsgroups cat newsgroups |DBI_DSN='dbi:Pg:dbname=news' perl convnewsgroups touch $@ testserver: -test -f newsd.pid && kill `cat newsd.pid` rm -f news.log PERL5LIB=./Net-Server-NNTP/lib ./newsd conf_file=test.conf test: -test -f newsd.pid && kill `cat newsd.pid` rm -f news.log PERL5LIB=./Net-Server-NNTP/lib ./newsd conf_file=t/test.conf sleep 1 -prove t/*.t -test -f newsd.pid && kill `cat newsd.pid` vtest: -test -f newsd.pid && kill `cat newsd.pid` rm -f news.log PERL5LIB=./Net-Server-NNTP/lib ./newsd conf_file=t/test.conf sleep 1 -prove -v t/*.t -test -f newsd.pid && kill `cat newsd.pid` schema: (echo 'set role news;'; cat schema.sql) | $(PSQL) startsingle: sudo ./newsd log_level=3 server_type=Single start: sudo ./newsd log_level=2 stop: -sudo sh -c "kill `cat /var/run/news/newsd.pid`" restart: stop start .PHONY: active newsgroups control.ctl configdl