diff --git a/meta-networking/recipes-support/mctp/mctp.inc b/meta-networking/recipes-support/mctp/mctp.inc new file mode 100644 index 0000000000..98225cffea --- /dev/null +++ b/meta-networking/recipes-support/mctp/mctp.inc @@ -0,0 +1,11 @@ +HOMEPAGE = "http://www.github.com/CodeConstruct/mctp" +SECTION = "net" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21" + +SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https;tag=v${PV}" +SRCREV = "07c7a5d526f686da89bc9ae9cad917e46652b272" + +inherit meson pkgconfig + +EXTRA_OEMESON = "-Dtests=false" diff --git a/meta-networking/recipes-support/mctp/mctp_2.5.bb b/meta-networking/recipes-support/mctp/mctp_2.5.bb index a8787d3f2b..5811495c66 100644 --- a/meta-networking/recipes-support/mctp/mctp_2.5.bb +++ b/meta-networking/recipes-support/mctp/mctp_2.5.bb @@ -1,45 +1,5 @@ -SUMMARY = "Management Component Control Protocol utilities" -HOMEPAGE = "http://www.github.com/CodeConstruct/mctp" -SECTION = "net" -LICENSE = "GPL-2.0-only" +require mctp.inc -LIC_FILES_CHKSUM = "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21" +SUMMARY = "Management Component Transport Protocol (MCTP) utilities" -SRCREV = "07c7a5d526f686da89bc9ae9cad917e46652b272" - -SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https;tag=v${PV}" - - -inherit meson pkgconfig systemd - -EXTRA_OEMESON = " \ - -Dtests=false \ -" - -PACKAGECONFIG ??= " \ - ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ -" - -# mctpd will only be built if pkg-config detects libsystemd; in which case -# we'll want to declare the dep and install the service. -PACKAGECONFIG[systemd] = ",,systemd,libsystemd" -SYSTEMD_SERVICE:${PN} = "mctpd.service mctp.target mctp-local.target" -SYSTEMD_AUTO_ENABLE:${PN} = "enable" - -do_install:append () { - if ${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'true', 'false', d)}; then - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${S}/conf/mctpd.service \ - ${D}${systemd_system_unitdir}/mctpd.service - install -m 0644 ${S}/conf/*.target \ - ${D}${systemd_system_unitdir}/ - install -d ${D}${datadir}/dbus-1/system.d - install -m 0644 ${S}/conf/mctpd-dbus.conf \ - ${D}${datadir}/dbus-1/system.d/mctpd.conf - fi -} - -FILES:${PN} += " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', \ - '${datadir}/dbus-1/system.d/mctpd.conf', '', d)} \ -" +MESON_TARGET = "mctp mctp-client" diff --git a/meta-networking/recipes-support/mctp/mctpd_2.5.bb b/meta-networking/recipes-support/mctp/mctpd_2.5.bb new file mode 100644 index 0000000000..a0f2f778a3 --- /dev/null +++ b/meta-networking/recipes-support/mctp/mctpd_2.5.bb @@ -0,0 +1,29 @@ +require mctp.inc + +SUMMARY = "Management Component Transport Protocol (MCTP) control protocol daemon" + +inherit systemd features_check + +do_install:append () { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/conf/mctpd.service \ + ${D}${systemd_system_unitdir}/mctpd.service + install -m 0644 ${S}/conf/*.target \ + ${D}${systemd_system_unitdir}/ + install -d ${D}${datadir}/dbus-1/system.d + install -m 0644 ${S}/conf/mctpd-dbus.conf \ + ${D}${datadir}/dbus-1/system.d/mctpd.conf +} + +SYSTEMD_SERVICE:${PN} = "mctpd.service mctp.target mctp-local.target" + +DEPENDS += "systemd" +REQUIRED_DISTRO_FEATURES = "systemd" + +# Meson adds mctp utility binaries to FILES and do_install(), which cannot be +# overriden by MESON_TARGET. Override FILES and remove binaries to correct. +FILES:${PN} = "${datadir}/dbus-1/system.d/mctpd.conf ${sbindir}/mctpd" + +do_install:append () { + rm -r ${D}${bindir} +}