All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/mosquitto: installing the mosquitto broker can be optional
@ 2018-10-24 19:01 Titouan Christophe
  2018-10-26 10:12 ` Peter Korsgaard
  2018-10-29 16:54 ` [Buildroot] [-v2] " Titouan Christophe
  0 siblings, 2 replies; 4+ messages in thread
From: Titouan Christophe @ 2018-10-24 19:01 UTC (permalink / raw)
  To: buildroot

The mosquitto package providess both the MQTT client library and
a broker, and the latter may be not needed (when connecting to
a remote broker). It should be therefore possible to not install and
start it on the target

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
 .../0002-DIRS-externally-configurable.patch         |  9 +++++++++
 package/mosquitto/Config.in                         |  9 +++++++++
 package/mosquitto/mosquitto.mk                      | 13 ++++++++++---
 3 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 package/mosquitto/0002-DIRS-externally-configurable.patch

diff --git a/package/mosquitto/0002-DIRS-externally-configurable.patch b/package/mosquitto/0002-DIRS-externally-configurable.patch
new file mode 100644
index 0000000000..a95a7db14b
--- /dev/null
+++ b/package/mosquitto/0002-DIRS-externally-configurable.patch
@@ -0,0 +1,9 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ include config.mk
+ 
+-DIRS=lib client src
++DIRS:=lib client src
+ DOCDIRS=man
+ DISTDIRS=man
diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index 1e6418a4de..54856c1c80 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -14,6 +14,15 @@ config BR2_PACKAGE_MOSQUITTO
 
 	  http://mosquitto.org/
 
+
+config BR2_PACKAGE_MOSQUITTO_INSTALL_BROKER
+	bool "Install the mosquitto broker"
+	default y
+	depends on BR2_PACKAGE_MOSQUITTO
+	help
+	  Build and install the mosquitto broker onto target
+
+
 comment "mosquitto needs a toolchain w/ dynamic library"
 	depends on BR2_USE_MMU
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index 1d72f9b16e..c6604efda3 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -67,24 +67,30 @@ endef
 MOSQUITTO_POST_PATCH_HOOKS += MOSQUITTO_DISABLE_CPP
 endif
 
+MOSQUITTO_MAKE_DIRS = lib client
+ifeq ($(BR2_PACKAGE_MOSQUITTO_INSTALL_BROKER),y)
+	MOSQUITTO_MAKE_DIRS += src
+endif
+
 define MOSQUITTO_BUILD_CMDS
-	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 		$(MOSQUITTO_MAKE_OPTS)
 endef
 
 define MOSQUITTO_INSTALL_STAGING_CMDS
