lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | DESCRIPTION = "zxic_mainctrl" |
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame] | 2 | DEPENDS = "libnvram libsofttimer libatutils libsoftap openssl libscipc libupi-ab" |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 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路径信息。 |
xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame] | 15 | FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:" |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 16 | SRC_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 | " |
| 22 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808" |
| 23 | S = "${WORKDIR}" |
| 24 | S_SRC_PATH = "${S}/zxic_mainctrl" |
| 25 | #引用公用头文件和编译选项。 |
| 26 | include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc |
| 27 | |
| 28 | #inherit autotools pkgconfig systemd |
| 29 | |
| 30 | do_compile() { |
| 31 | #echo "TOPDIR = ${TOPDIR}" |
| 32 | |
| 33 | make -C ${S_SRC_PATH} |
| 34 | } |
| 35 | |
| 36 | do_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 | |
| 62 | do_cleanlibs () { |
| 63 | rm -fr ${ELFS-PATH}/zxic_mainctrl |
| 64 | rm -fr ${ELFS-PATH}/router_msg_proxy |
| 65 | } |
| 66 | |
| 67 | addtask cleanlibs after do_clean before do_cleansstate |
| 68 | |
| 69 | FILES_${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 | " |
| 74 | SYSTEMD_SERVICE_${PN} = "zxic_mainctrl.service" |
| 75 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" |
| 76 | |
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame] | 77 | RDEPENDS_${PN} = " libnvram libsofttimer libatutils libsoftap openssl libscipc libupi-ab" |