Files
BPI-M2C/source_sync_rls_25c/layers/meta-unisoc/recipes-connectivity/shaperd/shaperd.bb
T
2026-09-22 09:38:26 +08:00

69 lines
1.8 KiB
BlitzBasic
Executable File

DESCRIPTION = "tsn_shaperd"
HOMEPAGE = "http://www.unisoc.com/"
SECTION = "bins"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://COPYING;md5=7a709ac98a9d8606af72d15cafa6a147"
PROVIDES = "shaperd"
PV = "0.1"
PR = "r0"
DEPENDS = "dbus libudbus"
RDEPENDS:${PN} = "dbus libudbus"
inherit get_release_mode
SHAPERD_SRC_DIR = "${OEROOT}/source/unisoc/perflink/shaperd"
SHAPERD_INSTALL_DIR = "${DEPLOY_OUT_DIR}/shaperd"
SHAPERD_RELEASE_DIR = "${PREBUILTS_OUT_DIR}/shaperd"
export SHAPERD_SRC_MODE="${@get_release_mode(d,"${SHAPERD_SRC_DIR}")}"
EXTERNALSRC = "${@bb.utils.contains("SHAPERD_SRC_MODE", "customer", "${SHAPERD_RELEASE_DIR}", "${SHAPERD_SRC_DIR}", d)}"
EXTERNALSRC_BUILD = "${EXTERNALSRC}"
SRC_URI = "\
file://script/shaperd.service \
file://script/shaperd-init \
file://shaper-dbus.conf \
"
NATIVE_SYSTEMD_SUPPORT = "1"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "shaperd.service"
inherit systemd
do_compile () {
if [ ${SHAPERD_SRC_MODE} != "customer" ]; then
make clean
make WORKDIR=${WORKDIR}
fi
}
do_install:prepend() {
if [ ${SHAPERD_SRC_MODE} != "customer" ]; then
rm -rf ${SHAPERD_INSTALL_DIR}
install -d ${SHAPERD_INSTALL_DIR}
install -m 0755 ${S}/shaperd ${SHAPERD_INSTALL_DIR}
fi
}
do_install () {
install -d ${D}${bindir}/
install -m 0755 ${S}/shaperd ${D}${bindir}/
install -d ${D}/etc/dbus-1/system.d/
install -m 0644 ${WORKDIR}/shaper-dbus.conf ${D}/etc/dbus-1/system.d/
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/script/shaperd-init ${D}${sysconfdir}/init.d/shaperd-init
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/script/shaperd.service ${D}${systemd_unitdir}/system
}
FILES:${PN} += "${bindir}/shaperd"
TARGET_CC_ARCH += "${LDFLAGS}"