blob: 772f1495e595897a518b98b79d244278d0d9678f [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001DESCRIPTION = "zxic_mainctrl"
xf.lidf7f8ba2024-09-12 23:53:34 -07002DEPENDS = "libdebug-info 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
xf.lidf7f8ba2024-09-12 23:53:34 -070027include ${BSPDIR}/sources/meta-zxic/conf/pub.inc
28CFLAGS_append += "${ZXIC_EXTRA_CFLAGS}"
lh9ed821d2023-04-07 01:36:19 -070029
30#inherit autotools pkgconfig systemd
31
32do_compile() {
33 #echo "TOPDIR = ${TOPDIR}"
34
35 make -C ${S_SRC_PATH}
36}
37
38do_install () {
39 install -d ${D}${bindir}/
40 install -m 0755 ${S_SRC_PATH}/zxic_mainctrl ${D}${bindir}/
41 install -m 0755 ${S_SRC_PATH}/router_msg_proxy ${D}${bindir}/
42
43 if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
44 install -Dm 0755 ${WORKDIR}/zxic_mainctrl.init ${D}${sysconfdir}/init.d/zxic_mainctrl
45 fi
46
47 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
48 install -d ${D}${systemd_unitdir}/system
49 install -m 0644 ${WORKDIR}/zxic_mainctrl.service ${D}${systemd_unitdir}/system
50 fi
51
52 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
53 install -Dm 0755 ${WORKDIR}/zxic_mainctrl.sysvinit ${D}${sysconfdir}/init.d/zxic_mainctrl
54 install -d ${D}${sysconfdir}/rcS.d
55 ln -s ../init.d/zxic_mainctrl ${D}${sysconfdir}/rcS.d/S40zxic_mainctrl
56 fi
57
58 #install elfs
59 install -d ${ELFS-PATH}/
60 install -m 0755 ${S_SRC_PATH}/zxic_mainctrl ${ELFS-PATH}/
61 install -m 0755 ${S_SRC_PATH}/router_msg_proxy ${ELFS-PATH}/
62}
63
64do_cleanlibs () {
65 rm -fr ${ELFS-PATH}/zxic_mainctrl
66 rm -fr ${ELFS-PATH}/router_msg_proxy
67}
68
69addtask cleanlibs after do_clean before do_cleansstate
70
71FILES_${PN} = "\
72 ${bindir}/ \
73 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/init.d/zxic_mainctrl","", d)} \
74 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
75 "
76SYSTEMD_SERVICE_${PN} = "zxic_mainctrl.service"
77SYSTEMD_AUTO_ENABLE_${PN} = "enable"
78
xf.lidf7f8ba2024-09-12 23:53:34 -070079RDEPENDS_${PN} = " libdebug-info libnvram libsofttimer libatutils libsoftap openssl libscipc libupi-ab"