l.yang | daba4bb | 2023-08-30 10:47:55 +0800 | [diff] [blame^] | 1 | #inherit externalsrc package systemd |
| 2 | |
| 3 | DESCRIPTION = "lynq-fota-backup.service" |
| 4 | |
| 5 | LICENSE = "MIT" |
| 6 | ##License checksum file is always required |
| 7 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=c794e8ff1acd3b7f156a6497e780dd54" |
| 8 | |
| 9 | SRC_URI = "file://lynq-fota-backup.cpp \ |
| 10 | file://lynq-fota-backup.sh \ |
| 11 | file://makefile \ |
| 12 | file://lynq-fota-backup.service \ |
| 13 | file://LICENSE \ |
| 14 | " |
| 15 | |
| 16 | |
| 17 | TARGET_CC_ARCH += "${LDFLAGS}" |
| 18 | |
| 19 | |
| 20 | DEPENDS += "liblynq-log liblynq-uci liblynq-qser-fota" |
| 21 | S = "${WORKDIR}" |
| 22 | #INHIBIT_PACKAGE_STRIP = "1" |
| 23 | do_compile () { |
| 24 | |
| 25 | |
| 26 | if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then |
| 27 | oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float" |
| 28 | else |
| 29 | oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" |
| 30 | fi |
| 31 | } |
| 32 | #INHIBIT_PACKAGE_STRIP = "1" |
| 33 | |
| 34 | |
| 35 | do_install() { |
| 36 | install -d ${D}${bindir}/ |
| 37 | echo "Installing image PN ${PN}" |
| 38 | echo "Installing image systemd_unitdir ${systemd_unitdir}" |
| 39 | echo "Installing image D ${D}" |
| 40 | echo "Installing image B ${B}" |
| 41 | |
| 42 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 43 | install -d ${D}${systemd_unitdir}/system/ |
| 44 | install -m 0644 ${B}/lynq-fota-backup.service ${D}${systemd_unitdir}/system |
| 45 | else |
| 46 | install -d ${D}${sysconfdir}/init.d |
| 47 | install -m 0755 ${S}/lynq-fota-backup.sh ${D}${sysconfdir}/init.d/ |
| 48 | install -d ${D}${sysconfdir}/rcS.d |
| 49 | ln -s ../init.d/lynq-fota-backup.sh ${D}${sysconfdir}/rcS.d/S82lynq-fota-backup-service |
| 50 | fi |
| 51 | |
| 52 | install -m 0755 ${S}/lynq-fota-backup ${D}${bindir}/ |
| 53 | install -d ${D}${includedir} |
| 54 | } |