diff --git a/libjwt/Makefile b/libjwt/Makefile new file mode 100644 index 000000000..6ea710b4a --- /dev/null +++ b/libjwt/Makefile @@ -0,0 +1,52 @@ + +# Copyright (C) 2018 Iopsys +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libjwt +PKG_VERSION:=1.0.0 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=866607c7741421c8ac99876e7201eb32d9af1b92 +PKG_SOURCE_URL:=https://github.com/benmcollins/libjwt.git + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/libjwt + CATEGORY:=Libraries + DEPENDS:=+libopenssl +jansson + TITLE:= libjwt +endef + + +#TARGET_CFLAGS += \ +# -I$(STAGING_DIR)/usr/include +# -I$(STAGING_DIR)/usr/include/libnl3 + +#MAKE_FLAGS += \ +# CFLAGS="$(TARGET_CFLAGS)" \ +# LDFLAGS="$(TARGET_LDFLAGS)" \ +# FPIC="$(FPIC)" \ +# PLATFORM="$(TARGET_PLATFORM)" \ +# subdirs="$(subdirs)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/include/jwt.h $(1)/usr/include/ + $(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/ +endef + +define Package/libjwt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libjwt)) diff --git a/mqtt-ciotc/Makefile b/mqtt-ciotc/Makefile new file mode 100644 index 000000000..b8856b397 --- /dev/null +++ b/mqtt-ciotc/Makefile @@ -0,0 +1,36 @@ +# +# Copyright (C) 2013 Inteno +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=mqtt-ciotc +PKG_VERSION:=0.1 + +PKG_SOURCE_VERSION:=eda5bc711c215cbfe50ddd0e8725b69d4a3cff4f +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifilife-testbed.git + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/mqtt-ciotc + CATEGORY:=Utilities + DEPENDS:=+libjwt +lib-paho-mqtt +libopenssl +libubox +ubus +libblobmsg-json + TITLE:=mqtt google iot clinet +endef + +define Package/mqtt-ciotc/description + mqtt google iot client +endef + +define Package/mqtt-ciotc/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mqtt_ciotc $(1)/sbin/ +endef + +$(eval $(call BuildPackage,mqtt-ciotc)) diff --git a/mqtt-ciotc/files/etc/config/mqtt-ciotc b/mqtt-ciotc/files/etc/config/mqtt-ciotc new file mode 100644 index 000000000..6ee6b09ab --- /dev/null +++ b/mqtt-ciotc/files/etc/config/mqtt-ciotc @@ -0,0 +1,3 @@ +config mqtt-ciotc mqtt-ciotc + option private-cert '/etc/mqtt-ciotc/rsa_private.pem' + option root-cert '/etc/mqtt-ciotc/roots.pem' diff --git a/mqtt-ciotc/files/etc/init.d/mqtt-ciotc b/mqtt-ciotc/files/etc/init.d/mqtt-ciotc new file mode 100755 index 000000000..889ae0770 --- /dev/null +++ b/mqtt-ciotc/files/etc/init.d/mqtt-ciotc @@ -0,0 +1,35 @@ +#!/bin/sh /etc/rc.common + +START=96 +STOP=10 +PROG=/sbin/mqtt-ciotc + +USE_PROCD=1 + +start_service() { + procd_open_instance + procd_set_param command ${PROG} + config_load mqtt-ciotc + config_get private-cert mqtt-ciotc private-cert + config_get root-cert mqtt-ciotc root-cert + + [ -n $private-cert ] && procd_append_param command --private-cert $private-cert + [ -n $root-cert ] && procd_append_param command --root-cert $root-cert + procd_set_param respawn + procd_close_instance +} + +stop_service() +{ + service_stop ${PROG} +} + +reload_service() { +# procd_send_signal wifilife # use SIGHUP + stop + start +} + +service_triggers() { + procd_add_reload_trigger "mqtt-ciotc" +} diff --git a/paho-mqtt-c/Makefile b/paho-mqtt-c/Makefile new file mode 100644 index 000000000..a8f776cb6 --- /dev/null +++ b/paho-mqtt-c/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2013 Inteno +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=lib-paho-mqtt +PKG_VERSION:=0.1 + +PKG_SOURCE_VERSION:=9f715d0862a8e16099b5837c4e53a1bf6a6a0675 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/eclipse/paho.mqtt.c.git + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/lib-paho-mqtt + CATEGORY:=Libraries + DEPENDS:=+libopenssl + TITLE:=package for mqtt stuff +endef + + +define Package/lib-paho-mqtt/description + a library +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/*.h $(1)/usr/include/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/output/*.so* $(1)/usr/lib/ +endef + +define Package/lib-paho-mqtt/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/output/*.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,lib-paho-mqtt))