# $Id: Makefile,v 1.2 2002/02/12 15:08:05 connolly Exp $

#
# External stuff, i.e. stuff outside this directory
#

PYTHON=python
WGET=wget

# @@document where I got these
WGET=wget
#SAXON=/tux/u/connolly/src/saxon5
#XSLT=CLASSPATH=$(SAXON):$(SAXON)/saxon.jar java com.icl.saxon.StyleSheet

# http://www.w3.org/People/Raggett/tidy/
# http://www.w3.org/People/Raggett/tidy30apr00.tgz
TIDY=/home/connolly/src/tidy30apr00/tidy
# TIDY=tidy

XT=/home/connolly/src/xt
#XT=/tux/u/connolly/src/xt
XSLT=CLASSPATH=$(XT)/xt.jar:$(XT)/sax.jar:$(XT)/xp.jar java -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver

XMLWF=xmlwf

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

HTML2RDF=../../07/hs78/html2rdfs.xsl

email.rdf: email.html $(HTML2RDF)
	$(XSLT) email.html $(HTML2RDF) $@
	$(TIDY) -xml -i -m $@

mailContacts.n3: myMailRules.n3 recentMailFromMe.rdf recentReplies.rdf
	$(PYTHON) $(SWAP)/cwm.py myMailRules.n3 --think >$@

recentRecips.n3: recentMailFromMe.rdf recip-filter.n3
	$(PYTHON) $(SWAP)/cwm.py --rdf recentMailFromMe.rdf --n3 recip-filter.n3 --filter=recip-filter.n3 --n3 >$@

imapConn:
	echo run this: $(PYTHON) mid_proxy.py $(MAIL_PORT)
	exit 1

MAIL_PORT=5678
SVC=http://127.0.0.1:$(MAIL_PORT)

recentMailFromMe.rdf: imapConn mid_proxy.py
	$(WGET) '$(SVC)/listMessages?min=2001-06&max=2002-04&q=from+connolly%40w3.org&formal=on' -O $@

recentReplies.rdf: imapConn mid_proxy.py
	$(WGET) '$(SVC)/listMessages?min=2001-06&max=2002-04&q=or+%28header+in-reply-to+%22%40%22%29+%28header+references+%22%40%22%29&formal=on' -O $@





