# $Id: Makefile,v 1.5 2004/10/14 02:48:42 connolly Exp $

MKDIR=mkdir

RSYNC=rsync
PYTHON=python
PERL=perl

W=../../..
SWAP=$(W)/2000/10/swap
CHATTY=15


lc-status-report.html: lc-status-report-f.n3
	$(PYTHON) $(SWAP)/cwm.py lc-status-report-f.n3 --strings | $(PERL) -pe 's/&/&amp;/' >$@

lc-status-report-f.n3: lc-status-report-rules.n3 lc-threads.n3 telcon-13Sep.n3 tel-20Sep.n3
	$(PYTHON) $(SWAP)/cwm.py --chatty=$(CHATTY) lc-status-report-rules.n3 --n3 --think >$@

lc-status.n3: lc-threads.n3 lc-audit.n3
	$(PYTHON) $(SWAP)/cwm.py --chatty=$(CHATTY) lc-audit.n3 --think --data >$@

lc-threads.n3: lc-comment-rules.n3 webarch-lc-comments.rdf mase-ref-fix.n3 implicit-refs.n3 webarch-lc-comments-rsync.rdf 
	$(PYTHON) $(SWAP)/cwm.py --chatty=$(CHATTY) mase-ref-fix.n3 lc-comment-rules.n3 webarch-lc-comments.rdf webarch-lc-comments-rsync.rdf implicit-refs.n3 --think --data --n3 >$@

# @@MASE/RDF bug?
#  <mbox rdf:resource="mailto:&#60;Patrick.Stickler@nokia.com&#62;"/>
webarch-lc-comments.rdf:
	$(PYTHON) $(SWAP)/cwm.py --base=bogus: 'http://www.w3.org/Search/Mail/Public/advanced_search?keywords=webarch&hdr-1-name=subject&hdr-1-query=&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&resultsperpage=2000&sortby=date&index-grp=Public__FULL&index-type=t&type-index=public-webarch-comments' --rdf \
	| $(PERL) -pe 's/&#60;([^@]+@[^&]+)&#62;/$$1/g'>$@



webarch-lc-comments-rsync.rdf: webarch-comments.timestamp $(W)/2000/04/maillog2rdf/aboutMsg.py
	PYTHONPATH=$(SWAP) $(PYTHON) $(W)/2000/04/maillog2rdf/aboutMsg.py --since 2004-08-16 --mh webarch-comments >$@


webarch-comments.timestamp:
	$(MKDIR) -p webarch-comments
	echo copy from lists.w3.org manually first...
	$(RSYNC) -av -e ssh connolly@homer.w3.org:webarch-comments/ webarch-comments/
	@touch webarch-comments.timestamp

