Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2025 09:26:33 GMT
From:      Lexi Winter <ivy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ea5e50c2985b - main - packages: Add a mandoc package
Message-ID:  <202509180926.58I9QXXu076386@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by ivy:

URL: https://cgit.FreeBSD.org/src/commit/?id=ea5e50c2985bea029e7b30ecee773a59fe22cd68

commit ea5e50c2985bea029e7b30ecee773a59fe22cd68
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-09-18 09:14:45 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-09-18 09:26:12 +0000

    packages: Add a mandoc package
    
    Move mandoc to its own package so users can install it independently of
    -utilities.  Put the package in the minimal set, since we also ship
    manpages in minimal and "man" is a basic Unix utility.
    
    Add a pkg-triggers(5) hook to run makewhatis when new manpages are
    installed, so that apropos(1) works.  This depends on a new pkg(8)
    feature expected to be in in the upcoming 2.3.2 release; in the mean
    time, this is a no-op (i.e., having an older pkg doesn't break anything,
    it just won't run the trigger).
    
    MFC after:      3 seconds
    Reviewed by:    bapt
    Differential Revision:  https://reviews.freebsd.org/D52564
---
 UPDATING                            |  4 ++++
 release/packages/ucl/mandoc-all.ucl | 11 +++++++++++
 usr.bin/man/Makefile                |  2 ++
 usr.bin/mandoc/Makefile             |  6 ++++++
 usr.bin/mandoc/mandoc.ucl           | 18 ++++++++++++++++++
 5 files changed, 41 insertions(+)

diff --git a/UPDATING b/UPDATING
index d40818111554..82ae24814e02 100644
--- a/UPDATING
+++ b/UPDATING
@@ -28,6 +28,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW:
 	at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20250918:
+	mandoc (including /usr/bin/man) has been moved to a new package,
+	FreeBSD-mandoc.  If you have the minimal set installed, this package
+	will be installed automatically, otherwise you may want to install it.
+
 	Kyua has been moved to the FreeBSD-kyua package, and ATF has been moved
 	to the FreeBSD-atf* packages.  If you have FreeBSD-tests installed,
 	these packages will be installed automatically, otherwise you should
diff --git a/release/packages/ucl/mandoc-all.ucl b/release/packages/ucl/mandoc-all.ucl
new file mode 100644
index 000000000000..9c43e9f7a46c
--- /dev/null
+++ b/release/packages/ucl/mandoc-all.ucl
@@ -0,0 +1,11 @@
+comment = "Online manual page reader"
+
+desc = <<EOD
+This packages provides man(1), a utility which can format and display system
+manual pages, along with the related utilities apropos(1) and makewhatis(8),
+and the mandoc(1) backend.
+EOD
+
+annotations {
+	set = minimal
+}
diff --git a/usr.bin/man/Makefile b/usr.bin/man/Makefile
index 9c9098270735..9e47006cac0a 100644
--- a/usr.bin/man/Makefile
+++ b/usr.bin/man/Makefile
@@ -1,3 +1,5 @@
+PACKAGE=	mandoc
+
 SCRIPTS= man.sh
 LINKS=	${BINDIR}/man ${BINDIR}/manpath
 
diff --git a/usr.bin/mandoc/Makefile b/usr.bin/mandoc/Makefile
index 0d04aad4e558..2c7c3ed85040 100644
--- a/usr.bin/mandoc/Makefile
+++ b/usr.bin/mandoc/Makefile
@@ -3,6 +3,8 @@
 MANDOCDIR=	${SRCTOP}/contrib/mandoc
 .PATH: ${MANDOCDIR}
 
+PACKAGE=	mandoc
+
 PROG=	mandoc
 MAN=	mandoc.1 mandoc.db.5 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 roff.7
 MLINKS=	mandoc.1 mdocml.1
@@ -16,6 +18,10 @@ LINKS=	${BINDIR}/mandoc ${BINDIR}/whatis \
 .error MK_MAN_UTILS should be set to yes when bootstrapping
 .endif
 
+FILESGROUPS=	TRIGGERS
+TRIGGERS=	mandoc.ucl
+TRIGGERSDIR=	/usr/share/pkg/triggers
+
 LIBMAN_SRCS=	man.c \
 		man_macro.c \
 		man_validate.c
diff --git a/usr.bin/mandoc/mandoc.ucl b/usr.bin/mandoc/mandoc.ucl
new file mode 100644
index 000000000000..f320b6f547fd
--- /dev/null
+++ b/usr.bin/mandoc/mandoc.ucl
@@ -0,0 +1,18 @@
+path_glob: "/usr/share/man/*"
+
+cleanup: {
+	type: lua
+	sandbox: false
+	script: <<EOD
+	os.remove("/usr/share/man/mandoc.db")
+EOD
+}
+
+trigger: {
+	type: lua
+	sandbox: false
+	script: <<EOD
+	print("Generating apropos(1) database...")
+	pkg.exec({"/usr/bin/makewhatis", "/usr/share/man"})
+EOD
+}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509180926.58I9QXXu076386>