]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
And also do html-docs, tarball and pdf for auth
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 17 Feb 2025 14:47:46 +0000 (15:47 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 17 Feb 2025 15:00:38 +0000 (16:00 +0100)
docs/generate-docs.py
meson.build
pdns/dnsdistdist/meson.build
pdns/recursordist/meson.build

index 871dd19b866dda4bb93c3689a4cf49b533c154fe..839e4c7f443b4c39e31b5625fdcb28865be707b5 100755 (executable)
@@ -40,7 +40,7 @@ def main():
     files = list(itertools.chain.from_iterable(files))
     sphinx_build = venv_directory.joinpath("bin").joinpath("sphinx-build")
 
-    if args.latex_name:
+    if args.pdf_name:
         buildargs = [
             sphinx_build,
             "-M",
@@ -60,8 +60,8 @@ def main():
         buildargs + files, # default is to do all
         check=True
     )
-    if args.latex_name:
-        os.rename(build_root.joinpath('latex').joinpath(args.latex_name), args.latex_name)
+    if args.pdf_name:
+        os.rename(build_root.joinpath('latex').joinpath(args.pdf_name), args.pdf_name)
 
 def create_argument_parser():
     """Create command-line argument parser."""
@@ -105,10 +105,10 @@ def create_argument_parser():
         help="Target directory for man-pages relative to the build root",
     )
     parser.add_argument(
-        "--latex-name",
+        "--pdf-name",
         type=Path,
         required=False,
-        help="Generate latex instead of html",
+        help="Generate pdf instead of html",
     )
     parser.add_argument(
         "files",
index f914ed45403896b330d0b8ba437d6ae1902d16c3..bd5ff45c3393f72348c41fb9837c15c45ebe85ba 100644 (file)
@@ -1123,3 +1123,48 @@ if get_option('unit-tests-backends')
     endif
   endforeach
 endif
+
+html_docs = custom_target(
+  'html-docs',
+  command: [
+      python,
+      product_source_dir / docs_dir / 'generate-docs.py',
+      '--build-root', '@BUILD_ROOT@',
+      '--source-root', '@SOURCE_ROOT@',
+      '--venv-name', 'venv-docs',
+      '--requirements-file', docs_dir / 'requirements.txt',
+      '--source-directory', docs_dir,
+      '--target-directory', '@BUILD_ROOT@' / 'html-docs',
+  ],
+  output: 'html-docs',
+  console: true,
+)
+
+docs_tarball = custom_target(
+  'html-docs.tar.bz2',
+  command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
+  output: 'html-docs.tar.bz2',
+)
+
+pdf_docs = custom_target(
+  command: [
+      python,
+      product_source_dir / docs_dir / 'generate-docs.py',
+      '--build-root', '@BUILD_ROOT@',
+      '--source-root', '@SOURCE_ROOT@',
+      '--venv-name', 'venv-docs',
+      '--requirements-file', docs_dir / 'requirements.txt',
+      '--source-directory', docs_dir,
+      '--target-directory', '@BUILD_ROOT@',
+      '--pdf-name', 'PowerDNS-Authoritative.pdf',
+  ],
+  output: 'PowerDNS-Authoritative.pdf',
+  console: true,
+)
+
+run_target(
+  'all-docs',
+  # args mentioned in command line become auto-dependency
+  command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
+)
+
index 63b651bf70376de2d736b4ad93a2eb71f9082306..ddf86963d2225f5907d9a952edf5c8c4d1b8aa60 100644 (file)
@@ -712,7 +712,7 @@ docs_tarball = custom_target(
   output: 'html-docs.tar.bz2',
 )
 
-latex_docs = custom_target(
+pdf_docs = custom_target(
   command: [
       python,
       product_source_dir / docs_dir / 'generate-docs.py',
@@ -722,7 +722,7 @@ latex_docs = custom_target(
       '--requirements-file', docs_dir / 'requirements.txt',
       '--source-directory', docs_dir,
       '--target-directory', '@BUILD_ROOT@',
-      '--latex-name', 'dnsdist.pdf',
+      '--pdf-name', 'dnsdist.pdf',
   ],
   output: 'dnsdist.pdf',
   console: true,
@@ -730,5 +730,6 @@ latex_docs = custom_target(
 
 run_target(
   'all-docs',
-  command: ['echo', html_docs, docs_tarball, latex_docs],
+  # args mentioned in command line become auto-dependency
+  command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
 )
index 1e0b8cb680c58038f8664bb441c4dbdb2c918032..7ddded830670f847d083748e1061be690a01e117 100644 (file)
@@ -756,7 +756,7 @@ docs_tarball = custom_target(
   output: 'html-docs.tar.bz2',
 )
 
-latex_docs = custom_target(
+pdf_docs = custom_target(
   command: [
       python,
       product_source_dir / docs_dir / 'generate-docs.py',
@@ -766,7 +766,7 @@ latex_docs = custom_target(
       '--requirements-file', docs_dir / 'requirements.txt',
       '--source-directory', docs_dir,
       '--target-directory', '@BUILD_ROOT@',
-      '--latex-name', 'PowerDNS-Recursor.pdf',
+      '--pdf-name', 'PowerDNS-Recursor.pdf',
   ],
   output: 'PowerDNS-Recursor.pdf',
   console: true,
@@ -774,6 +774,7 @@ latex_docs = custom_target(
 
 run_target(
   'all-docs',
-  command: ['echo', 'Generated', html_docs, docs_tarball, latex_docs],
+  # args mentioned in command line become auto-dependency
+  command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
 )