blob: 216c71686d371d9abefa5011d900b8c2404f7d69 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001DESCRIPTION = "nvserver"
2#nvserver依赖libnvram库
3DEPENDS = "libnvram"
4SECTION = "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路径信息。
16FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}:"
17SRC_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
55 fi
56
57 #install elfs
58 install -d ${ELFS-PATH}/
59 install -m 0755 ${S}/nvserver/nvserver ${ELFS-PATH}/
60}
61#清库
62do_cleanlibs () {
63 rm -fr ${ELFS-PATH}/nvserver
64}
65
66addtask cleanlibs after do_clean before do_cleansstate
67
68#rootfs包含的文件
69FILES_${PN} = "\
70 ${bindir}/ \
71 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/","", d)} \
72 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
73 "
74SYSTEMD_SERVICE_${PN} = "nvserver.service"
75SYSTEMD_AUTO_ENABLE_${PN} = "enable"