#
# $Id: Makefile,v 1.26 2005/04/30 17:09:50 rader Exp $
#

PLAIN_POD = Time-HiRes.pod apachestat.pod bindstat.pod collectors.pod \
	conf-strings.pod conf-string-list.pod configuration.pod contrib.pod \
	install.pod log2rrd.pod metaconf-strings.pod metaconf.pod \
	mrtg-vs-nrg.pod mrtg2nrg.pod operation.pod readme.pod sample-conf.pod \
	sendmailstat.pod snmp.pod templates.pod net-snmp.pod upgrade.pod \
        tcpstat.pod pingdstat.pod

SUFFIXES = .pod .html .txt 

TXT = $(PLAIN_POD:.pod=.txt)
HTML = $(PLAIN_POD:.pod=.html)


all: txt html

.SUFFIXES: .html .pod .txt


publish:
	@make all
	@echo scp '*.html' changes whats-new nrg+rrd.gif ginseng:/usr/local/web/nrg.hep.wisc.edu


.pod.txt:
	@echo "creating `echo $@ | sed 's/\.txt$$//'`"
	@cat $< | perl -ane ' \
	  $$_=~ s/^\=\w+\s*(.*)$$/---- $$1 ----/; \
	  $$_=~ s/L<(\w+)>/the file \"$$1\"/; \
	  print $$_' > `echo $@ | sed 's/\.txt$$//'`

.pod.html:
	@echo "creating $@"
	@pod2html --infile=$< --outfile=$@ --noindex --htmlroot=. --podpath=. --title=$*
	@cat $@ | perl -ane '$$_=~s/the\s+(\S+)\s+manpage/$$1/g;print $$_' > $@
	@cat $@ | perl -ane '$$_=~s/background-color: white/background-color: \#C0C0C0/g;print $$_' > $@
	@rm -rf  pod2html-dircache
	@rm -rf  pod2html-itemcache


txt: $(TXT)
html: $(HTML)

