blob: 50c254763e8934bec448dde91bffd48942e39a17 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001# Inherit this class to enable or disable building and installation of manpages
2# depending on whether 'api-documentation' is in DISTRO_FEATURES. Such building
3# tends to pull in the entire XML stack and other tools, so it's not enabled
4# by default.
5PACKAGECONFIG_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'manpages', '', d)}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08006
7inherit qemu
8
9# usually manual files are packaged to ${PN}-doc except man-pages
10MAN_PKG ?= "${PN}-doc"
11
12# only add man-db to RDEPENDS when manual files are built and installed
13RDEPENDS_${MAN_PKG} += "${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'man-db', '', d)}"
14
15pkg_postinst_append_${MAN_PKG} () {
16 # only update manual page index caches when manual files are built and installed
17 if ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'true', 'false', d)}; then
18 if test -n "$D"; then
19 if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then
20 sed "s:\(\s\)/:\1$D/:g" $D${sysconfdir}/man_db.conf | ${@qemu_run_binary(d, '$D', '${bindir}/mandb')} -C - -u -q $D${mandir}
21 mkdir -p $D${localstatedir}/cache/man
22 mv $D${mandir}/index.db $D${localstatedir}/cache/man
23 else
24 $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}
25 fi
26 else
27 mandb -q
28 fi
29 fi
30}
31
32pkg_postrm_append_${MAN_PKG} () {
33 # only update manual page index caches when manual files are built and installed
34 if ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'true', 'false', d)}; then
35 mandb -q
36 fi
37}