Skip to contentSkip to conversation

dbus-triggerd, a helpful little daemon

PATCH Superseded Arnaud Rébillout 2 participants 5 messages Mar 25, 2014 – Mar 26, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover dbus-triggerd, a helpful little daemon

Hi everyone,

let me introduce you to dbus-triggerd.

dbus-triggerd is a little daemon that can monitor dbus events, match them against some watch-expressions, then trigger shell-commands.

The code is really small and neat, the only dependency is dbus. Furthermore, it comes with a manual page !

I find it especially useful in automated test scripts, but it can be used in any situation where dbus-interaction is needed, and shell script is preferred over other languages.

If anybody find it useful, here comes a patch to add this package to buildroot.

Regards,

Signature · 1 line
Arnaud R?billout
#1 lore raw

PATCH 1/1 dbus-triggerd: new package

dbus-triggerd is a little daemon that can monitor dbus events, match them against some watch-expressions, then trigger shell-commands.

It can be used in any situation where dbus-interaction is needed, and shell script is preferred over other languages.

---
 package/Config.in                                  |  1 +
 package/dbus-triggerd/Config.in                    |  9 ++++++++
 .../dbus-triggerd-01-cross-compil.patch            | 13 ++++++++++++
 package/dbus-triggerd/dbus-triggerd.mk             | 24 ++++++++++++++++++++++
 4 files changed, 47 insertions(+)
 create mode 100644 package/dbus-triggerd/Config.in
 create mode 100644 package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch
 create mode 100644 package/dbus-triggerd/dbus-triggerd.mk
package/Config.in +1 -0
index cfa53d3..fa24b57 100644
@@ -272,6 +272,7 @@ source "package/dbus/Config.in"
 source "package/dbus-cpp/Config.in"
 source "package/dbus-glib/Config.in"
 source "package/dbus-python/Config.in"
+source "package/dbus-triggerd/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/devmem2/Config.in"
 endif
