blob: dba567205b6bbe3559b643ad3035545e32f60688 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001DESCRIPTION = "zxic_mainctrl"
xf.liaa4d92f2023-09-13 00:18:58 -07002DEPENDS = "libnvram libsofttimer libatutils libsoftap openssl libscipc libupi-ab"
lh9ed821d2023-04-07 01:36:19 -07003SECTION = "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路径信息。
xf.libdd93d52023-05-12 07:10:14 -070015FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:"
lh9ed821d2023-04-07 01:36:19 -070016SRC_URI = " \
17 file://zxic_mainctrl \
18 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://zxic_mainctrl.init","", d)} \
19 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://zxic_mainctrl.service","", d)} \
20 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://zxic_mainctrl.sysvinit","", d)} \
21 "
22LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808"
23S = "${WORKDIR}"
24S_SRC_PATH = "${S}/zxic_mainctrl"
25#引用公用头文件和编译选项。
26include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc
27
28#inherit autotools pkgconfig systemd
29
30do_compile() {
31 #echo "TOPDIR = ${TOPDIR}"
32
33 make -C ${S_SRC_PATH}
34}
35
36do_install () {
37 install -d ${D}${bindir}/
38 install -m 0755 ${S_SRC_PATH}/zxic_mainctrl ${D}${bindir}/
39 install -m 0755 ${S_SRC_PATH}/router_msg_proxy ${D}${bindir}/
40
41 if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
42 install -Dm 0755 ${WORKDIR}/zxic_mainctrl.init ${D}${sysconfdir}/init.d/zxic_mainctrl
43 fi
44
45 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
46 install -d ${D}${systemd_unitdir}/system
47 install -m 0644 ${WORKDIR}/zxic_mainctrl.service ${D}${systemd_unitdir}/system
48 fi
49
50 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
51 install -Dm 0755 ${WORKDIR}/zxic_mainctrl.sysvinit ${D}${sysconfdir}/init.d/zxic_mainctrl
52 install -d ${D}${sysconfdir}/rcS.d
53 ln -s ../init.d/zxic_mainctrl ${D}${sysconfdir}/rcS.d/S40zxic_mainctrl
54 fi
55
56 #install elfs
57 install -d ${ELFS-PATH}/
58 install -m 0755 ${S_SRC_PATH}/zxic_mainctrl ${ELFS-PATH}/
59 install -m 0755 ${S_SRC_PATH}/router_msg_proxy ${ELFS-PATH}/
60}
61
62do_cleanlibs () {
63 rm -fr ${ELFS-PATH}/zxic_mainctrl
64 rm -fr ${ELFS-PATH}/router_msg_proxy
65}
66
67addtask cleanlibs after do_clean before do_cleansstate
68
69FILES_${PN} = "\
70 ${bindir}/ \
71 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/init.d/zxic_mainctrl","", d)} \
72 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
73 "
74SYSTEMD_SERVICE_${PN} = "zxic_mainctrl.service"
75SYSTEMD_AUTO_ENABLE_${PN} = "enable"
76
xf.liaa4d92f2023-09-13 00:18:58 -070077RDEPENDS_${PN} = " libnvram libsofttimer libatutils libsoftap openssl libscipc libupi-ab"