All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/3] Update package mosquitto
@ 2019-08-03  9:38 Titouan Christophe
  2019-08-03  9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Titouan Christophe @ 2019-08-03  9:38 UTC (permalink / raw)
  To: buildroot

This patchset extend the mosquitto integration with Buildroot's
build system and systemd, thanks to configuration options that have
been introduced in mosquitto 1.5. Finally, it updates the help text
in Config.in and add myself to the DEVELOPERS.

Changes in v2:
    - Explicit dependency on systemd when enabled
    - Broker needs dylibs
    - Update help text and DEVELOPERS

Titouan Christophe (3):
  package/mosquitto: allow to build as static lib
  package/mosquitto: extend systemd integration
  package/mosquitto: update help text in Config.in

 DEVELOPERS                          |  1 +
 package/mosquitto/Config.in         | 31 +++++++++++++++++------------
 package/mosquitto/mosquitto.mk      | 19 +++++++++++++++++-
 package/mosquitto/mosquitto.service | 10 ----------
 4 files changed, 37 insertions(+), 24 deletions(-)
 delete mode 100644 package/mosquitto/mosquitto.service

-- 
2.21.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
  2019-08-03  9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
@ 2019-08-03  9:38 ` Titouan Christophe
  2019-08-03 11:13   ` Peter Korsgaard
  2019-08-03  9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
  2019-08-03  9:38 ` [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in Titouan Christophe
  2 siblings, 1 reply; 7+ messages in thread
From: Titouan Christophe @ 2019-08-03  9:38 UTC (permalink / raw)
  To: buildroot

Since version 1.5, it is possible to build mosquitto as a static lib.

However, the broker still needs a toolchain with support for shared libraries,
because it contains code to dynamically load modules at runtime. This
code makes use of dlfcn.h, which is only available for dylib enabled
systems.

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
 package/mosquitto/Config.in    |  9 +++------
 package/mosquitto/mosquitto.mk | 12 ++++++++++++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index c7373d9a84..8f2561c2d8 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_MOSQUITTO
 	bool "mosquitto"
-	depends on !BR2_STATIC_LIBS # builds .so
 	help
 	  Mosquitto is an open source message broker that implements
 	  the MQ Telemetry Transport protocol versions 3.1 and
@@ -16,12 +15,10 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
 	bool "install the mosquitto broker"
 	default y
 	depends on BR2_USE_MMU # fork()
+	depends on !BR2_STATIC_LIBS # include <dlfcn.h>
 	depends on BR2_PACKAGE_MOSQUITTO
 	help
 	  Build and install the mosquitto broker onto target.
 
-comment "mosquitto broker needs a system with MMU"
-	depends on BR2_PACKAGE_MOSQUITTO && !BR2_USE_MMU
-
-comment "mosquitto needs a toolchain w/ dynamic library"
-	depends on BR2_STATIC_LIBS
+comment "mosquitto broker needs a system with MMU; toolchain w/ dynamic library"
+	depends on BR2_PACKAGE_MOSQUITTO && (!BR2_USE_MMU || BR2_STATIC_LIBS)
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index a172afcc53..eb39f0af6e 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -17,6 +17,18 @@ MOSQUITTO_MAKE_OPTS = \
 	WITH_WRAP=no \
 	WITH_DOCS=no
 
+ifeq ($(BR2_SHARED_LIBS),y)
+MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no
+else
+MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes
+endif
+
+ifeq ($(BR2_STATIC_LIBS),y)
+MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=no
+else
+MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
+endif
+
 # adns uses getaddrinfo_a
 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
 MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration
  2019-08-03  9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
  2019-08-03  9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
@ 2019-08-03  9:38 ` Titouan Christophe
  2019-08-03 11:13   ` Peter Korsgaard
  2019-08-03  9:38 ` [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in Titouan Christophe
  2 siblings, 1 reply; 7+ messages in thread
From: Titouan Christophe @ 2019-08-03  9:38 UTC (permalink / raw)
  To: buildroot

Since version 1.5, mosquitto can be built with explicit support for
systemd. If enabled, libmosquitto will link against libsystemd: when
started, the mosquitto broker notifies systemd that it is ready (ie.
initialized and ready to accept connections), so that services that
depend on the mqtt broker can be started only at that point.

To enable this feature, the systemd service config file needs to change
to Type=notify. Upstream now provides such a file, so we can remove
ours.

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
 package/mosquitto/mosquitto.mk      |  7 ++++++-
 package/mosquitto/mosquitto.service | 10 ----------
 2 files changed, 6 insertions(+), 11 deletions(-)
 delete mode 100644 package/mosquitto/mosquitto.service

diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index eb39f0af6e..6de6fc804f 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -29,6 +29,11 @@ else
 MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+MOSQUITTO_MAKE_OPTS += WITH_SYSTEMD=yes
+MOSQUITTO_DEPENDENCIES += systemd
+endif
+
 # adns uses getaddrinfo_a
 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
 MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
@@ -102,7 +107,7 @@ define MOSQUITTO_INSTALL_INIT_SYSV
 endef
 
 define MOSQUITTO_INSTALL_INIT_SYSTEMD
-	$(INSTALL) -D -m 644 package/mosquitto/mosquitto.service \
+	$(INSTALL) -D -m 644 $(@D)/service/systemd/mosquitto.service.notify \
 		$(TARGET_DIR)/usr/lib/systemd/system/mosquitto.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 	ln -fs ../../../../usr/lib/systemd/system/mosquitto.service \
diff --git a/package/mosquitto/mosquitto.service b/package/mosquitto/mosquitto.service
deleted file mode 100644
index 2d1939d1c7..0000000000
--- a/package/mosquitto/mosquitto.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Mosquitto MQTT broker
-
-[Service]
-ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
-ExecReload=/bin/kill -HUP $MAINPID
-Restart=always
-
-[Install]
-WantedBy=multi-user.target
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in
  2019-08-03  9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
  2019-08-03  9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
  2019-08-03  9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
@ 2019-08-03  9:38 ` Titouan Christophe
  2019-08-03 11:14   ` Peter Korsgaard
  2 siblings, 1 reply; 7+ messages in thread
From: Titouan Christophe @ 2019-08-03  9:38 UTC (permalink / raw)
  To: buildroot

(and add myself to DEVELOPERS)

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
 DEVELOPERS                  |  1 +
 package/mosquitto/Config.in | 22 +++++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/DEVELOPERS b/DEVELOPERS
index 74f52d26fd..a2017ef593 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2247,6 +2247,7 @@ N:	Timo Ketola <timo.ketola@exertus.fi>
 F:	package/fbgrab/
 
 N:	Titouan Christophe <titouan.christophe@railnova.eu>
+F:	package/mosquitto/
 F:	package/redis/
 
 N:	Trent Piepho <tpiepho@impinj.com>
diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index 8f2561c2d8..272035f18b 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -1,13 +1,21 @@
 config BR2_PACKAGE_MOSQUITTO
 	bool "mosquitto"
 	help
-	  Mosquitto is an open source message broker that implements
-	  the MQ Telemetry Transport protocol versions 3.1 and
-	  3.1.1. MQTT provides a lightweight method of carrying out
-	  messaging using a publish/subscribe model. This makes it
-	  suitable for "machine to machine" messaging such as with low
-	  power sensors or mobile devices such as phones, embedded
-	  computers or microcontrollers like the Arduino.
+	  Eclipse Mosquitto is an open source (EPL/EDL licensed) message
+	  broker that implements the MQTT protocol versions 5.0, 3.1.1
+	  and 3.1. Mosquitto is lightweight and is suitable for use on
+	  all devices from low power single board computers to full
+	  servers.
+
+	  The MQTT protocol provides a lightweight method of carrying
+	  out messaging using a publish/subscribe model. This makes it
+	  suitable for Internet of Things messaging such as with low
+	  power sensors or mobile devices such as phones,
+	  embedded computers or microcontrollers.
+
+	  The Mosquitto project also provides a C library for
+	  implementing MQTT clients, and the very popular mosquitto_pub
+	  and mosquitto_sub command line MQTT clients.
 
 	  http://mosquitto.org/
 
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
  2019-08-03  9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
@ 2019-08-03 11:13   ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2019-08-03 11:13 UTC (permalink / raw)
  To: buildroot

>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:

 > Since version 1.5, it is possible to build mosquitto as a static lib.
 > However, the broker still needs a toolchain with support for shared libraries,
 > because it contains code to dynamically load modules at runtime. This
 > code makes use of dlfcn.h, which is only available for dylib enabled
 > systems.

 > Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
 > ---
 >  package/mosquitto/Config.in    |  9 +++------
 >  package/mosquitto/mosquitto.mk | 12 ++++++++++++
 >  2 files changed, 15 insertions(+), 6 deletions(-)

 > diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
 > index c7373d9a84..8f2561c2d8 100644
 > --- a/package/mosquitto/Config.in
 > +++ b/package/mosquitto/Config.in
 > @@ -1,6 +1,5 @@
 >  config BR2_PACKAGE_MOSQUITTO
 >  	bool "mosquitto"
 > -	depends on !BR2_STATIC_LIBS # builds .so
 >  	help
 >  	  Mosquitto is an open source message broker that implements
 >  	  the MQ Telemetry Transport protocol versions 3.1 and
 > @@ -16,12 +15,10 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
 >  	bool "install the mosquitto broker"
 >  	default y
 >  	depends on BR2_USE_MMU # fork()
 > +	depends on !BR2_STATIC_LIBS # include <dlfcn.h>
 >  	depends on BR2_PACKAGE_MOSQUITTO
 >  	help
 >  	  Build and install the mosquitto broker onto target.
 
 > -comment "mosquitto broker needs a system with MMU"
 > -	depends on BR2_PACKAGE_MOSQUITTO && !BR2_USE_MMU
 > -
 > -comment "mosquitto needs a toolchain w/ dynamic library"
 > -	depends on BR2_STATIC_LIBS
 > +comment "mosquitto broker needs a system with MMU; toolchain w/ dynamic library"
 > +	depends on BR2_PACKAGE_MOSQUITTO && (!BR2_USE_MMU || BR2_STATIC_LIBS)

Not your fault, but this message should not mention MMU (as the user
cannot change it) and only be displayed if mosquitto && mmu && static.

Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration
  2019-08-03  9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
@ 2019-08-03 11:13   ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2019-08-03 11:13 UTC (permalink / raw)
  To: buildroot

>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:

 > Since version 1.5, mosquitto can be built with explicit support for
 > systemd. If enabled, libmosquitto will link against libsystemd: when
 > started, the mosquitto broker notifies systemd that it is ready (ie.
 > initialized and ready to accept connections), so that services that
 > depend on the mqtt broker can be started only at that point.

 > To enable this feature, the systemd service config file needs to change
 > to Type=notify. Upstream now provides such a file, so we can remove
 > ours.

 > Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in
  2019-08-03  9:38 ` [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in Titouan Christophe
@ 2019-08-03 11:14   ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2019-08-03 11:14 UTC (permalink / raw)
  To: buildroot

>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:

 > (and add myself to DEVELOPERS)
 > Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
 > ---

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-03 11:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-03  9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
2019-08-03  9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
2019-08-03 11:13   ` Peter Korsgaard
2019-08-03  9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
2019-08-03 11:13   ` Peter Korsgaard
2019-08-03  9:38 ` [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in Titouan Christophe
2019-08-03 11:14   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.