xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame^] | 1 | DESCRIPTION = "voiceipc_mainctrl" |
| 2 | DEPENDS = "libvoice" |
| 3 | SECTION = "app" |
| 4 | LICENSE = "zte" |
| 5 | PV = "1.0.0" |
| 6 | PR = "r0" |
| 7 | |
| 8 | CLASS_COM = " \ |
| 9 | ${@bb.utils.contains('DISTRO_FEATURES', 'procd', 'openwrt openwrt-services', '', d)} \ |
| 10 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
| 11 | " |
| 12 | inherit ${CLASS_COM} |
| 13 | |
| 14 | #配置code路径信息。 |
| 15 | FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:" |
| 16 | SRC_URI = " \ |
| 17 | file://voiceipc_mainctrl \ |
| 18 | ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://voiceipc_mainctrl.init","", d)} \ |
| 19 | ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://voiceipc_mainctrl.service","", d)} \ |
| 20 | ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://voiceipc_mainctrl.sysvinit","", d)} \ |
| 21 | " |
| 22 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808" |
| 23 | S = "${WORKDIR}" |
| 24 | S_SRC_PATH = "${S}/voiceipc_mainctrl" |
| 25 | #引用公用头文件和编译选项。 |
| 26 | include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc |
| 27 | CFLAGS_append = "-I ${BSPDIR}/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/include" |
| 28 | #inherit autotools pkgconfig systemd |
| 29 | |
| 30 | do_compile() { |
| 31 | make -C ${S_SRC_PATH} |
| 32 | } |
| 33 | |
| 34 | do_install () { |
| 35 | install -d ${D}${bindir}/ |
| 36 | install -m 0755 ${S_SRC_PATH}/voiceipc_mainctrl ${D}${bindir}/ |
| 37 | |
| 38 | if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then |
| 39 | install -Dm 0755 ${WORKDIR}/voiceipc_mainctrl.init ${D}${sysconfdir}/init.d/voiceipc_mainctrl |
| 40 | fi |
| 41 | |
| 42 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 43 | install -d ${D}${systemd_unitdir}/system |
| 44 | install -m 0644 ${WORKDIR}/voiceipc_mainctrl.service ${D}${systemd_unitdir}/system |
| 45 | fi |
| 46 | |
| 47 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then |
| 48 | install -Dm 0755 ${WORKDIR}/voiceipc_mainctrl.sysvinit ${D}${sysconfdir}/init.d/voiceipc_mainctrl |
| 49 | install -d ${D}${sysconfdir}/rcS.d |
| 50 | ln -s ../init.d/voiceipc_mainctrl ${D}${sysconfdir}/rcS.d/S50voiceipc_mainctrl |
| 51 | fi |
| 52 | #install elfs |
| 53 | install -d ${ELFS-PATH}/ |
| 54 | install -m 0755 ${S_SRC_PATH}/voiceipc_mainctrl ${ELFS-PATH}/ |
| 55 | } |
| 56 | |
| 57 | do_cleanlibs () { |
| 58 | rm -fr ${ELFS-PATH}/voiceipc_mainctrl |
| 59 | } |
| 60 | |
| 61 | addtask cleanlibs after do_clean before do_cleansstate |
| 62 | |
| 63 | FILES_${PN} = "\ |
| 64 | ${bindir}/ \ |
| 65 | ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/init.d/voiceipc_mainctrl","", d)} \ |
| 66 | ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \ |
| 67 | " |
| 68 | SYSTEMD_SERVICE_${PN} = "voiceipc_mainctrl.service" |
| 69 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" |
| 70 | |
| 71 | RDEPENDS_${PN} = " libvoice" |