From d8c2f66c5b16e6c7577430df7f16939d0e42b9e7 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 12 Sep 2017 11:05:07 +0900 Subject: [PATCH] Initial SGML documentation support --- .gitignore | 2 ++ Makefile.in | 6 +++++ configure | 3 +++ configure.in | 1 + doc/Makefile.in | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 doc/Makefile.in diff --git a/.gitignore b/.gitignore index 732cd41a..b6109a38 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,8 @@ lib*.pc # test output /results/ +/doc/Makefile + # other /.lineno *.dSYM diff --git a/Makefile.in b/Makefile.in index 4c22a86f..f5aeb7ce 100644 --- a/Makefile.in +++ b/Makefile.in @@ -63,6 +63,12 @@ Makefile: Makefile.in config.status configure Makefile.global: Makefile.global.in config.status configure ./config.status $@ +doc: + $(MAKE) -C doc all + +install-doc: + $(MAKE) -C doc install + clean: additional-clean maintainer-clean: additional-maintainer-clean diff --git a/configure b/configure index 08d3eca4..83d34ee7 100755 --- a/configure +++ b/configure @@ -1871,6 +1871,8 @@ ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files Makefile.global" +ac_config_files="$ac_config_files doc/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -2564,6 +2566,7 @@ do "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile.global") CONFIG_FILES="$CONFIG_FILES Makefile.global" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.in b/configure.in index 3fd4f30a..1a442bb6 100644 --- a/configure.in +++ b/configure.in @@ -65,5 +65,6 @@ AC_SUBST(vpath_build) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile.global]) +AC_CONFIG_FILES([doc/Makefile]) AC_OUTPUT diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 00000000..03e193ab --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,71 @@ +repmgr_subdir = doc +repmgr_top_builddir = .. +include $(repmgr_top_builddir)/Makefile.global + +ifndef JADE +JADE = $(missing) jade +endif + +SGMLINCLUDE = -D . -D ${srcdir} + +SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged + +JADE.html.call = $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html + +ALLSGML := $(wildcard $(srcdir)/*.sgml) +# to build bookindex +ALMOSTALLSGML := $(filter-out %bookindex.sgml,$(ALLSGML)) +GENERATED_SGML = version.sgml bookindex.sgml + +Makefile: Makefile.in + cd $(repmgr_top_builddir) && ./config.status doc/Makefile + +all: html + +html: html-stamp + +html-stamp: bdr.sgml $(ALLSGML) $(GENERATED_SGML) stylesheet.dsl website-docs.css + $(MKDIR_P) html + $(JADE.html.call) -i include-index $< + cp $(srcdir)/stylesheet.css $(srcdir)/website-docs.css html/ + touch $@ + +version.sgml: ${repmgr_top_builddir}/repmgr_version.h + { \ + echo ""; \ + } > $@ + +HTML.index: bdr.sgml $(ALMOSTALLSGML) stylesheet.dsl + @$(MKDIR_P) html + $(JADE.html.call) -V html-index $< + +website-docs.css: + @$(MKDIR_P) html + curl http://www.postgresql.org/media/css/docs.css > ${srcdir}/website-docs.css + +bookindex.sgml: HTML.index +ifdef COLLATEINDEX + LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g -i 'bookindex' -o $@ $< +else + @$(missing) collateindex.pl $< $@ +endif + +clean: + rm -f html-stamp + rm -f HTML.index $(GENERATED_SGML) + +maintainer-clean: + rm -rf html + rm -rf Makefile + +zip: html + cp -r html bdr-docs-$(REPMGR_VERSION) + zip -r bdr-docs-$(REPMGR_VERSION).zip bdr-docs-$(REPMGR_VERSION) + rm -rf bdr-docs-$(REPMGR_VERSION) + +install: html + @$(MKDIR_P) $(DESTDIR)$(docdir)/$(docmoduledir)/bdr + @$(INSTALL_DATA) $(wildcard html/*.html) $(wildcard html/*.css) $(DESTDIR)$(docdir)/$(docmoduledir)/bdr + @echo Installed docs to $(DESTDIR)$(docdir)/$(docmoduledir)/bdr + +.PHONY: html all