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