Skip to content
Snippets Groups Projects
Commit 60e7314f authored by Sukru Senli's avatar Sukru Senli
Browse files

update for usp5

parent 5deb76eb
Branches usp5
No related tags found
Loading
# This Makefile is free software, SPDX codes: GPL-2.0-or-later OR MIT
include $(TOPDIR)/rules.mk
PKG_NAME:=cJSON
PKG_VERSION:=1.7.14
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/DaveGamble/cJSON/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=fb50a663eefdc76bafa80c82bc045af13b1363e8f45cec8b442007aef6a41343
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:cjson_project:cjson
CMAKE_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/cJSON
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Ultralightweight JSON parser in ANSI C
URL:=https://github.com/DaveGamble/cJSON
MAINTAINER:=Karl Palsson <karlp@etactica.com>
endef
define Package/cJSON/description
Ultralightweight JSON parser in ANSI C.
cJSON aims to be the dumbest possible parser that you can get your
job done with. It's a single file of C, and a single header file.
endef
CMAKE_OPTIONS += -DENABLE_CJSON_TEST=OFF
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libcjson.pc $(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(1)/usr/include/cjson
$(CP) $(PKG_INSTALL_DIR)/usr/include/cjson/cJSON.h $(1)/usr/include/cjson
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcjson.so* $(1)/usr/lib/
endef
define Package/cJSON/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcjson.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,cJSON))
......@@ -5,6 +5,22 @@ config MOSQUITTO_LWS
help
Includes websockets support in the broker, via libwebsockets
config MOSQUITTO_CTRL
bool "Include mosquitto_ctrl utility"
depends on PACKAGE_mosquitto-ssl
default y
help
mosquitto_ctrl is a tool for managing the broker at run time.
config MOSQUITTO_DYNAMIC_SECURITY
bool "Install mosquitto_dynamic_security.so"
depends on PACKAGE_mosquitto-ssl
default y
help
This enables the dynamic security modes documented at
https://mosquitto.org/documentation/dynamic-security/
but does add ~88kB. If you're not using it, you can disable it
config MOSQUITTO_PASSWD
bool "Include mosquitto_passwd utility"
depends on PACKAGE_mosquitto-ssl
......
......@@ -9,16 +9,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mosquitto
PKG_VERSION:=1.6.9
PKG_VERSION:=2.0.2
PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE:=EPL-2.0
PKG_LICENSE_FILES:=LICENSE.txt
PKG_CPE_ID:=cpe:/a:eclipse:mosquitto
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://mosquitto.org/files/source/
PKG_HASH:=412979b2db0a0020bd02fa64f0a0de9e7000b84462586e32b67f29bb1f6c1685
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_HASH:=5ea9ebf0a5ed3e95cecd75f30ebcf84f054584eff5617ac0f2e60428d3ad9707
include $(INCLUDE_DIR)/package.mk
......@@ -35,7 +34,7 @@ endef
define Package/mosquitto-ssl
$(call Package/mosquitto/default)
TITLE+= (with SSL support)
DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl
DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl +MOSQUITTO_DYNAMIC_SECURITY:cJSON
VARIANT:=ssl
PROVIDES:=mosquitto
endef
......@@ -53,7 +52,7 @@ endef
define Package/mosquitto/default/description
Mosquitto is an open source (BSD licensed) message broker that implements
the MQTT protocol version 3.1 and 3.1.1. MQTT provides a lightweight
the MQTT protocol version 3.1, 3.1.1 and 5. MQTT provides a lightweight
method of carrying out messaging using a publish/subscribe model.
This package also includes some basic support for configuring via UCI
......@@ -74,7 +73,7 @@ endef
define Package/mosquitto-client/default
$(Package/mosquitto/default)
TITLE:= mosquitto - client tools
DEPENDS+=+libcares
DEPENDS+=+libcares +cJSON
PROVIDES:=mosquitto-client
endef
define Package/mosquitto-client-ssl
......@@ -91,8 +90,9 @@ define Package/mosquitto-client-nossl
endef
define Package/mosquitto-client/default/description
Command line client tools for publishing messages to MQTT servers
and subscribing to topics.
Command line client tools for working with mosquitto.
This includes mosquitto_sub, mosquitto_pub, mosquitto_rr
and the mosquitto_ctrl tool.
endef
define Package/mosquitto-client-ssl/description
......@@ -127,11 +127,11 @@ endef
define Package/libmosquitto/default/description
Library required for mosquitto's command line client tools, also for
use by any third party software that wants to communicate with a
mosquitto server.
use by any third party software that wants to communicate with _any_
MQTT server.
Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
server, such as IBM's RSMB, in addition to Mosquitto
Should be useable for communicating with any MQTT v3.1/3.1.1/5 compatible
server, in addition to Mosquitto.
endef
define Package/libmosquitto-ssl/description
......@@ -177,24 +177,32 @@ define Package/mosquitto-ssl/install
$(call Package/mosquitto/install/default,$(1))
ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/apps/mosquitto_passwd/mosquitto_passwd $(1)/usr/bin
endif
ifeq ($(CONFIG_MOSQUITTO_DYNAMIC_SECURITY),y)
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/dynamic-security/mosquitto_dynamic_security.so $(1)/usr/lib
endif
endef
define Package/mosquitto-client-ssl/install
define Package/mosquitto-client-nossl/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_rr $(1)/usr/bin
endef
define Package/mosquitto-client-ssl/install
$(call Package/mosquitto-client-nossl/install,$(1))
ifeq ($(CONFIG_MOSQUITTO_CTRL),y)
$(INSTALL_BIN) $(PKG_BUILD_DIR)/apps/mosquitto_ctrl/mosquitto_ctrl $(1)/usr/bin
endif
endef
Package/mosquitto-client-nossl/install = $(Package/mosquitto-client-ssl/install)
# This installs files into ./staging_dir/. so that you can cross compile from the host
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/src/mosquitto_plugin.h $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/src/mosquitto_broker.h $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
......
config owrt owrt
option use_uci 0
config owrt 'owrt'
option use_uci '1'
config mosquitto 'mosquitto'
option log_facility '5'
option log_dest 'file /tmp/mosquitto.log'
option per_listener_settings '1'
config listener 'listener_1883'
option port '1883'
option no_remote_access '1'
option protocol 'mqtt'
option allow_anonymous '1'
option use_identity_as_username '1'
config listener 'listener_9001'
option port '9001'
option no_remote_access '0'
option protocol 'websockets'
option require_certificate '0'
option use_identity_as_username '1'
option allow_anonymous '0'
option password_file '/etc/mosquitto/mosquitto.password'
config listener 'listener_11883'
option port '11883'
option no_remote_access '0'
option protocol 'mqtt'
option require_certificate '0'
option use_identity_as_username '1'
option allow_anonymous '0'
option password_file '/etc/mosquitto/mosquitto.password'
config mosquitto mosquitto
......@@ -54,17 +54,15 @@ append_optional_bool() {
convert_mosq_general() {
local cfg="$1"
config_get destinations "$1" log_dest
for dest in $destinations; do
echo "log_dest $dest" >> $TCONF
done
[ -n "$destinations" ] && echo "log_dest $destinations" >> $TCONF
config_get_bool no_remote "$1" no_remote_access 0
if [ "$no_remote" -eq 1 ]; then
echo "bind_address localhost" >> $TCONF
fi
config_get port "$1" port 1883
echo "port $port" >> $TCONF
config_get port "$1" port #1883
[ -n "$port" ] && echo "port $port" >> $TCONF
append_if "$1" acl_file
append_optional_bool "$1" allow_anonymous
append_optional_bool "$1" allow_duplicate_messages
......@@ -75,7 +73,7 @@ convert_mosq_general() {
append_optional_bool "$1" log_timestamp
config_get log_types "$1" log_types
for log_type in $log_types; do
echo "log_dest $log_type" >> $TCONF
echo "log_type $log_type" >> $TCONF
done
append_if "$1" max_inflight_bytes
append_if "$1" max_inflight_messages
......@@ -146,6 +144,8 @@ add_listener() {
append_optional_bool "$1" use_subject_as_username
append_if "$1" psk_hint
append_if "$1" auth_plugin
append_if "$1" password_file
append_optional_bool "$1" allow_anonymous
# Careful, this relies on internal behaviour of the cfg_load functions!
set | grep "CONFIG_$1_auth_opt_" | sed "s/^.*_\(auth_opt_.*\)='\(.*\)'/\1 \2/" >> $TCONF
......
log_type all
log_dest file /tmp/mosquitto.log
log_facility 5
per_listener_settings true
listener 1883 localhost
socket_domain ipv4
allow_anonymous true
listener 9001
socket_domain ipv4
protocol websockets
require_certificate false
use_identity_as_username true
allow_anonymous false
password_file /etc/mosquitto/mosquitto.password
#listener 1883 0.0.0.0 does not work
listener 11883
socket_domain ipv4
protocol mqtt
require_certificate false
use_identity_as_username true
allow_anonymous false
password_file /etc/mosquitto/mosquitto.password
admin:$7$101$GYCG2oFryQQFTaRN$KrAULxvEn1HEPDrASwqbl4hfW6I3G9OCAi2WhtY5fWpYrJe5hBz9MOqTZUdruFWEiQZ/ktSEDvFxocnPMU0A1A==
user:$7$101$93cvCJbz79YuypKi$2+7YMrGOGXP3o2VTc0TbNuuKC/L5uq4qPh9QXWeZGimLCjW8ILrk3wWkuBkAFOHhCZfBgNaj4/9YT4LYmGWtyQ==
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment