swupdate.inc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. SUMMARY="Image updater for Yocto projects"
  2. DESCRIPTION = "Application for automatic software update from USB Pen"
  3. SECTION="swupdate"
  4. DEPENDS = "mtd-utils libconfig libarchive openssl lua curl json-c u-boot-fw-utils gnutls zeromq"
  5. LICENSE = "GPLv2+"
  6. LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
  7. inherit cml1 update-rc.d systemd
  8. SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=git \
  9. file://defconfig \
  10. file://swupdate \
  11. file://swupdate.service \
  12. "
  13. SRCREV = "${AUTOREV}"
  14. PACKAGES =+ "${PN}-www"
  15. FILES_${PN}-www = "/www/*"
  16. FILES_${PN}-dev = "${includedir}"
  17. FILES_${PN}-staticdev = "${libdir}"
  18. FILES_${PN} = "${bindir}/* /etc"
  19. S = "${WORKDIR}/git/"
  20. EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
  21. do_configure () {
  22. cp ${WORKDIR}/defconfig ${S}/.config
  23. cml1_do_configure
  24. }
  25. do_compile() {
  26. unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
  27. oe_runmake swupdate_unstripped
  28. cp swupdate_unstripped swupdate
  29. if [ "${@bb.utils.vercmp_string('${PV}', '2016.07')}" = "1" ]; then
  30. oe_runmake progress_unstripped
  31. cp progress_unstripped progress
  32. fi
  33. }
  34. do_install () {
  35. install -d ${D}${bindir}/
  36. install -m 0755 swupdate ${D}${bindir}/
  37. install -m 0755 -d ${D}/www
  38. install -m 0755 ${S}www/* ${D}/www
  39. install -d ${D}${libdir}/
  40. install -d ${D}${includedir}/
  41. install -m 0644 ${S}include/network_ipc.h ${D}${includedir}
  42. install -m 0755 ${S}ipc/lib.a ${D}${libdir}/libswupdate.a
  43. install -d ${D}${sysconfdir}/init.d
  44. install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
  45. install -d ${D}${systemd_unitdir}/system
  46. install -m 644 ${WORKDIR}/swupdate.service ${D}${systemd_unitdir}/system
  47. }
  48. INITSCRIPT_NAME = "swupdate"
  49. INITSCRIPT_PARAMS = "defaults 70"
  50. SYSTEMD_SERVICE_${PN} = "swupdate.service"