packages: Install development manpages in the -dev package

Add a new per-group SUBPACKAGE option to bsd.man.mk.  When MANSPLITPKG
is enabled, this is forced to "-man", otherwise it defaults to empty
but can be overridden by the caller.

Use this in bsd.lib.mk to install library manpages in the -dev package
instead of the base package.  This is nearly always preferable, since
library manpages are usually in section 2 or 3 and are only relevant
to people with development packages installed.

For manpages which should be installed in the base package even for
libraries, add a new MANNODEV group in bsd.lib.mk.  Update existing
Makefiles to use this where appropriate.

MFC after:	3 days
Discussed with:	olce
Reviewed by:	olce
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D52832
This commit is contained in:
Lexi Winter
2025-10-25 18:33:04 +01:00
parent 450fb637f4
commit 031e711647
23 changed files with 198 additions and 154 deletions
+6 -5
View File
@@ -1,10 +1,11 @@
.include <src.opts.mk>
SHLIBDIR=${GEOM_CLASS_DIR}
SHLIB_NAME?=geom_${GEOM_CLASS}.so
MAN= g${GEOM_CLASS}.8
SRCS+= geom_${GEOM_CLASS}.c subr.c
CFLAGS+=-I${SRCTOP}/sbin/geom
SHLIBDIR= ${GEOM_CLASS_DIR}
SHLIB_NAME?= geom_${GEOM_CLASS}.so
MANNODEV= g${GEOM_CLASS}.8
SRCS+= geom_${GEOM_CLASS}.c subr.c
CFLAGS+= -I${SRCTOP}/sbin/geom
.PATH: ${SRCTOP}/sbin/geom/misc
+5 -4
View File
@@ -184,12 +184,13 @@ MAN= archive_entry.3 \
archive_write_new.3 \
archive_write_open.3 \
archive_write_set_options.3 \
cpio.5 \
libarchive.3 \
libarchive_changes.3 \
libarchive_internals.3 \
libarchive-formats.5 \
tar.5
libarchive_internals.3
MANNODEV= cpio.5 \
libarchive-formats.5 \
tar.5
# Symlink the man pages under each function name.
MLINKS+= archive_entry.3 archive_entry_clear.3
+1 -1
View File
@@ -46,7 +46,7 @@ MAN+= btowc.3 \
wctrans.3 wctype.3 wcwidth.3 \
duplocale.3 freelocale.3 newlocale.3 querylocale.3 uselocale.3 xlocale.3
MAN+= big5.5 euc.5 gb18030.5 gb2312.5 gbk.5 mskanji.5 utf8.5
MANNODEV+= big5.5 euc.5 gb18030.5 gb2312.5 gbk.5 mskanji.5 utf8.5
MLINKS+=btowc.3 wctob.3
MLINKS+=digittoint.3 digittoint_l.3
+2 -1
View File
@@ -84,7 +84,6 @@ MAN+= acl.3 \
acl_valid.3 \
extattr.3 \
mac.3 \
mac.conf.5 \
mac_free.3 \
mac_is_present.3 \
mac_get.3 \
@@ -134,4 +133,6 @@ MLINKS+=acl_create_entry.3 acl_create_entry_np.3\
mac_text.3 mac_from_text.3 \
mac_text.3 mac_to_text.3
MANNODEV+= mac.conf.5
CLEANFILES+= subr_acl_nfs4.c
+4 -4
View File
@@ -9,9 +9,9 @@ SYM_MAPS+=${LIBC_SRCTOP}/regex/Symbol.map
# manpages only included in libc version
.if ${LIB} == "c"
MAN+= regex.3
MAN+= re_format.7
MAN+= regex.3
MLINKS+= regex.3 regcomp.3 regex.3 regexec.3 regex.3 regerror.3
MLINKS+= regexec.3 regfree.3
MLINKS+=regex.3 regcomp.3 regex.3 regexec.3 regex.3 regerror.3
MLINKS+=regexec.3 regfree.3
MANNODEV+= re_format.7
.endif
+3 -1
View File
@@ -42,12 +42,12 @@ crypt_xdr.c: ${RPCDIR}/crypt.x crypt.h
crypt.h: ${RPCDIR}/crypt.x
${RPCGEN} -h -o ${.TARGET} ${RPCDIR}/crypt.x
MAN+= bindresvport.3 des_crypt.3 getnetconfig.3 getnetpath.3 getrpcent.3 \
getrpcport.3 rpc.3 rpc_soc.3 rpc_clnt_auth.3 rpc_clnt_calls.3 \
rpc_clnt_create.3 rpc_svc_calls.3 rpc_svc_create.3 rpc_svc_err.3 \
rpc_svc_reg.3 rpc_xdr.3 rpcbind.3 publickey.3 rpc_secure.3 \
rtime.3
MAN+= rpc.5 netconfig.5
MLINKS+= bindresvport.3 bindresvport_sa.3 \
des_crypt.3 ecb_crypt.3 \
des_crypt.3 cbc_crypt.3 \
@@ -177,3 +177,5 @@ MLINKS+= bindresvport.3 bindresvport_sa.3 \
rpc_soc.3 xdr_authunix_parms.3 \
rpc_soc.3 xdr_pmap.3 \
rpc_soc.3 xdr_pmaplist.3
MANNODEV+= rpc.5 netconfig.5
+3 -3
View File
@@ -15,10 +15,10 @@ SRCS= chared.c chartype.c common.c el.c eln.c emacs.c filecomplete.c \
parse.c prompt.c read.c readline.c refresh.c search.c sig.c \
terminal.c tokenizer.c tokenizern.c tty.c vi.c
MAN= editline.3
MANNODEV= editrc.5 editline.7
MAN= editline.3 editrc.5 editline.7
MLINKS= \
MLINKS=\
editline.3 el_deletestr.3 \
editline.3 el_end.3 \
editline.3 el_get.3 \
+5 -3
View File
@@ -11,7 +11,9 @@ SHLIB_MAJOR= 4
.if !make(build-tools)
LIBADD= z
.endif
MAN= libmagic.3 magic.5
MAN= libmagic.3
MANNODEV= magic.5
SRCS= apprentice.c apptype.c ascmagic.c buffer.c cdf.c cdf_time.c \
compress.c der.c encoding.c fsmagic.c funcs.c is_json.c \
@@ -73,8 +75,8 @@ magic.mgc: mkmagic
FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \
${.CURDIR}/config.h
CLEANFILES+= ${MAN}
.for mp in ${MAN}
CLEANFILES+= ${MAN} ${MANNODEV}
.for mp in ${MAN} ${MANNODEV}
${mp}: ${mp:C/[0-9]/man/}
sed -e 's/__FSECTION__/5/g' -e 's/__CSECTION__/1/g' \
-e 's/__VERSION__/${FILEVER}/g' \
+3 -3
View File
@@ -148,10 +148,10 @@ MAN?= openpam.3 \
pam_strerror.3 \
pam_verror.3 \
pam_vinfo.3 \
pam_vprompt.3 \
pam.conf.5
pam_vprompt.3
MLINKS?= pam.conf.5 pam.d.5
MANNODEV?= pam.conf.5
MANNODEVLINKS?= pam.conf.5 pam.d.5
CFLAGS+= -DLOCALBASE=\"${LOCALBASE:U/usr/local}\"
CFLAGS+= -I${OPENPAM}/include
+1
View File
@@ -42,6 +42,7 @@ NO_PIC=
# Avoid redundancy with the master Makefile.
MAN=
MANNODEV=
INCS=
MLINKS=
MK_TESTS= no
+7 -6
View File
@@ -109,10 +109,11 @@ MAN= pcap.3 \
pcap_strerror.3 \
pcap_tstamp_type_name_to_val.3 \
pcap_tstamp_type_val_to_name.3 \
pcap-savefile.5 \
pcap-filter.7 \
pcap-linktype.7 \
pcap-tstamp.7
pcap-savefile.5
MANNODEV= pcap-filter.7 \
pcap-linktype.7 \
pcap-tstamp.7
MLINKS= \
pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \
@@ -129,7 +130,7 @@ MLINKS= \
pcap_setnonblock.3 pcap_getnonblock.3
# Our man pages are a special copy from the distdir. See below.
CLEANFILES+=${MAN}
CLEANFILES+=${MAN} ${MANNODEV}
CLEANFILES+=grammar.y scanner.h tokdefs.h
YFLAGS+=-p pcap_
@@ -175,7 +176,7 @@ tokdefs.h: grammar.h .NOMETA
#
# Magic to convert the man pages to something non Solarish
#
.for _page in ${MAN}
.for _page in ${MAN} ${MANNODEV}
${_page}:
if [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap/} ]; then \
F=${_page:S/3$/3pcap/}; \
+3 -1
View File
@@ -31,7 +31,9 @@ INCS= radlib.h radlib_vs.h
CFLAGS+= -Wall
CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L
SHLIB_MAJOR= 4
MAN= libradius.3 radius.conf.5
MAN= libradius.3
MANNODEV= radius.conf.5
MLINKS+=libradius.3 rad_acct_open.3 \
libradius.3 rad_add_server.3 \
+3 -1
View File
@@ -29,7 +29,9 @@ INCS= taclib.h
CFLAGS+= -Wall
LIBADD= md pam
SHLIB_MAJOR= 5
MAN= libtacplus.3 tacplus.conf.5
MAN= libtacplus.3
MANNODEV= tacplus.conf.5
WARNS?= 2
+2 -1
View File
@@ -147,7 +147,8 @@ MLINKS+=uucplock.3 uu_lock.3
MLINKS+=uucplock.3 uu_lock_txfr.3
MLINKS+=uucplock.3 uu_lockerr.3
MLINKS+=uucplock.3 uu_unlock.3
MAN+= login.conf.5
MANNODEV= login.conf.5
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
+8 -9
View File
@@ -1,6 +1,3 @@
#
#
.include <src.opts.mk>
PACKAGE= tcpd
@@ -9,12 +6,14 @@ CONFS= hosts.allow
LIB= wrap
SHLIB_MAJOR= 6
INCS= tcpd.h
MAN= hosts_access.3
MAN+= hosts_access.5 hosts_options.5
MLINKS= hosts_access.3 hosts_ctl.3 \
hosts_access.3 request_init.3 \
hosts_access.3 request_set.3 \
hosts_options.5 hosts.allow.5
MAN= hosts_access.3
MLINKS= hosts_access.3 hosts_ctl.3 \
hosts_access.3 request_init.3 \
hosts_access.3 request_set.3
MANNODEV= hosts_access.5 hosts_options.5
MANNODEVLINKS= hosts_options.5 hosts.allow.5
.PATH: ${SRCTOP}/contrib/tcp_wrappers
+1 -1
View File
@@ -51,7 +51,7 @@ MAN+= xo_attr.3 \
MAN+= xo_format.5
MAN+= xo_options.7
MANNODEV= xo_options.7
MLINKS= xo_attr.3 xo_attr_h.3 \
xo_attr.3 xo_attr_hv.3 \
+4 -2
View File
@@ -399,6 +399,7 @@ terminfo.5: MKterminfo.sh terminfo.head Caps
CLEANFILES+= terminfo.5
.PATH: ${NCURSES_DIR}/man
MAN= \
curs_addch.3 \
curs_addchstr.3 \
@@ -475,8 +476,9 @@ MAN+= \
curs_printw.3 \
curs_scanw.3
MAN+= term.5 terminfo.5 scr_dump.5 user_caps.5
MAN+= term.7
MAN+= scr_dump.5
MANNODEV= term.5 term.7 terminfo.5 user_caps.5
CLEANFILES+= ${MAN:M*.3}
+1 -1
View File
@@ -4,6 +4,6 @@ SHLIB_MAJOR= 1
SHLIB_NAME= ${LIB}.so.${SHLIB_MAJOR}
LIBADD= tacplus
MK_INSTALLLIB= no
MAN= ${LIB}.8
MANNODEV= ${LIB}.8
.include <bsd.lib.mk>