blob: dd579d3092a8d67674a78507960467b147f1809c [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001DESCRIPTION = "sntp"
2#sntp依赖libnvram库
xf.lidf7f8ba2024-09-12 23:53:34 -07003DEPENDS = "libdebug-info libnvram libsoftap libsofttimer"
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://sntp \
19 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://sntp.init","", d)} \
20 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://sntp.service","", d)} \
21 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://sntp.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
xf.lidf7f8ba2024-09-12 23:53:34 -070029include ${BSPDIR}/sources/meta-zxic/conf/pub.inc
30CFLAGS_append += "${ZXIC_EXTRA_CFLAGS}"
lh9ed821d2023-04-07 01:36:19 -070031#编译
32do_compile() {
33 make -C sntp
34}
35
36#库文件的安装,封库的宏MK_SDK_VERSION
37do_install () {
38 install -d ${D}${bindir}/
39 install -m 0755 ${S}/sntp/sntp ${D}${bindir}/
40
41 if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
42 install -Dm 0755 ${WORKDIR}/sntp.init ${D}${sysconfdir}/init.d/sntp
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}/sntp.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}/sntp.sysvinit ${D}${sysconfdir}/init.d/sntp
52 install -d ${D}${sysconfdir}/rcS.d
xf.lidf7f8ba2024-09-12 23:53:34 -070053 ln -s ../init.d/sntp ${D}${sysconfdir}/rcS.d/S22sntp
lh9ed821d2023-04-07 01:36:19 -070054 fi
55
56 #install elfs
57 install -d ${ELFS-PATH}/
58 install -m 0755 ${S}/sntp/sntp ${ELFS-PATH}/
59}
60#清库
61do_cleanlibs () {
62 rm -fr ${ELFS-PATH}/sntp
63}
64
65addtask cleanlibs after do_clean before do_cleansstate
66
67#rootfs包含的文件
68FILES_${PN} = "\
69 ${bindir}/ \
70 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/init.d/sntp","", d)} \
71 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
72 "
73SYSTEMD_SERVICE_${PN} = "sntp.service"
lh758261d2023-07-13 05:52:04 -070074SYSTEMD_AUTO_ENABLE_${PN} = "enable"
lh9ed821d2023-04-07 01:36:19 -070075
xf.lidf7f8ba2024-09-12 23:53:34 -070076RDEPENDS_${PN} = " libdebug-info libnvram libsoftap libsofttimer"