From ddf781899382e04ab5c2084cb7d07bb30975eff6 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Tue, 31 Dec 2019 14:32:12 -0600 Subject: lora: update to LNS 2.3.3, requires mosquitto 1.5.1 and jsoncpp changes --- .../lora/lora-network-server_2.3.2.bb | 48 ------------- .../lora/lora-network-server_2.3.3.bb | 48 +++++++++++++ .../mosquitto/mosquitto/config_mk.patch | 17 ++++- recipes-connectivity/mosquitto/mosquitto_1.5.1.bb | 81 ++++++++++++++++++++++ recipes-support/jsoncpp/jsoncpp-1.6.0/Makefile | 21 +++--- recipes-support/jsoncpp/jsoncpp_1.6.0.bb | 19 +++-- 6 files changed, 166 insertions(+), 68 deletions(-) delete mode 100644 recipes-connectivity/lora/lora-network-server_2.3.2.bb create mode 100644 recipes-connectivity/lora/lora-network-server_2.3.3.bb create mode 100644 recipes-connectivity/mosquitto/mosquitto_1.5.1.bb diff --git a/recipes-connectivity/lora/lora-network-server_2.3.2.bb b/recipes-connectivity/lora/lora-network-server_2.3.2.bb deleted file mode 100644 index 5afeb62..0000000 --- a/recipes-connectivity/lora/lora-network-server_2.3.2.bb +++ /dev/null @@ -1,48 +0,0 @@ -DESCRIPTION = "MultiTech LoRa Network Server" -PRIORITY = "optional" -SECTION = "console/utils" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://LICENSE;md5=2b9a30a3082ddccd2c695a4dbeeab80d" -DEPENDS = "jsoncpp libmts mosquitto sqlite3 curl gnutls" -RDEPENDS_${PN} += "lora-packet-forwarder logrotate bash lora-logging" -PR = "r0" -CONFFILES_${PN} += "${sysconfdir}/default/lora-network-server ${sysconfdir}/init.d/lora-network-server" - -SRC_URI = "http://multitech.net/downloads/lora-network-server_${PV}.tar.gz \ - file://lora-network-server.init \ - file://lora-network-server.default \ - " - -SRC_URI[md5sum] = "781eedf0ca284adb3a921a1ed2e745d2" -SRC_URI[sha256sum] = "06f3a1eabbb41289ac40792e2a0f60dcd5b86ba2bfd827db0a43c4777e43458c" - -# binaries are already stripped, so suppress warning -INSANE_SKIP_${PN} = "already-stripped" - -S = "${WORKDIR}" - -LORA_DIR = "/opt/lora" - -do_compile() { -} - -inherit update-rc.d - -INITSCRIPT_NAME = "lora-network-server" -INITSCRIPT_PARAMS = "defaults 80 30" - -do_install() { - install -d ${D}${LORA_DIR} - install -m 0755 lora-network-server-mlinux-4 ${D}${LORA_DIR}/lora-network-server - install -m 0755 lora-v21-keygen ${D}${LORA_DIR}/lora-v21-keygen - install -m 0644 config/lora-network-server.conf.sample ${D}${LORA_DIR}/lora-network-server.conf.sample - install -m 0644 config/lora-network-server.conf.full ${D}${LORA_DIR}/lora-network-server.conf.full - - install -d ${D}${sysconfdir}/default - install -m 0644 ${WORKDIR}/lora-network-server.default ${D}${sysconfdir}/default/lora-network-server - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/lora-network-server.init ${D}${sysconfdir}/init.d/lora-network-server -} - -FILES_${PN} += "${LORA_DIR}" -FILES_${PN}-dbg += "${LORA_DIR}/.debug" diff --git a/recipes-connectivity/lora/lora-network-server_2.3.3.bb b/recipes-connectivity/lora/lora-network-server_2.3.3.bb new file mode 100644 index 0000000..8b75ea6 --- /dev/null +++ b/recipes-connectivity/lora/lora-network-server_2.3.3.bb @@ -0,0 +1,48 @@ +DESCRIPTION = "MultiTech LoRa Network Server" +PRIORITY = "optional" +SECTION = "console/utils" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2b9a30a3082ddccd2c695a4dbeeab80d" +DEPENDS = "jsoncpp libmts mosquitto sqlite3 curl gnutls" +RDEPENDS_${PN} += "lora-packet-forwarder logrotate bash lora-logging" +PR = "r0" +CONFFILES_${PN} += "${sysconfdir}/default/lora-network-server ${sysconfdir}/init.d/lora-network-server" + +SRC_URI = "http://multitech.net/downloads/lora-network-server_${PV}.tar.gz \ + file://lora-network-server.init \ + file://lora-network-server.default \ + " + +SRC_URI[md5sum] = "b0bc859e1f60b1a92b06c4bb97f70109" +SRC_URI[sha256sum] = "f8ba944a024531dbf58f2de462cb7ccfb5e3cb8d8dedb51077e7719f32f9adc4" + +# binaries are already stripped, so suppress warning +INSANE_SKIP_${PN} = "already-stripped" + +S = "${WORKDIR}" + +LORA_DIR = "/opt/lora" + +do_compile() { +} + +inherit update-rc.d + +INITSCRIPT_NAME = "lora-network-server" +INITSCRIPT_PARAMS = "defaults 80 30" + +do_install() { + install -d ${D}${LORA_DIR} + install -m 0755 lora-network-server-arm926ejste-mlinux-5.2 ${D}${LORA_DIR}/lora-network-server + install -m 0755 lora-v21-keygen-arm926ejste-mlinux-5.2 ${D}${LORA_DIR}/lora-v21-keygen + install -m 0644 config/lora-network-server.conf.sample ${D}${LORA_DIR}/lora-network-server.conf.sample + install -m 0644 config/lora-network-server.conf.full ${D}${LORA_DIR}/lora-network-server.conf.full + + install -d ${D}${sysconfdir}/default + install -m 0644 ${WORKDIR}/lora-network-server.default ${D}${sysconfdir}/default/lora-network-server + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/lora-network-server.init ${D}${sysconfdir}/init.d/lora-network-server +} + +FILES_${PN} += "${LORA_DIR}" +FILES_${PN}-dbg += "${LORA_DIR}/.debug" diff --git a/recipes-connectivity/mosquitto/mosquitto/config_mk.patch b/recipes-connectivity/mosquitto/mosquitto/config_mk.patch index 8c0494e..437022c 100644 --- a/recipes-connectivity/mosquitto/mosquitto/config_mk.patch +++ b/recipes-connectivity/mosquitto/mosquitto/config_mk.patch @@ -1,7 +1,18 @@ diff -Naur old/config.mk new/config.mk --- old/config.mk 2017-04-17 14:33:32.504351936 -0500 +++ new/config.mk 2017-04-17 14:34:27.061557282 -0500 -@@ -240,7 +240,7 @@ +@@ -83,9 +83,9 @@ + # Strip executables and shared libraries on install. + WITH_STRIP:=no + + # Build static libraries +-WITH_STATIC_LIBRARIES:=no ++WITH_STATIC_LIBRARIES:=yes + + # Build with async dns lookup support for bridges (temporary). Requires glibc. + #WITH_ADNS:=yes + +@@ -272,7 +272,7 @@ endif INSTALL?=install @@ -10,3 +21,7 @@ diff -Naur old/config.mk new/config.mk mandir=${prefix}/share/man localedir=${prefix}/share/locale STRIP?=strip + + + + diff --git a/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb b/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb new file mode 100644 index 0000000..947dcdf --- /dev/null +++ b/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb @@ -0,0 +1,81 @@ +# This recipe was a merger of the Multitech Daisy 3.5 Recipe with the +# reciped found at: +# http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-iot-middleware/plain/recipes-connectivity/mosquitto/mosquitto_1.4.10.bb +inherit autotools-brokensep +SUMMARY = "Open source MQTT v3.5 implemention" +DESCRIPTION = "Mosquitto is an open source (BSD licensed) message broker that implements the MQ Telemetry Transport protocol version 3.5. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. " +HOMEPAGE = "http://mosquitto.org/" +SECTION = "console/network" +LICENSE = "EPL-1.0 & EDL-1.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20" + +# util-linux is needed to provide libuuid dependancy +DEPENDS = "c-ares openssl util-linux" + +PR = "r3" + +SRC_URI = "http://mosquitto.org/files/source/${PN}-${PV}.tar.gz \ + file://mosquitto.init \ + file://mosquitto.conf \ + file://mosquitto.default \ + file://mosquitto.logrotate.conf \ + file://config_mk.patch \ + " +SRC_URI[md5sum] = "f98c99998a36a234f3a9d9b402b991db" +SRC_URI[sha256sum] = "8557bc7ae34dfaf32a0fb56d2491b7a7f731269c88337227233013502df4d5b0" + +export LIB_SUFFIX="${@d.getVar('baselib', True).replace('lib', '')}" +inherit autotools update-rc.d + +INITSCRIPT_NAME = "mosquitto" +INITSCRIPT_PARAMS = "defaults 70 30" +do_compile() { + WITH_STATIC_LIBRARIES=1 oe_runmake PREFIX=/usr WITH_STATIC_LIBRARIES=1 +} +do_install() { + # oe_runmake DESTDIR=${D} prefix=/usr install + oe_runmake install DESTDIR=${D} + install -m 0755 -d ${D}/usr/lib + install -m 0644 lib/libmosquitto.a ${D}${libdir}/ + + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/default + install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto + install -m 0644 ${WORKDIR}/mosquitto.conf ${D}${sysconfdir}/mosquitto/ + install -m 0644 ${WORKDIR}/mosquitto.default ${D}${sysconfdir}/default/mosquitto + + install -d ${D}${sysconfdir}/logrotate.d + install -m 0644 ${WORKDIR}/mosquitto.logrotate.conf ${D}${sysconfdir}/logrotate.d/mosquitto.conf +} + +do_rm_work() { + echo "skipping" +} + + +PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients ${PN}-python" + +CONFFILES_${PN} = "${sysconfdir}/mosquitto.conf ${sysconfdir}/default/mosquitto" +FILES_${PN} = "${sbindir}/mosquitto \ + ${bindir}/mosquitto_passwd \ + ${sysconfdir}/mosquitto \ + ${systemd_unitdir}/system/mosquitto.service \ + ${sysconfdir}/ \ +" + +FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1" + +FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1" + +FILES_${PN}-clients = "${bindir}/mosquitto_pub \ + ${bindir}/mosquitto_sub \ +" + +FILES_${PN}-staticdev += "${libdir}/libmosquitto.a" + +FILES_${PN}-python = "/usr/lib/python2.7/site-packages" + +inherit systemd + +SYSTEMD_SERVICE_${PN} = "mosquitto.service" + diff --git a/recipes-support/jsoncpp/jsoncpp-1.6.0/Makefile b/recipes-support/jsoncpp/jsoncpp-1.6.0/Makefile index 3be3743..7df3d63 100644 --- a/recipes-support/jsoncpp/jsoncpp-1.6.0/Makefile +++ b/recipes-support/jsoncpp/jsoncpp-1.6.0/Makefile @@ -16,29 +16,32 @@ json_reader.d \ json_value.d \ json_writer.d -all: libjsoncpp.a +TARGET = libjsoncpp.so -libjsoncpp.a: $(OBJS) +all: $(TARGET) + +libjsoncpp.so: $(OBJS) @echo 'Building target: $@' - $(AR) -r libjsoncpp.a $(OBJS) + #$(AR) -r libjsoncpp.a $(OBJS) + $(CXX) ${LDFLAGS} -shared -o $@ $^ @echo 'Finished building target: $@' @echo ' ' %.o: src/lib_json/%.cpp @echo 'Building file: $<' - $(CXX) $(CFLAGS) -Iinclude -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(CXX) $(CFLAGS) -Iinclude -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -fPIC -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' install: - mkdir -p $(DESTDIR)$(libdir) - mkdir -p $(DESTDIR)$(includedir)/jsoncpp/json - cp libjsoncpp.a $(DESTDIR)$(libdir)/ - cp include/json/* $(DESTDIR)$(includedir)/jsoncpp/json/ + install -d $(DESTDIR)/usr/include/json + install -m 644 include/json/*.h $(DESTDIR)/usr/include/json + mkdir -p $(DESTDIR)/usr/lib + cp libjsoncpp.so $(DESTDIR)/usr/lib # Other Targets clean: - -$(RM) $(OBJS)$(CPP_DEPS) libjsoncpp.a + -$(RM) $(OBJS)$(CPP_DEPS) libjsoncpp.so -@echo ' ' .PHONY: all clean dependents diff --git a/recipes-support/jsoncpp/jsoncpp_1.6.0.bb b/recipes-support/jsoncpp/jsoncpp_1.6.0.bb index 80f3f70..8c8454d 100644 --- a/recipes-support/jsoncpp/jsoncpp_1.6.0.bb +++ b/recipes-support/jsoncpp/jsoncpp_1.6.0.bb @@ -4,10 +4,6 @@ HOMEPAGE = "https://github.com/open-source-parsers/jsoncpp" LICENSE = "PD" LIC_FILES_CHKSUM = "file://LICENSE;md5=c56ee55c03a55f8105b969d8270632ce" DEPENDS = "" -BBCLASSEXTEND = "native" - -# static lib only, require staticdev -RDEPENDS_${PN}-dev = "${PN}-staticdev" #tag 1.6.0 SRCREV="cbe7e7c9cbd39d864588c5cf2436690634562d3f" @@ -16,7 +12,7 @@ SRC_URI = " git://github.com/open-source-parsers/jsoncpp.git;protocol=git \ file://Makefile \ " -PR = "r1" +PR = "r6" S = "${WORKDIR}/git" @@ -25,10 +21,13 @@ do_compile() { oe_runmake } -do_install() { - oe_runmake install DESTDIR=${D} +do_install () { + install -d ${D}/usr/lib + install -m 0755 ${S}/libjsoncpp.so ${D}/usr/lib + install -d ${D}${includedir}/jsoncpp/json + install -m 0755 ${S}/include/json/*.h ${D}${includedir}/jsoncpp/json } -# this recipe provides dev packages only (static lib) -PACKAGES = "${PN}-dev ${PN}-staticdev ${PN}-dbg" - +FILES_SOLIBSDEV = "" +FILES_${PN} += "${libdir}/*.so" +FILES_{PN}-dev += "${libdir}/*.so" -- cgit v1.2.3