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