

LANGUAJE = english
# Adjust this based on the location of your webml copy (if you have one)
WEBWML   = /home/jfs/debian/www/webwml/$(LANGUAJE)

FILES= \
bug-log-access.txt          bug-maint-info.txt         constitution.txt \
bug-log-mailserver.txt      bug-maint-mailcontrol.txt  \
bug-mailserver-refcard.txt  bug-reporting.txt          
# Currently disabled, need to check:
# mailing-lists.txt  social-contract.txt

all: $(FILES)

clean:
	-rm -f $(FILES) *.html 
realclean: clean
	-rm -f *.wml

%.html: %.wml
	wml -q $< >$@

%.txt: %.html
	lynx -dump -nolist $< >$@

# These rules are conditioned to the existence of $(WEBWML)
# so that the package can be built regardless of its existence
# Warning: hack
webwmlexists := $(shell ls -d $(WEBWML) 2>/dev/null)

ifneq "$(webwmlexists)" ""
bug-log-access.wml: $(WEBWML)/Bugs/Access.wml
	cat $<  |grep -v ^# >$@
bug-log-mailserver.wml: $(WEBWML)/Bugs/server-request.wml
	cat $<  |grep -v ^# >$@
bug-mailserver-refcard.wml: $(WEBWML)/Bugs/server-refcard.wml
	cat $<  |grep -v ^# >$@
bug-maint-info.wml: $(WEBWML)/Bugs/Developer.wml
	cat $<  |grep -v ^# >$@
bug-maint-mailcontrol.wml: $(WEBWML)/Bugs/server-control.wml
	cat $<  |grep -v ^# >$@
bug-reporting.wml: $(WEBWML)/Bugs/Reporting.wml
	cat $<  |grep -v ^# >$@
constitution.wml: $(WEBWML)/devel/constitution.wml
	cat $<  |grep -v ^# >$@
mailing-lists.wml:  $(WEBWML)/MailingLists/subscribe.wml
	cat $<  |grep -v ^# >$@
social-contract.wml:  $(WEBWML)/social_contract.wml
	cat $<  |grep -v ^# >$@
endif

# Not in Debian's website:
# source-unpack.txt
# debian-manifesto
