polkit: fix build on sysvinit

Polkit unconditionally installs a systemd service, remove it in
do_install() on SysVinit systems to avoid "installed but not packaged
file" error.

Fixes this error:
ERROR: polkit-125-r0 do_package: QA Issue: polkit: Files/directories were installed but not shipped in any package:
  /usr/lib/systemd
  /usr/lib/systemd/system
  /usr/lib/systemd/system/polkit.service
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
polkit: 3 installed and not shipped files. [installed-vs-shipped]
ERROR: polkit-125-r0 do_package: Fatal QA errors were found, failing task.

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Yoann Congal 2024-09-05 14:52:21 +02:00 committed by Khem Raj
parent 9bdff5feb6
commit 1f933b6936
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -55,6 +55,12 @@ do_install:append() {
chmod 700 ${D}/${sysconfdir}/polkit-1/rules.d
chown polkitd:root ${D}/${sysconfdir}/polkit-1/rules.d
fi
# Polkit unconditionally installs a systemd service, remove it on SysVinit
# systems to avoid "installed but not packaged file" error.
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
rm -r ${D}${libdir}/systemd
fi
}
FILES:${PN} += " \