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