Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
| 7 | # Inherit this class to enable or disable building and installation of manpages |
| 8 | # depending on whether 'api-documentation' is in DISTRO_FEATURES. Such building |
| 9 | # tends to pull in the entire XML stack and other tools, so it's not enabled |
| 10 | # by default. |
| 11 | PACKAGECONFIG:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'manpages', '', d)}" |
| 12 | |
| 13 | inherit qemu |
| 14 | |
| 15 | # usually manual files are packaged to ${PN}-doc except man-pages |
| 16 | MAN_PKG ?= "${PN}-doc" |
| 17 | |
| 18 | # only add man-db to RDEPENDS when manual files are built and installed |
| 19 | RDEPENDS:${MAN_PKG} += "${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'man-db', '', d)}" |
| 20 | |
| 21 | pkg_postinst:${MAN_PKG}:append () { |
| 22 | # only update manual page index caches when manual files are built and installed |
| 23 | if ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'true', 'false', d)}; then |
| 24 | if test -n "$D"; then |
| 25 | if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 26 | $INTERCEPT_DIR/postinst_intercept update_mandb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} bindir=${bindir} sysconfdir=${sysconfdir} mandir=${mandir} |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 27 | else |
| 28 | $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX} |
| 29 | fi |
| 30 | else |
| 31 | mandb -q |
| 32 | fi |
| 33 | fi |
| 34 | } |
| 35 | |
| 36 | pkg_postrm:${MAN_PKG}:append () { |
| 37 | # only update manual page index caches when manual files are built and installed |
| 38 | if ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'true', 'false', d)}; then |
| 39 | mandb -q |
| 40 | fi |
| 41 | } |