package/dbus-triggerd/Config.in new file +9 -0
new file mode 100644
index 0000000..e7f65b8
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_DBUS_TRIGGERD
+	bool "dbus-triggerd"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_PACKAGE_DBUS
+	help
+	  dbus-triggerd is a tool to trigger shell-commands upon receiving
+	  a given dbus-signal.
+
+	  http://gareus.org/oss/dbustriggerd/start
package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch new file +13 -0
new file mode 100644
index 0000000..67a2755
@@ -0,0 +1,13 @@
+--- a/Makefile	2014-03-25 07:27:15.761217767 +0100
++++ b/Makefile	2014-03-25 07:31:28.523028955 +0100
+@@ -1,7 +1,8 @@
+ PREFIX=/usr
++PKG_CONFIG?=pkg-config
+ 
+-CFLAGS=`pkg-config --cflags dbus-1` -Wall -O3
+-LDLIBS=`pkg-config --libs dbus-1`
++CFLAGS+=`$(PKG_CONFIG) --cflags dbus-1` -Wall -O3
++LDLIBS+=`$(PKG_CONFIG) --libs dbus-1`
+ 
+ all: dbus-triggerd
+ 
package/dbus-triggerd/dbus-triggerd.mk new file +24 -0
new file mode 100644
index 0000000..fa04c06
@@ -0,0 +1,24 @@
+################################################################################
+#
+# dbus-triggerd
+#
+################################################################################
+
+DBUS_TRIGGERD_VERSION = 749a7a83a79439395ebdc52ff86f2601396b8c72
+DBUS_TRIGGERD_SITE = git://rg42.org/dbustriggerd.git
+DBUS_TRIGGERD_LICENSE = GPLv2+
+DBUS_TRIGGERD_DEPENDENCIES = dbus
+
+define DBUS_TRIGGERD_BUILD_CMDS
+	CC="$(TARGET_CC)" \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	LDFLAGS="$(TARGET_LDFLAGS)" \
+	PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
+	$(MAKE) -C $(@D) all
+endef
+
+define DBUS_TRIGGERD_INSTALL_TARGET_CMDS
+	$(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.0
#2 lore raw

PATCH 1/1 dbus-triggerd: new package

Quoted 35 lines · Arnaud R?billout

dbus-triggerd is a little daemon that can monitor dbus events, match them against some watch-expressions, then trigger shell-commands.

It can be used in any situation where dbus-interaction is needed, and shell script is preferred over other languages.

---
 package/Config.in                                  |  1 +
 package/dbus-triggerd/Config.in                    |  9 ++++++++
 .../dbus-triggerd-01-cross-compil.patch            | 13 ++++++++++++
 package/dbus-triggerd/dbus-triggerd.mk             | 24 ++++++++++++++++++++++
 4 files changed, 47 insertions(+)
 create mode 100644 package/dbus-triggerd/Config.in
 create mode 100644 package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch
 create mode 100644 package/dbus-triggerd/dbus-triggerd.mk
package/Config.in +1 -0
index cfa53d3..fa24b57 100644
@@ -272,6 +272,7 @@ source "package/dbus/Config.in"
 source "package/dbus-cpp/Config.in"
 source "package/dbus-glib/Config.in"
 source "package/dbus-python/Config.in"
+source "package/dbus-triggerd/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/devmem2/Config.in"
 endif
package/dbus-triggerd/Config.in new file +0 -0
new file mode 100644
index 0000000..e7f65b8

package/dbus-triggerd/Config.in line 4

Quoted 4 lines
package/dbus-triggerd/Config.in new file +4 -0
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_DBUS_TRIGGERD
+	bool "dbus-triggerd"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_PACKAGE_DBUS

For the other dbus-* packages, the dbus dependencies are repeated (even
though they're automatic because of the depends on DBUS). So I would do that here as well. And that means of course that there should also be a comment in case of missing toolchain features. See dbus-cpp for an example.

package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch

Quoted 11 lines
package/dbus-triggerd/Config.in new file +5 -0
+	help
+	  dbus-triggerd is a tool to trigger shell-commands upon receiving
+	  a given dbus-signal.
+
+	  http://gareus.org/oss/dbustriggerd/start
package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch new file +0 -0
new file mode 100644
index 0000000..67a2755
@@ -0,0 +1,13 @@

Patch misses a description + Signed-off-by.

package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch line 10

Quoted 10 lines
package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch new file +10 -0
+--- a/Makefile	2014-03-25 07:27:15.761217767 +0100
++++ b/Makefile	2014-03-25 07:31:28.523028955 +0100
+@@ -1,7 +1,8 @@
+ PREFIX=/usr
++PKG_CONFIG?=pkg-config
+ 
+-CFLAGS=`pkg-config --cflags dbus-1` -Wall -O3
+-LDLIBS=`pkg-config --libs dbus-1`
++CFLAGS+=`$(PKG_CONFIG) --cflags dbus-1` -Wall -O3
++LDLIBS+=`$(PKG_CONFIG) --libs dbus-1`

If you're anyway patching the Makefile, you can just as well make it:

CFLAGS?=-Wall -O3
CFLAGS+=$(PKG_CONFIG) --cflags dbus-1
LDLIBS+=$(PKG_CONFIG) --libs dbus-1

Will you send this patch upstream?

Quoted 15 lines
package/dbus-triggerd/dbus-triggerd-01-cross-compil.patch new file +3 -0
+ 
+ all: dbus-triggerd
+ 
package/dbus-triggerd/dbus-triggerd.mk new file +6 -0
new file mode 100644
index 0000000..fa04c06
@@ -0,0 +1,24 @@
+################################################################################
+#
+# dbus-triggerd
+#
+################################################################################
+

package/dbus-triggerd/dbus-triggerd.mk line 16

Quoted 10 lines
package/dbus-triggerd/dbus-triggerd.mk new file +10 -0
+DBUS_TRIGGERD_VERSION = 749a7a83a79439395ebdc52ff86f2601396b8c72
+DBUS_TRIGGERD_SITE = git://rg42.org/dbustriggerd.git
+DBUS_TRIGGERD_LICENSE = GPLv2+
+DBUS_TRIGGERD_DEPENDENCIES = dbus
+
+define DBUS_TRIGGERD_BUILD_CMDS
+	CC="$(TARGET_CC)" \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	LDFLAGS="$(TARGET_LDFLAGS)" \
+	PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \

This should be $(TARGET_CONFIGURE_OPTS) which includes all of the above
and more.

Note BTW that the patch above refers to LDLIBS instead of LDFLAGS. Is
LDFLAGS used?

Regards,
Arnout

Quoted 9 lines
package/dbus-triggerd/dbus-triggerd.mk new file +8 -0
+	$(MAKE) -C $(@D) all
+endef
+
+define DBUS_TRIGGERD_INSTALL_TARGET_CMDS
+	$(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/1 dbus-triggerd: new package

Hi Arnout,

Quoted 4 lines

For the other dbus-* packages, the dbus dependencies are repeated (even
though they're automatic because of the depends on DBUS). So I would do that here as well. And that means of course that there should also be a comment in case of missing toolchain features. See dbus-cpp for an example.

You're right, I forgot the comments, and the host-pkgconf dependency as well.
I will do as you suggest for the DBUS dependencies.

Quoted 1 line

Patch misses a description + Signed-off-by.

Correct.

Quoted 9 lines

If you're anyway patching the Makefile, you can just as well make it:

CFLAGS?=-Wall -O3
CFLAGS+=$(PKG_CONFIG) --cflags dbus-1
LDLIBS+=$(PKG_CONFIG) --libs dbus-1

Will you send this patch upstream?

Yep. I will send a patch right now.

Quoted 2 lines

This should be $(TARGET_CONFIGURE_OPTS) which includes all of the above
and more.

OK. Actually, I've always been wondering it was OK to use TARGET_CONFIGURE_OPTS in a generic package, I never dared to do it.

Quoted 2 lines

Note BTW that the patch above refers to LDLIBS instead of LDFLAGS. Is
LDFLAGS used?

Yep, LDFLAGS is used automatically by Make in this Makefile.

Thanks for your comments, I will send the patch upstream a wait a little for the author's comments on it.

Regards

Signature · 4 lines
Arnaud R?billout
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140326/f245da9a/attachment.html>
#4 lore raw

PATCH 1/1 dbus-triggerd: new package

Quoted 20 lines · Arnaud R?billout

Hi Arnout,

Quoted 4 lines

For the other dbus-* packages, the dbus dependencies are repeated (even
though they're automatic because of the depends on DBUS). So I would do that here as well. And that means of course that there should also be a comment in case of missing toolchain features. See dbus-cpp for an example.

You're right, I forgot the comments, and the host-pkgconf dependency as well. I will do as you suggest for the DBUS dependencies.

Quoted 1 line

Patch misses a description + Signed-off-by.

Correct.

Quoted 8 lines

If you're anyway patching the Makefile, you can just as well make it:

CFLAGS?=-Wall -O3
CFLAGS+=$(PKG_CONFIG) --cflags dbus-1
LDLIBS+=$(PKG_CONFIG) --libs dbus-1

Quoted 8 lines
Quoted 1 line

Will you send this patch upstream?

Yep. I will send a patch right now.

Quoted 2 lines

This should be $(TARGET_CONFIGURE_OPTS) which includes all of the above
and more.

OK. Actually, I've always been wondering it was OK to use TARGET_CONFIGURE_OPTS in a generic package, I never dared to do it.

Yeah, it should be renamed, really.

Regards,
Arnout

Quoted 16 lines
Quoted 3 lines

Note BTW that the patch above refers to LDLIBS instead of LDFLAGS. Is
LDFLAGS used?

Yep, LDFLAGS is used automatically by Make in this Makefile.

Thanks for your comments, I will send the patch upstream a wait a little for the author's comments on it.

Regards

Signature · 1 line
Arnaud R?billout
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F