blob: e409c9f44f443a51e87f029d51834ac599f60677 [file] [log] [blame]
xf.lie31de8b2023-12-26 23:38:58 -08001DESCRIPTION = "fota-auto-sync"
2#依赖库
xf.li7ccf8372024-03-07 00:08:02 -08003DEPENDS = "libnvram libsoftap libsofttimer libatutils libupi-ab lzma"
xf.lie31de8b2023-12-26 23:38:58 -08004SECTION = "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}/platform:"
17SRC_URI = " \
18 file://fota_auto_sync \
19 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://fota_auto_sync.init","", d)} \
20 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://fota_auto_sync.service","", d)} \
21 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://fota_auto_sync.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
30
31CFLAGS_append = "${ZXIC_EXTRA_CFLAGS}"
32
33#编译
34do_compile() {
35 make -C fota_auto_sync
36}
37
38#库文件的安装,封库的宏MK_SDK_VERSION
39do_install () {
40 install -d ${D}${bindir}/
41 install -m 0755 ${S}/fota_auto_sync/fota_auto_sync ${D}${bindir}/
42
43 if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
44 install -Dm 0755 ${WORKDIR}/fota_auto_sync.init ${D}${sysconfdir}/init.d/fota_auto_sync
45 fi
46
47 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
48 install -d ${D}${systemd_unitdir}/system
49 install -m 0644 ${WORKDIR}/fota_auto_sync.service ${D}${systemd_unitdir}/system
50 fi
51
52 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
53 install -Dm 0755 ${WORKDIR}/fota_auto_sync.sysvinit ${D}${sysconfdir}/init.d/fota_auto_sync
54 install -d ${D}${sysconfdir}/rcS.d
55 ln -s ../init.d/fota_auto_sync ${D}${sysconfdir}/rcS.d/S76fota_auto_sync
56 fi
57
58 #install elfs
59 install -d ${ELFS-PATH}/
60 install -m 0755 ${S}/fota_auto_sync/fota_auto_sync ${ELFS-PATH}/
61}
62#清库
63do_cleanlibs () {
64 rm -fr ${ELFS-PATH}/fota_auto_sync
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}/init.d/fota_auto_sync","", d)} \
73 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
74 "
75SYSTEMD_SERVICE_${PN} = "fota_auto_sync.service"
76SYSTEMD_AUTO_ENABLE_${PN} = "enable"