changeset 291:f2b4edf5f6a3

Docs: read the version from the Makefile
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 18 Sep 2022 12:04:00 +0200
parents 7508d9a9cf49
children d40e6e40c315
files Makefile docs/conf.py
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun Sep 18 11:10:39 2022 +0200
+++ b/Makefile	Sun Sep 18 12:04:00 2022 +0200
@@ -37,6 +37,7 @@
 do-extract:
 	${MKDIR} ${WRKSRC}/bin
 	${MKDIR} ${WRKSRC}/sbin
+	${CP} Makefile ${WRKSRC}/Makefile
 .for _rp in sbin/check-ports sbin/fjail sbin/ftjail sbin/fzfs sbin/fpkg sbin/bsmtp2dma
 	${CP} -v ${SRC}/${_rp} ${WRKSRC}/${_rp}
 	${SED} -i "" -E -e "s|\\\$$Date\\\$$|\$$Date: ${HGDATE} \$$|" ${WRKSRC}/${_rp}
--- a/docs/conf.py	Sun Sep 18 11:10:39 2022 +0200
+++ b/docs/conf.py	Sun Sep 18 12:04:00 2022 +0200
@@ -10,7 +10,8 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
-# import os
+import os
+import re
 # import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,7 +23,12 @@
 author = 'Franz Glasner'
 
 # The full version, including alpha/beta/rc tags
-release = '0.18.2'
+with open(os.path.join(os.path.dirname(__file__),
+                       "..",
+                       "Makefile"), "rb") as f:
+    release = re.search(b"^PORTVERSION\s*=\s*(\S+)",
+                        f.read(),
+                        re.MULTILINE).group(1).decode("ascii")
 
 
 # -- General configuration ---------------------------------------------------
@@ -65,14 +71,13 @@
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    ("man/local-bsdtools", "local-bsdtools", 'FreeBSD specific administration helper tools', [author], 8),
+    ("man/local-bsdtools", "local-bsdtools", 'FreeBSD specific administration helper tools v%s' % release, [author], 8),
     ("man/fzfs", "fzfs", "A ZFS management helper tool", [author], 8),
     ("man/fzfs-mount", "fzfs-mount", "Mount ZFS datasets recursively", [author], 8),
-    ("man/fzfs-umount", "fzfs-umount", "Unmount ZFS datasets recursively", [author], 8),        
+    ("man/fzfs-umount", "fzfs-umount", "Unmount ZFS datasets recursively", [author], 8),
 ]
 
 
 # -- Link to manual pages ----------------------------------------------------
 
 manpages_url = "https://www.freebsd.org/cgi/man.cgi?query={page}&sektion={section}"
-