blob: 55b48ce972106a70a6515380022242661a128bfb [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001DESCRIPTION = "service_test"
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
14FILESEXTRAPATHS_prepend :="${APP-OPEN-PATH}/test:"
15SRC_URI = " \
16 file://service_test \
17 ${@bb.utils.contains("DISTRO_FEATURES", "procd", "file://test_binder_server.init","", d)} \
18 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "file://test_binder_server.service","", d)} \
19 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "file://test_binder_server.sysvinit","", d)} \
20 "
21
22LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/zte;md5=c075689d1d1e06d4ab5bbe53623a6808"
23S = "${WORKDIR}"
24
25#引用公用头文件和编译选项。
26include ${BSPDIR}/sources/meta-zxic/conf/app_com.inc
27
28#编译
29do_compile() {
30 make -C service_test
31}
32
33#库文件的安装
34do_install() {
35 install -d ${D}${bindir}/
36 install -m 0755 ${S}/service_test/test_binder_client ${D}${bindir}/
37 install -m 0755 ${S}/service_test/test_binder_server ${D}${bindir}/
38
39 if ${@bb.utils.contains('DISTRO_FEATURES','procd','true','false',d)}; then
40 install -Dm 0755 ${WORKDIR}/test_binder_server.init ${D}${sysconfdir}/init.d/test_binder_server
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}/test_binder_server.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}/test_binder_server.sysvinit ${D}${sysconfdir}/init.d/test_binder_server
50 install -d ${D}${sysconfdir}/rcS.d
51 ln -s ../init.d/test_binder_server ${D}${sysconfdir}/rcS.d
52 #/S22test_binder_server
53 fi
54
55 #install elfs
56 install -d ${ELFS-PATH}/
57 install -m 0755 ${S}/service_test/test_binder_client ${ELFS-PATH}/
58 install -m 0755 ${S}/service_test/test_binder_server ${ELFS-PATH}/
59}
60#清库
61do_cleanlibs () {
62 rm -fr ${ELFS-PATH}/test_binder_client
63 rm -fr ${ELFS-PATH}/test_binder_server
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}/init.d/test_binder_server","", d)} \
72 ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${sysconfdir}/","", d)} \
73 "
74
75SYSTEMD_SERVICE_${PN} = "test_binder_server.service"
76SYSTEMD_AUTO_ENABLE_${PN} = "enable"
77
78RDEPENDS_${PN} = "libbinder"