pkgbase: Add an src.conf option for splitting man pages

Man pages can be big in total, add an options to split man pages
in -man packages so we produce smaller packages.
This is useful for small jails or mfsroot produced of pkgbase.
The option is off by default.

Reviewed by:	bapt, Mina Galić <me@igalic.co>
Differential Revision:	https://reviews.freebsd.org/D29169
MFC after:      2 weeks
This commit is contained in:
Emmanuel Vadot 2021-03-16 07:11:56 +01:00
parent 500f4659d7
commit c7e6cb9e08
5 changed files with 20 additions and 1 deletions

View File

@ -71,6 +71,11 @@ main() {
_descr="Debugging Symbols"
pkgdeps="${outname}"
;;
*_man)
outname="${outname%%_man}"
_descr="Manual Pages"
pkgdeps="${outname}"
;;
${origname})
pkgdeps="runtime"
;;

View File

@ -1,6 +1,6 @@
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
.\" $FreeBSD$
.Dd March 2, 2021
.Dd March 16, 2021
.Dt SRC.CONF 5
.Os
.Sh NAME
@ -1099,6 +1099,8 @@ is set explicitly)
.It Va WITHOUT_MANCOMPRESS
Set to not to install compressed man pages.
Only the uncompressed versions will be installed.
.It Va WITH_MANSPLITPKG
Set to split man pages into their own packages during make package.
.It Va WITHOUT_MAN_UTILS
Set to not build utilities for manual pages,
.Xr apropos 1 ,

View File

@ -50,7 +50,11 @@
.error bsd.man.mk cannot be included directly.
.endif
.if ${MK_MANSPLITPKG} == "no"
MINSTALL?= ${INSTALL} ${TAG_ARGS} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
.else
MINSTALL?= ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},man} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
.endif
CATDIR= ${MANDIR:H:S/$/\/cat/}
CATEXT= .cat
@ -226,8 +230,13 @@ maninstall: ${MAN}
.endif # ${MK_MANCOMPRESS} == "no"
.endif
.for l t in ${_MANLINKS}
.if ${MK_MANSPLITPKG} == "no"
rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \
${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
.else
rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \
${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
.endif
.endfor
manlint:

View File

@ -207,6 +207,7 @@ __DEFAULT_NO_OPTIONS = \
LOADER_VERBOSE \
LOADER_VERIEXEC_PASS_MANIFEST \
MALLOC_PRODUCTION \
MANSPLITPKG \
OFED_EXTRA \
OPENLDAP \
REPRODUCIBLE_BUILD \

View File

@ -0,0 +1,2 @@
.\" $FreeBSD$
Set to split man pages into their own packages during make package.