summaryrefslogtreecommitdiffstats
path: root/meta/classes/manpages.bbclass
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2018-06-07 02:01:59 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-15 17:56:24 +0100
commit8c103176e2e3928e839fbc565389eda683b3ce69 (patch)
treed94dc24343aca7c779ca3e84a7731f4b8030dfd9 /meta/classes/manpages.bbclass
parent31a87d4d1dc80c6054c15a6f7dbc83b4d79bf0b2 (diff)
downloadpoky-8c103176e2e3928e839fbc565389eda683b3ce69.tar.gz
manpages.bbclass: Update RDEPENDS and post install scripts
If a package installs manual files, it should update manual index cache after its installation. Add package 'man-db' to RDEPENDS which contains command 'mandb' to update the cache. And do the update in the post install scripts. (From OE-Core rev: 078900f2416202b677471b10b69c8defb0f14c8d) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/manpages.bbclass')
-rw-r--r--meta/classes/manpages.bbclass32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/classes/manpages.bbclass b/meta/classes/manpages.bbclass
index d16237b898..50c254763e 100644
--- a/meta/classes/manpages.bbclass
+++ b/meta/classes/manpages.bbclass
@@ -3,3 +3,35 @@
3# tends to pull in the entire XML stack and other tools, so it's not enabled 3# tends to pull in the entire XML stack and other tools, so it's not enabled
4# by default. 4# by default.
5PACKAGECONFIG_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'manpages', '', d)}" 5PACKAGECONFIG_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'manpages', '', d)}"
6
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}