1SUMMARY = "PLDM Stack"
2DESCRIPTION = "Implementation of the PLDM specifications"
3DEPENDS += "function2"
4DEPENDS += "systemd"
5DEPENDS += "sdeventplus"
6DEPENDS += "phosphor-dbus-interfaces"
7DEPENDS += "nlohmann-json"
8DEPENDS += "cli11"
9DEPENDS += "libpldm"
10DEPENDS += "phosphor-logging"
11PV = "1.0+git${SRCPV}"
12PR = "r1"
13
14S = "${WORKDIR}/git"
15SYSTEMD_SERVICE:${PN} += "pldmd.service"
16SYSTEMD_SERVICE:${PN} += "pldmSoftPowerOff.service"
17
18inherit meson pkgconfig
19inherit systemd
20
21EXTRA_OEMESON = " \
22        -Dtests=disabled \
23        -Doem-ibm=disabled \
24        "
25
26pkg_prerm:${PN} () {
27    LINK="$D$systemd_system_unitdir/obmc-host-shutdown@0.target.wants/pldmSoftPowerOff.service"
28    rm $LINK
29    LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@0.target.wants/pldmSoftPowerOff.service"
30    rm $LINK
31}
32# Install pldmSoftPowerOff.service in correct targets
33pkg_postinst:${PN} () {
34    mkdir -p $D$systemd_system_unitdir/obmc-host-shutdown@0.target.wants
35    LINK="$D$systemd_system_unitdir/obmc-host-shutdown@0.target.wants/pldmSoftPowerOff.service"
36    TARGET="../pldmSoftPowerOff.service"
37    ln -s $TARGET $LINK
38    mkdir -p $D$systemd_system_unitdir/obmc-host-warm-reboot@0.target.wants
39    LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@0.target.wants/pldmSoftPowerOff.service"
40    TARGET="../pldmSoftPowerOff.service"
41    ln -s $TARGET $LINK
42}
43
44require pldm.inc
45