Description: install the user manual
 This patch builds the info, html and pdf version of the user manual.
 They are also moved/renamed to fit Debian's conventions. The
 PG-adapting manual is not included in any package.

Author: Hendrik Tews <hendrik@askra.de>
--- a/Makefile
+++ b/Makefile
@@ -112,7 +112,7 @@
 ##
 ## Remove generated targets
 ##
-clean:	cleanpgscripts
+clean:	cleanpgscripts clean-prepared-doc
 	rm -f $(ELC) *~ */*~ .\#* */.\#* */.autotest.log */.profile.log
 	(cd doc; $(MAKE) clean)
 
@@ -209,6 +209,20 @@
 doc.%: FORCE
 	(cd doc; $(MAKE) EMACS=$(EMACS) $*)
 
+
+# The install-doc target above is the upstream target. The following
+# target builds the user manual and renames the files, such that
+# dh_installdocs will work.
+.PHONY: prepare-doc
+prepare-doc: doc.info doc.pdf doc.html
+	mv doc/ProofGeneral doc/html
+	mv doc/ProofGeneral.pdf doc/proofgeneral.pdf
+	mv doc/ProofGeneral.info doc/proofgeneral.info
+
+.PHONY: clean-prepared-doc
+clean-prepared-doc:
+	rm -rf doc/html doc/proofgeneral.pdf doc/proofgeneral.info
+
 ##
 ## scripts: try to patch bash and perl scripts with correct paths
 ##
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -19,7 +19,6 @@
 	$(MAKE) doc
 
 %:
-	$(MAKE) -f Makefile.doc DOCNAME=PG-adapting MAKE="$(MAKE) -f Makefile.doc" $@
 	$(MAKE) -f Makefile.doc DOCNAME=ProofGeneral MAKE="$(MAKE) -f Makefile.doc" $@ 
 
 ##
