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