Skip to content

Commit ea5e50c

Browse files
committed
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
1 parent 9065390 commit ea5e50c

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

UPDATING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW:
2828
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
2929

3030
20250918:
31+
mandoc (including /usr/bin/man) has been moved to a new package,
32+
FreeBSD-mandoc. If you have the minimal set installed, this package
33+
will be installed automatically, otherwise you may want to install it.
34+
3135
Kyua has been moved to the FreeBSD-kyua package, and ATF has been moved
3236
to the FreeBSD-atf* packages. If you have FreeBSD-tests installed,
3337
these packages will be installed automatically, otherwise you should
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
comment = "Online manual page reader"
2+
3+
desc = <<EOD
4+
This packages provides man(1), a utility which can format and display system
5+
manual pages, along with the related utilities apropos(1) and makewhatis(8),
6+
and the mandoc(1) backend.
7+
EOD
8+
9+
annotations {
10+
set = minimal
11+
}

usr.bin/man/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
PACKAGE= mandoc
2+
13
SCRIPTS= man.sh
24
LINKS= ${BINDIR}/man ${BINDIR}/manpath
35

usr.bin/mandoc/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
MANDOCDIR= ${SRCTOP}/contrib/mandoc
44
.PATH: ${MANDOCDIR}
55

6+
PACKAGE= mandoc
7+
68
PROG= mandoc
79
MAN= mandoc.1 mandoc.db.5 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 roff.7
810
MLINKS= mandoc.1 mdocml.1
@@ -16,6 +18,10 @@ LINKS= ${BINDIR}/mandoc ${BINDIR}/whatis \
1618
.error MK_MAN_UTILS should be set to yes when bootstrapping
1719
.endif
1820

21+
FILESGROUPS= TRIGGERS
22+
TRIGGERS= mandoc.ucl
23+
TRIGGERSDIR= /usr/share/pkg/triggers
24+
1925
LIBMAN_SRCS= man.c \
2026
man_macro.c \
2127
man_validate.c

usr.bin/mandoc/mandoc.ucl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
path_glob: "/usr/share/man/*"
2+
3+
cleanup: {
4+
type: lua
5+
sandbox: false
6+
script: <<EOD
7+
os.remove("/usr/share/man/mandoc.db")
8+
EOD
9+
}
10+
11+
trigger: {
12+
type: lua
13+
sandbox: false
14+
script: <<EOD
15+
print("Generating apropos(1) database...")
16+
pkg.exec({"/usr/bin/makewhatis", "/usr/share/man"})
17+
EOD
18+
}

0 commit comments

Comments
 (0)