blob: 6884753608c14b7870beaa0ede521aced5197138 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001DESCRIPTION = "servicemanager"
2DEPENDS = "libbinder"
3SECTION = "app"
4LICENSE = "zte"
5PV = "1.0.0"
6PR = "r0"
7
8CLASS_COM = " \
9 ${@bb.utils.contains('DISTRO_FEATURES', 'procd', 'openwrt openwrt-services', '', d)} \
10 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
11"
12inherit ${CLASS_COM}
13
14#配置code路径信息。
15FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/test:"
16SRC_URI = " \
17 file://servicemanager \
18 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://servicemanager.init","", d)} \
19 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://servicemanager.service","", d)} \
20 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://servicemanager.sysvinit","", d)} \
21 "
22
23LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808"
24S = "${WORKDIR}"
25
26#引用公用头文件和编译选项。
27include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc
28
29#编译
30do_compile() {
31 make -C servicemanager
32}
33
34#库文件的安装
35do_install() {
36 install -d ${D}${bindir}/
37 install -m 0755 ${S}/servicemanager/servicemanager ${D}${bindir}/
38
39 if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
40 install -Dm 0755 ${WORKDIR}/servicemanager.init ${D}${sysconfdir}/init.d/servicemanager
41 fi
42
43 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
44 install -d ${D}${systemd_unitdir}/system
45 install -m 0644 ${WORKDIR}/servicemanager.service ${D}${systemd_unitdir}/system
46 fi
47
48 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
49 install -Dm 0755 ${WORKDIR}/servicemanager.sysvinit ${D}${sysconfdir}/init.d/servicemanager
50 install -d ${D}${sysconfdir}/rcS.d
51 ln -s ../init.d/servicemanager ${D}${sysconfdir}/rcS.d
52 #/S22servicemanager
53 fi
54
55 #install elfs
56 install -d ${ELFS-PATH}/
57 install -m 0755 ${S}/servicemanager/servicemanager ${ELFS-PATH}/
58}
59#清库
60do_cleanlibs () {
61 rm -fr ${ELFS-PATH}/servicemanager
62}
63
64addtask cleanlibs after do_clean before do_cleansstate
65
66#rootfs包含的文件
67FILES_${PN} = "\
68 ${bindir}/ \
69 "
70
71#rootfs包含的文件
72FILES_${PN} = "\
73 ${bindir}/ \
74 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "${sysconfdir}/init.d/servicemanager","", d)} \
75 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
76 "
77SYSTEMD_SERVICE_${PN} = "servicemanager.service"
78SYSTEMD_AUTO_ENABLE_${PN} = "enable"
79
80RDEPENDS_${PN} = "libbinder"