summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2023-03-24 04:20:18 +0000
committerAndres Freund2023-03-24 04:20:18 +0000
commitf13eb16485fec7958a59f263827b2333dea93e59 (patch)
tree997c909cf0982ac1068a05b44718c8f51f5b1721
parent614c5f5f52d53d0b3ed3a829ebf7f5ebd53e7a5a (diff)
meson: add install-{docs,doc-html,doc-man} targets
Discussion: https://postgr.es/m/[email protected]
-rw-r--r--doc/src/sgml/meson.build28
-rw-r--r--meson.build2
2 files changed, 28 insertions, 2 deletions
diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build
index e6fe124c7b..b728948af9 100644
--- a/doc/src/sgml/meson.build
+++ b/doc/src/sgml/meson.build
@@ -1,6 +1,7 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
docs = []
+installdocs = []
alldocs = []
doc_generated = []
@@ -120,8 +121,19 @@ if xsltproc_bin.found()
)
alldocs += html
- # build multi-page html docs as part of docs target
+ install_doc_html = custom_target('install-html',
+ output: 'install-html',
+ command: [
+ python, install_files, '--prefix', dir_prefix,
+ '--install-dir-contents', dir_doc_html, html],
+ build_always_stale: true, build_by_default: false,
+ )
+ alias_target('install-doc-html', install_doc_html)
+
+ # build and install multi-page html docs as part of docs target
docs += html
+ installdocs += install_doc_html
+
htmlhelp = custom_target('htmlhelp',
input: ['stylesheet-hh.xsl', postgres_full_xml],
@@ -208,6 +220,19 @@ if xsltproc_bin.found()
build_by_default: false,
)
alldocs += man
+
+ install_doc_man = custom_target('install-man',
+ output: 'install-man',
+ command: [
+ python, install_files, '--prefix', dir_prefix,
+ '--install-dirs', dir_man, man],
+ build_always_stale: true, build_by_default: false,
+ )
+ alias_target('install-doc-man', install_doc_man)
+
+ # even though we don't want to build man pages as part of 'docs', we do want
+ # to install them as part of install-docs
+ installdocs += install_doc_man
endif
@@ -266,6 +291,7 @@ if docs.length() == 0
run_target('docs', command: [missing, 'xsltproc'])
else
alias_target('docs', docs)
+ alias_target('install-docs', installdocs)
endif
if alldocs.length() == 0
diff --git a/meson.build b/meson.build
index 84fe2c3d4c..33dd5b43ed 100644
--- a/meson.build
+++ b/meson.build
@@ -504,7 +504,7 @@ dir_man = get_option('mandir')
# FIXME: These used to be separately configurable - worth adding?
dir_doc = get_option('datadir') / 'doc' / 'postgresql'
-dir_doc_html = dir_doc
+dir_doc_html = dir_doc / 'html'
dir_locale = get_option('localedir')