diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 4f0e39223c..b96c7cbf22 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -41,11 +41,15 @@ endif XMLINCLUDE = --path . -ifndef XMLLINT +ifdef XMLLINT +XMLLINT := $(XMLLINT) --nonet +else XMLLINT = $(missing) xmllint endif -ifndef XSLTPROC +ifdef XSLTPROC +XSLTPROC := $(XSLTPROC) --nonet +else XSLTPROC = $(missing) xsltproc endif diff --git a/doc/src/sgml/docguide.sgml b/doc/src/sgml/docguide.sgml index 787caef70d..35c4afc81a 100644 --- a/doc/src/sgml/docguide.sgml +++ b/doc/src/sgml/docguide.sgml @@ -136,6 +136,7 @@ This is a program for converting, among other things, XML to PDF. + It is needed only if you want to build the documentation in PDF format. @@ -151,25 +152,13 @@ here. - - You can get away with not installing DocBook XML and the DocBook XSLT - stylesheets locally, because the required files will be downloaded from the - Internet and cached locally. This may in fact be the preferred solution if - your operating system packages provide only an old version of these files, - or if no packages are available at all. - If you want to prevent any attempt to access the Internet while building - the documentation, you need to pass the option - to xmllint and xsltproc; see below - for an example. - - Installation on Fedora, RHEL, and Derivatives To install the required packages, use: -yum install docbook-dtds docbook-style-xsl fop libxslt +yum install docbook-dtds docbook-style-xsl libxslt fop @@ -180,7 +169,7 @@ yum install docbook-dtds docbook-style-xsl fop libxslt To install the required packages with pkg, use: -pkg install docbook-xml docbook-xsl fop libxslt +pkg install docbook-xml docbook-xsl libxslt fop @@ -199,7 +188,7 @@ pkg install docbook-xml docbook-xsl fop libxslt available for Debian GNU/Linux. To install, simply use: -apt-get install docbook-xml docbook-xsl fop libxml2-utils xsltproc +apt-get install docbook-xml docbook-xsl libxml2-utils xsltproc fop @@ -207,22 +196,38 @@ apt-get install docbook-xml docbook-xsl fop libxml2-utils xsltproc macOS - - On macOS, you can build the HTML and man documentation without installing - anything extra. If you want to build PDFs or want to install a local copy - of DocBook, you can get those from your preferred package manager. - - If you use MacPorts, the following will get you set up: -sudo port install docbook-xml-4.5 docbook-xsl fop +sudo port install docbook-xml docbook-xsl-nons libxslt fop If you use Homebrew, use this: -brew install docbook docbook-xsl fop +brew install docbook docbook-xsl libxslt fop + + + The Homebrew-supplied programs require the following environment variable + to be set: + +export XML_CATALOG_FILES=/usr/local/etc/xml/catalog + + Without it, xsltproc will throw errors like this: + +I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd +postgres.sgml:21: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" +... + + + + + While it is possible to use the Apple-provided versions + of xmllint and xsltproc + instead of those from MacPorts or Homebrew, you'll still need + to install the DocBook DTD and stylesheets, and set up a catalog + file that points to them. + @@ -254,18 +259,19 @@ checking for dbtoepub... dbtoepub ./configure ... XMLLINT=/opt/local/bin/xmllint ... - Also, if you want to ensure that xmllint - and xsltproc will not perform any network access, - you can do something like - -./configure ... XMLLINT="xmllint --nonet" XSLTPROC="xsltproc --nonet" ... - + + + + If you prefer to build PostgreSQL using + Meson, instead run meson setup as described in + , and then see + . - Building the Documentation + Building the Documentation with Make Once you have everything set up, change to the directory @@ -410,6 +416,30 @@ ADDITIONAL_FLAGS='-Xmx1500m' + + Building the Documentation with Meson + + + Two options are provided for building the documentation using Meson. + Change to the build directory before running + one of these commands, or add to the command. + + + + To build just the HTML version of the documentation: + +build$ ninja docs + + To build all forms of the documentation: + +build$ ninja alldocs + + The output appears in the + subdirectory build/doc/src/sgml. + + + + Documentation Authoring diff --git a/doc/src/sgml/images/Makefile b/doc/src/sgml/images/Makefile index f9e356348b..645519095d 100644 --- a/doc/src/sgml/images/Makefile +++ b/doc/src/sgml/images/Makefile @@ -9,7 +9,7 @@ ALL_IMAGES = \ DITAA = ditaa DOT = dot -XSLTPROC = xsltproc +XSLTPROC = xsltproc --nonet all: $(ALL_IMAGES) diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build index b9f4c6a05b..38f1b8e7b1 100644 --- a/doc/src/sgml/meson.build +++ b/doc/src/sgml/meson.build @@ -87,7 +87,8 @@ postgres_full_xml = custom_target('postgres-full.xml', input: 'postgres.sgml', output: 'postgres-full.xml', depfile: 'postgres-full.xml.d', - command: [xmllint, '--noent', '--valid', '--path', '@OUTDIR@', '-o', '@OUTPUT@', '@INPUT@'], + command: [xmllint, '--nonet', '--noent', '--valid', + '--path', '@OUTDIR@', '-o', '@OUTPUT@', '@INPUT@'], depends: doc_generated, build_by_default: false, ) @@ -100,6 +101,7 @@ alldocs += postgres_full_xml # if xsltproc_bin.found() xsltproc_flags = [ + '--nonet', '--stringparam', 'pg.version', pg_version, '--param', 'website.stylesheet', '1' ] @@ -205,9 +207,7 @@ if xsltproc_bin.found() command: [xsltproc, '--path', '@OUTDIR@', '-o', '@OUTDIR@/', xsltproc_flags, '@INPUT@'], build_by_default: false, ) - - # build by default as part of docs target - docs += man + alldocs += man endif