Whilst the actual nscd binary won't be installed if the PACKAGECONFIG is
disabled, we were still installing the init scripts and configuration
files.  These should be wrapped with PACKAGECONFIG checks.

${localstatedir}/db and makedbs.sh are part of libnss-db not nscd, so
ensure they're still always installed.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/recipes-core/glibc/glibc-package.inc | 41 +++++++++++++----------
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/meta/recipes-core/glibc/glibc-package.inc 
b/meta/recipes-core/glibc/glibc-package.inc
index d4941a21a1..3d721d8f69 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -98,16 +98,20 @@ do_install() {
                rm -f ${D}${infodir}/dir
        fi
 
-       install -d ${D}${sysconfdir}/init.d
-       install -d ${D}${localstatedir}/db/nscd
-       install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
-       install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
+       install -d ${D}${localstatedir}/db
        install -m 0755 ${UNPACKDIR}/makedbs.sh ${D}${localstatedir}/db
-       sed -i "s%daemon%start-stop-daemon --start --exec%g" 
${D}${sysconfdir}/init.d/nscd
-       sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" 
${D}${sysconfdir}/nscd.conf
 
-       install -d ${D}${systemd_system_unitdir}
-       install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_system_unitdir}/
+       if ${@bb.utils.contains('PACKAGECONFIG', 'nscd', 'true', 'false', d)}; 
then
+               install -d ${D}${sysconfdir}/init.d
+               install -d ${D}${localstatedir}/db/nscd
+               install -m 0755 ${S}/nscd/nscd.init 
${D}${sysconfdir}/init.d/nscd
+               install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
+               sed -i "s%daemon%start-stop-daemon --start --exec%g" 
${D}${sysconfdir}/init.d/nscd
+               sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" 
${D}${sysconfdir}/nscd.conf
+
+               install -d ${D}${systemd_system_unitdir}
+               install -m 0644 ${S}/nscd/nscd.service 
${D}${systemd_system_unitdir}/
+       fi
 
        # The dynamic loader will have been installed into
        # ${base_libdir}. However, if that isn't going to end up being
@@ -132,18 +136,19 @@ def get_libc_fpu_setting(bb, d):
     return ""
 
 do_install:append:class-target() {
-       if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', 
d)}; then
-               install -d ${D}${nonarch_libdir}/tmpfiles.d
-               echo "d /run/nscd 755 root root -" \
-                       > ${D}${nonarch_libdir}/tmpfiles.d/nscd.conf
-       fi
+       if ${@bb.utils.contains('PACKAGECONFIG', 'nscd', 'true', 'false', d)}; 
then
+               if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 
'false', d)}; then
+                       install -d ${D}${nonarch_libdir}/tmpfiles.d
+                       echo "d /run/nscd 755 root root -" \
+                               > ${D}${nonarch_libdir}/tmpfiles.d/nscd.conf
+               fi
 
-       if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', 
d)}; then
-               install -d ${D}${sysconfdir}/default/volatiles
-               echo "d root root 0755 /var/run/nscd none" \
-                       > ${D}${sysconfdir}/default/volatiles/98_nscd
+               if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 
'false', d)}; then
+                       install -d ${D}${sysconfdir}/default/volatiles
+                       echo "d root root 0755 /var/run/nscd none" \
+                               > ${D}${sysconfdir}/default/volatiles/98_nscd
+               fi
        fi
-
 }
 do_install:append:aarch64 () {
        do_install_armmultilib
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#240501): 
https://lists.openembedded.org/g/openembedded-core/message/240501
Mute This Topic: https://lists.openembedded.org/mt/120177356/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to