blob: f3be15ff3dfa4c2108e8efb65ea317e44008cea9 [file] [log] [blame]
xf.libdd93d52023-05-12 07:10:14 -07001DESCRIPTION = "voiceipc_mainctrl"
2DEPENDS = "libvoice"
3SECTION = "app"
4LICENSE = "zte"
5PV = "1.0.0"
6PR = "r0"
7
8CLASS_COM = " \
9 ${@bb.utils.contains('DISTRO_FEATURES', 'procd', 'openwrt openwrt-services', '', d)} \
10 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
11"
12inherit ${CLASS_COM}
13
14#配置code路径信息。
15FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:"
16SRC_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 "
22LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808"
23S = "${WORKDIR}"
24S_SRC_PATH = "${S}/voiceipc_mainctrl"
25#引用公用头文件和编译选项。
26include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc
27CFLAGS_append = "-I ${BSPDIR}/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/include"
28#inherit autotools pkgconfig systemd
29
30do_compile() {
31 make -C ${S_SRC_PATH}
32}
33
34do_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
57do_cleanlibs () {
58 rm -fr ${ELFS-PATH}/voiceipc_mainctrl
59}
60
61addtask cleanlibs after do_clean before do_cleansstate
62
63FILES_${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 "
68SYSTEMD_SERVICE_${PN} = "voiceipc_mainctrl.service"
69SYSTEMD_AUTO_ENABLE_${PN} = "enable"
70
71RDEPENDS_${PN} = " libvoice"