-	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 		$(MOSQUITTO_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
 endef
 
 define MOSQUITTO_INSTALL_TARGET_CMDS
-	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 		$(MOSQUITTO_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
 	rm -f $(TARGET_DIR)/etc/mosquitto/*.example
 	$(INSTALL) -D -m 0644 $(@D)/mosquitto.conf \
 		$(TARGET_DIR)/etc/mosquitto/mosquitto.conf
 endef
 
+ifeq ($(BR2_PACKAGE_MOSQUITTO_INSTALL_BROKER),y)
 define MOSQUITTO_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 0755 package/mosquitto/S50mosquitto \
 		$(TARGET_DIR)/etc/init.d/S50mosquitto
@@ -97,6 +103,7 @@ define MOSQUITTO_INSTALL_INIT_SYSTEMD
 	ln -fs ../../../../usr/lib/systemd/system/mosquitto.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mosquitto.service
 endef
+endif
 
 define MOSQUITTO_USERS
 	mosquitto -1 nogroup -1 * - - - Mosquitto user
-- 
2.18.1

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

* [Buildroot] [PATCH 1/1] package/mosquitto: installing the mosquitto broker can be optional
  2018-10-24 19:01 [Buildroot] [PATCH 1/1] package/mosquitto: installing the mosquitto broker can be optional Titouan Christophe
@ 2018-10-26 10:12 ` Peter Korsgaard
  2018-10-29 16:54 ` [Buildroot] [-v2] " Titouan Christophe
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2018-10-26 10:12 UTC (permalink / raw)
  To: buildroot

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

 > The mosquitto package providess both the MQTT client library and
 > a broker, and the latter may be not needed (when connecting to
 > a remote broker). It should be therefore possible to not install and
 > start it on the target

 > Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
 > ---
 >  .../0002-DIRS-externally-configurable.patch         |  9 +++++++++
 >  package/mosquitto/Config.in                         |  9 +++++++++
 >  package/mosquitto/mosquitto.mk                      | 13 ++++++++++---
 >  3 files changed, 28 insertions(+), 3 deletions(-)
 >  create mode 100644 package/mosquitto/0002-DIRS-externally-configurable.patch

 > diff --git a/package/mosquitto/0002-DIRS-externally-configurable.patch b/package/mosquitto/0002-DIRS-externally-configurable.patch
 > new file mode 100644
 > index 0000000000..a95a7db14b
 > --- /dev/null
 > +++ b/package/mosquitto/0002-DIRS-externally-configurable.patch

Patches should include a description and your signed-off-by.

> @@ -0,0 +1,9 @@
 > +--- a/Makefile
 > ++++ b/Makefile
 > +@@ -1,6 +1,6 @@
 > + include config.mk
 > + 
 > +-DIRS=lib client src
 > ++DIRS:=lib client src

Why? You can also override = variables in make.


> + DOCDIRS=man
 > + DISTDIRS=man
 > diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
 > index 1e6418a4de..54856c1c80 100644
 > --- a/package/mosquitto/Config.in
 > +++ b/package/mosquitto/Config.in
 > @@ -14,6 +14,15 @@ config BR2_PACKAGE_MOSQUITTO
 
 >  	  http://mosquitto.org/
 
 > +
 > +config BR2_PACKAGE_MOSQUITTO_INSTALL_BROKER

NIT: We normally don't add _INSTALL into symbols, so
BR2_PACKAGE_MOSQUITTO_BROKER would be nicer.

> +	bool "Install the mosquitto broker"
 > +	default y
 > +	depends on BR2_PACKAGE_MOSQUITTO
 > +	help
 > +	  Build and install the mosquitto broker onto target
 > +
 > +

A single empty line is enough.

>  comment "mosquitto needs a toolchain w/ dynamic library"
 >  	depends on BR2_USE_MMU
 >  	depends on BR2_TOOLCHAIN_HAS_SYNC_4

Are these comments / dependencies also appliciable when not building the
broker?


 > diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
 ..
 > +ifeq ($(BR2_PACKAGE_MOSQUITTO_INSTALL_BROKER),y)
 >  define MOSQUITTO_INSTALL_INIT_SYSV
 >  	$(INSTALL) -D -m 0755 package/mosquitto/S50mosquitto \
 >  		$(TARGET_DIR)/etc/init.d/S50mosquitto
 > @@ -97,6 +103,7 @@ define MOSQUITTO_INSTALL_INIT_SYSTEMD
 >  	ln -fs ../../../../usr/lib/systemd/system/mosquitto.service \
 >  		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mosquitto.service
 >  endef
 > +endif
 
 >  define MOSQUITTO_USERS
 >  	mosquitto -1 nogroup -1 * - - - Mosquitto user

The mosquitto user is presumably also not needed when the broker isn't
used?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [-v2] package/mosquitto: installing the mosquitto broker can be optional
  2018-10-24 19:01 [Buildroot] [PATCH 1/1] package/mosquitto: installing the mosquitto broker can be optional Titouan Christophe
  2018-10-26 10:12 ` Peter Korsgaard
@ 2018-10-29 16:54 ` Titouan Christophe
  2018-10-30 12:17   ` Peter Korsgaard
  1 sibling, 1 reply; 4+ messages in thread
From: Titouan Christophe @ 2018-10-29 16:54 UTC (permalink / raw)
  To: buildroot

The mosquitto package providess both the MQTT client library and
a broker, and the latter may be not needed (when connecting to
a remote broker). It should be therefore possible to not install and
start it on the target

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
 package/mosquitto/Config.in    |  7 +++++++
 package/mosquitto/mosquitto.mk | 13 ++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index 1e6418a4de..92fbd7af89 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -14,6 +14,13 @@ config BR2_PACKAGE_MOSQUITTO
 
 	  http://mosquitto.org/
 
+config BR2_PACKAGE_MOSQUITTO_BROKER
+	bool "Install the mosquitto broker"
+	default y
+	depends on BR2_PACKAGE_MOSQUITTO
+	help
+	  Build and install the mosquitto broker onto target
+
 comment "mosquitto needs a toolchain w/ dynamic library"
 	depends on BR2_USE_MMU
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index 1d72f9b16e..6e0dd34a8f 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -67,24 +67,30 @@ endef
 MOSQUITTO_POST_PATCH_HOOKS += MOSQUITTO_DISABLE_CPP
 endif
 
+MOSQUITTO_MAKE_DIRS = lib client
+ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER),y)
+	MOSQUITTO_MAKE_DIRS += src
+endif
+
 define MOSQUITTO_BUILD_CMDS
-	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 		$(MOSQUITTO_MAKE_OPTS)
 endef
 
 define MOSQUITTO_INSTALL_STAGING_CMDS
-	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 		$(MOSQUITTO_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
 endef
 
 define MOSQUITTO_INSTALL_TARGET_CMDS
-	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 		$(MOSQUITTO_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
 	rm -f $(TARGET_DIR)/etc/mosquitto/*.example
 	$(INSTALL) -D -m 0644 $(@D)/mosquitto.conf \
 		$(TARGET_DIR)/etc/mosquitto/mosquitto.conf
 endef
 
+ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER),y)
 define MOSQUITTO_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 0755 package/mosquitto/S50mosquitto \
 		$(TARGET_DIR)/etc/init.d/S50mosquitto
@@ -101,5 +107,6 @@ endef
 define MOSQUITTO_USERS
 	mosquitto -1 nogroup -1 * - - - Mosquitto user
 endef
+endif
 
 $(eval $(generic-package))
-- 
2.18.1

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

* [Buildroot] [-v2] package/mosquitto: installing the mosquitto broker can be optional
  2018-10-29 16:54 ` [Buildroot] [-v2] " Titouan Christophe
@ 2018-10-30 12:17   ` Peter Korsgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2018-10-30 12:17 UTC (permalink / raw)
  To: buildroot

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

 > The mosquitto package providess both the MQTT client library and
 > a broker, and the latter may be not needed (when connecting to
 > a remote broker). It should be therefore possible to not install and
 > start it on the target

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

I don't see a changelog. You didn't change anything regarding the
toolchain dependencies. Does this mean that you also need mmu/sync for
just building the utilities or was this part just forgotten?

 >  define MOSQUITTO_INSTALL_STAGING_CMDS
 > -	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
 > +	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 >  		$(MOSQUITTO_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
 >  endef
 
 >  define MOSQUITTO_INSTALL_TARGET_CMDS
 > -	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
 > +	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS=$(MOSQUITTO_MAKE_DIRS) \
 >  		$(MOSQUITTO_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
 >  	rm -f $(TARGET_DIR)/etc/mosquitto/*.example
 >  	$(INSTALL) -D -m 0644 $(@D)/mosquitto.conf \
 >  		$(TARGET_DIR)/etc/mosquitto/mosquitto.conf

Is mosquitto.conf also needed when the broker isn't installed?

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2018-10-30 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 19:01 [Buildroot] [PATCH 1/1] package/mosquitto: installing the mosquitto broker can be optional Titouan Christophe
2018-10-26 10:12 ` Peter Korsgaard
2018-10-29 16:54 ` [Buildroot] [-v2] " Titouan Christophe
2018-10-30 12:17   ` 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.