From 5e4916edcf190f48e701eb72e6fdd030c5d08156 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Mon, 31 Oct 2016 17:01:12 -0400 Subject: [PATCH] Add libmosquitto and its CLI clients (#515) --- packages/libmosquitto/build.sh | 17 +++++++++ packages/libmosquitto/config.patch | 36 +++++++++++++++++++ packages/libmosquitto/mosquitto.subpackage.sh | 3 ++ 3 files changed, 56 insertions(+) create mode 100644 packages/libmosquitto/build.sh create mode 100644 packages/libmosquitto/config.patch create mode 100644 packages/libmosquitto/mosquitto.subpackage.sh diff --git a/packages/libmosquitto/build.sh b/packages/libmosquitto/build.sh new file mode 100644 index 000000000..b3aa40bd3 --- /dev/null +++ b/packages/libmosquitto/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=http://www.mosquitto.org +TERMUX_PKG_DESCRIPTION="MQTT library" +TERMUX_PKG_VERSION=1.4.10 +TERMUX_PKG_SHA256=437648d68a4a781dd8d913814cd5451f59ab4a5fcf84cccaf7c36e6a07459770 +TERMUX_PKG_SRCURL=http://mosquitto.org/files/source/mosquitto-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_BUILD_IN_SRC=Yes +TERMUX_PKG_DEPENDS="c-ares, openssl" +TERMUX_PKG_MAINTAINER="Nathaniel Wesley Filardo @nwf" + +termux_step_configure () { : ; } +termux_step_make () { + for i in lib client; do make -C $i; done +} +termux_step_make_install() { + for i in lib client; do make -C $i DESTDIR=${TERMUX_PREFIX} install; done +} + diff --git a/packages/libmosquitto/config.patch b/packages/libmosquitto/config.patch new file mode 100644 index 000000000..2505036a8 --- /dev/null +++ b/packages/libmosquitto/config.patch @@ -0,0 +1,36 @@ +diff --git a/config.mk b/config.mk +index 087766c..6ff9bc1 100644 +--- a/config.mk ++++ b/config.mk +@@ -26,10 +26,10 @@ WITH_TLS:=yes + # Comment out to disable TLS/PSK support in the broker and client. Requires + # WITH_TLS=yes. + # This must be disabled if using openssl < 1.0. +-WITH_TLS_PSK:=yes ++WITH_TLS_PSK:=no + + # Comment out to disable client client threading support. +-WITH_THREADING:=yes ++WITH_THREADING:=no + + # Comment out to remove bridge support from the broker. This allow the broker + # to connect to other brokers and subscribe/publish to topics. You probably +@@ -124,8 +124,7 @@ LIB_LIBS:= + PASSWD_LIBS:= + + ifeq ($(UNAME),Linux) +- BROKER_LIBS:=$(BROKER_LIBS) -lrt -Wl,--dynamic-list=linker.syms +- LIB_LIBS:=$(LIB_LIBS) -lrt ++ BROKER_LIBS:=$(BROKER_LIBS) -Wl,--dynamic-list=linker.syms + endif + + CLIENT_LDFLAGS:=$(LDFLAGS) -L../lib ../lib/libmosquitto.so.${SOVERSION} +@@ -241,7 +240,7 @@ ifeq ($(WITH_DOCS),yes) + endif + + INSTALL?=install +-prefix=/usr/local ++prefix= + mandir=${prefix}/share/man + localedir=${prefix}/share/locale + STRIP?=strip diff --git a/packages/libmosquitto/mosquitto.subpackage.sh b/packages/libmosquitto/mosquitto.subpackage.sh new file mode 100644 index 000000000..a5426f891 --- /dev/null +++ b/packages/libmosquitto/mosquitto.subpackage.sh @@ -0,0 +1,3 @@ +TERMUX_SUBPKG_DEPENDS="libmosquitto" +TERMUX_SUBPKG_INCLUDE="bin/mosquitto_pub bin/mosquitto_sub" +TERMUX_SUBPKG_DESCRIPTION="mosquitto_pub and _sub clients"