.SUFFIXES: .txt .1 .5 .html .pod
.1.txt:
	@echo "nroff -man $*.1|sed -e 's,.^H,,g' > $*.txt"
	@if [ -r "$*.1" ] ; then i="$*.1" ; else i="SRCDIR/$*.1" ; fi ; \
	if ( nroff -man "$$i"|cat -s|$(SED) -e 's,.,,g' \
		-e 's,\(djvu[a-z][a-z]*\)([15]),\1.txt,g' \
		> "$*.txt" ) ; \
	then $(TRUE) ; else \
		$(RM) -f "$*.txt" ; \
		exit 1 ; \
	fi

.5.txt:
	@echo "nroff -man $*.5|sed -e 's,.^H,,g' > $*.txt"
	@if [ -r "$*.5" ] ; then i="$*.5" ; else i="SRCDIR/$*.5" ; fi ; \
	if ( nroff -man "$$i"|cat -s|$(SED) -e 's,.,,g' \
		-e 's,\(djvu[a-z][a-z]*\)([15]),\1.txt,g' \
		> "$*.txt" ) ; \
	then $(TRUE) ; else \
		$(RM) -f "$*.txt" ; \
		exit 1 ; \
	fi

.pod.1:
	@echo "pod2man --section=1 $*.pod > $*.1"
	@if [ -r "$*.pod" ] ; then d="."; else d=SRCDIR; fi ; \
	if ( ( cd "$$d";pod2man --section=1 --release=" " --center=" " --date=" " "$*.pod" ) > "$*.1" ) ; \
	then $(TRUE) ; else \
		$(RM) -f "$*.1" ; \
		exit 1 ; \
	fi	

.pod.5:
	@echo "pod2man --section=5 $*.pod > $*.5"
	@if [ -r "$*.pod" ] ; then d="."; else d=SRCDIR; fi ; \
	if ( ( cd "$$d";pod2man --section=5 --release=" " --center=" " --date=" " "$*.pod" ) > "$*.5" ) ; \
	then $(TRUE) ; else \
		$(RM) -f "$*.5" ; \
		exit 1 ; \
	fi	

.pod.html:
	@echo "pod2html --infile=$*.pod --outfile=$*.html"
	@if [ -r "$*.pod" ] ; then i="$*.pod" ; else i="SRCDIR/$*.pod" ; fi ; \
	pod2html --infile="$$i" --outfile="$*.tmp"
	if ( $(SED) \
		-e 's,^<BODY>,<BODY BGCOLOR=\#fefefe BACKGROUND="back.jpg">,' \
		-e 's,H1>,H3>,g' \
		-e 's,\(djvu[a-z][a-z]*\)\(([15])\),<A HREF=\1.html>\1\2</A>,g' \
		< "$*.tmp" > "$*.html" ) ; \
	then $(RM) -f "$*.tmp" pod2html-* ; else $(RM) -f "$*.tmp" "$*.html" pod2html-* ; exit 1 ; fi


