blob: 585ea3c38ae0f0c4d4659ffb576843fa2c0d7c38 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001DESCRIPTION = "nvserver"
2#nvserver依赖libnvram库
xf.li6c8fc1e2023-08-12 00:11:09 -07003DEPENDS = "libmtd libnvram libflags"
lh9ed821d2023-04-07 01:36:19 -07004SECTION = "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路径信息。
xf.libdd93d52023-05-12 07:10:14 -070016FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/platform:"
lh9ed821d2023-04-07 01:36:19 -070017SRC_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
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 nvserver
35}
36
37#库文件的安装
38do_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
lh758261d2023-07-13 05:52:04 -070055 ln -s ../init.d/nvserver ${D}${sysconfdir}/rcS.d/K84nvserver
lh9ed821d2023-04-07 01:36:19 -070056 fi
57
58 #install elfs
59 install -d ${ELFS-PATH}/
60 install -m 0755 ${S}/nvserver/nvserver ${ELFS-PATH}/
61}
62#清库
63do_cleanlibs () {
64 rm -fr ${ELFS-PATH}/nvserver
65}
66
67addtask cleanlibs after do_clean before do_cleansstate
68
69#rootfs包含的文件
70FILES_${PN} = "\
71 ${bindir}/ \
72 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/","", d)} \
73 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
74 "
75SYSTEMD_SERVICE_${PN} = "nvserver.service"
76SYSTEMD_AUTO_ENABLE_${PN} = "enable"