Skip to contentSkip to conversation

minissdpd: new package

PATCH New Fabrice Fontaine 3 participants 3 messages Jul 29, 2016 – Aug 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minissdpd: new package

SSDP managing daemon.
Designed to work with miniupnpc, miniupnpd, minidlna, etc.

http://miniupnp.free.fr/

---
 package/Config.in                                  |  1 +
 .../0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch    | 32 +++++++++++++++
 package/minissdpd/Config.in                        |  8 ++++
 package/minissdpd/S50minissdpd                     | 47 ++++++++++++++++++++++
 package/minissdpd/minissdpd.hash                   |  2 +
 package/minissdpd/minissdpd.mk                     | 38 +++++++++++++++++
 package/minissdpd/minissdpd.service                | 12 ++++++
 7 files changed, 140 insertions(+)
 create mode 100644 package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch
 create mode 100644 package/minissdpd/Config.in
 create mode 100644 package/minissdpd/S50minissdpd
 create mode 100644 package/minissdpd/minissdpd.hash
 create mode 100644 package/minissdpd/minissdpd.mk
 create mode 100644 package/minissdpd/minissdpd.service
package/Config.in +1 -0
index ee7ba39..616df66 100644
@@ -1495,6 +1495,7 @@ menu "Networking applications"
 	source "package/memcached/Config.in"
 	source "package/mii-diag/Config.in"
 	source "package/minidlna/Config.in"
+	source "package/minissdpd/Config.in"
 	source "package/mjpg-streamer/Config.in"
 	source "package/modem-manager/Config.in"
 	source "package/mongrel2/Config.in"
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +32 -0
new file mode 100644
index 0000000..35854c5
@@ -0,0 +1,32 @@
+From 8ea177d974259c91f7e520d4b5b2abf07a1bbce2 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 29 Jul 2016 13:32:09 +0200
+Subject: [PATCH 1/1] Set _GNU_SOURCE in asyncsendto.c
+
+Add #define on _GNU_SOURCE at the very beginning of asyncsendto.c file
+as this file uses in6_pktinfo which is protected by __USE_GNU in
+libc/inet/netinet/in.h. Currently, this flag is set by the Makefile in
+CFLAGS however CFLAGS could be overwritten by the build system.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ minissdpd/asyncsendto.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/asyncsendto.c b/minissdpd/asyncsendto.c
+index bd21e93..3e5eba3 100644
+--- a/asyncsendto.c
++++ b/asyncsendto.c
+@@ -5,6 +5,9 @@
+  * This software is subject to the conditions detailed
+  * in the LICENCE file provided within the distribution */
+ 
++// for struct in6_pktinfo
++#define _GNU_SOURCE
++
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
+-- 
+2.7.4
+
package/minissdpd/Config.in new file +8 -0
new file mode 100644
index 0000000..b5a73f0
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_MINISSDPD
+	bool "minissdpd"
+	select BR2_PACKAGE_LIBNFNETLINK
+	help
+	  SSDP managing daemon.
+	  Designed to work with miniupnpc, miniupnpd, minidlna, etc.
+
+	  http://miniupnp.free.fr/
package/minissdpd/S50minissdpd new file +47 -0

47 lines not on this page · raw message

package/minissdpd/minissdpd.hash new file +2 -0
new file mode 100644
index 0000000..8d670f3
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256	dfd637b185731e1acb412a86faa9718eb93c04ca08280541a6d22d14d1fb890f	minissdpd-1.5.tar.gz
package/minissdpd/minissdpd.mk new file +38 -0
new file mode 100644
index 0000000..eddef0f
@@ -0,0 +1,38 @@
+################################################################################
+#
+# minissdpd
+#
+################################################################################
+
+MINISSDPD_VERSION = 1.5
+MINISSDPD_SITE = http://miniupnp.free.fr/files
+MINISSDPD_LICENSE = BSD-3c
+MINISSDPD_LICENSE_FILES = LICENSE
+MINISSDPD_DEPENDENCIES = libnfnetlink
+
+define MINISSDPD_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define MINISSDPD_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+		PREFIX=$(TARGET_DIR) install
+endef
+
+# Use dedicated init scripts for systemV and systemd instead of using
+# minissdpd.init.d.script as it is not compatible with buildroot init system
+define MINISSDPD_INSTALL_INIT_SYSV
+	$(RM) $(TARGET_DIR)/etc/init.d/minissdpd
+	$(INSTALL) -D -m 0755 package/minissdpd/S50minissdpd \
+		$(TARGET_DIR)/etc/init.d/S50minissdpd
+endef
+
+define MINISSDPD_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/minissdpd/minissdpd.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/minissdpd.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -sf ../../../../usr/lib/systemd/system/minissdpd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/minissdpd.service
+endef
+
+$(eval $(generic-package))
package/minissdpd/minissdpd.service new file +12 -0
new file mode 100644
index 0000000..4a520f5
@@ -0,0 +1,12 @@
+[Unit]
+Description=SSDP managing daemon
+After=network.target
+
+[Service]
+Environment="IF=eth0"
+EnvironmentFile=/etc/default/minissdpd
+ExecStart=/usr/sbin/minissdpd -i $IF
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 minissdpd: new package

Hello,

Quoted 7 lines · Fabrice Fontaine
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +1 -0
new file mode 100644
index 0000000..35854c5
@@ -0,0 +1,32 @@
+From 8ea177d974259c91f7e520d4b5b2abf07a1bbce2 Mon Sep 17 00:00:00 2001

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 11

Quoted 10 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +10 -0
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 29 Jul 2016 13:32:09 +0200
+Subject: [PATCH 1/1] Set _GNU_SOURCE in asyncsendto.c
+
+Add #define on _GNU_SOURCE at the very beginning of asyncsendto.c file
+as this file uses in6_pktinfo which is protected by __USE_GNU in
+libc/inet/netinet/in.h. Currently, this flag is set by the Makefile in
+CFLAGS however CFLAGS could be overwritten by the build system.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>

Having a patch for this is a bit overkill IMO, so I've replaced that by passing:

	CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE"

in the .mk file.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 14

Quoted 3 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +3 -0
+config BR2_PACKAGE_MINISSDPD
+	bool "minissdpd"
+	select BR2_PACKAGE_LIBNFNETLINK

Missing "depends on BR2_USE_MMU", since fork() is used.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 20

Quoted 6 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +6 -0
+NAME=minissdpd
+PIDFILE=/var/run/$NAME.pid
+DAEMON=/usr/sbin/$NAME
+CFGFILE=/etc/default/$NAME
+
+IF=eth0

IF is not really a good variable name IMO, too close to the "if" keyword. I renamed it to IFACE.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 22

Quoted 2 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +2 -0
+define MINISSDPD_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \

Passing TARGET_CONFIGURE_OPTS at install time wasn't needed.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 23

Quoted 1 line
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +1 -0
+Environment="IF=eth0"

I've also changed IF to IFACE here.

Applied with those changes.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 minissdpd: new package

Quoted 28 lines · Thomas Petazzoni

Hello,

Quoted 7 lines · Fabrice Fontaine
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +1 -0
new file mode 100644
index 0000000..35854c5
@@ -0,0 +1,32 @@
+From 8ea177d974259c91f7e520d4b5b2abf07a1bbce2 Mon Sep 17 00:00:00 2001

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 11

Quoted 10 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +10 -0
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 29 Jul 2016 13:32:09 +0200
+Subject: [PATCH 1/1] Set _GNU_SOURCE in asyncsendto.c
+
+Add #define on _GNU_SOURCE at the very beginning of asyncsendto.c file
+as this file uses in6_pktinfo which is protected by __USE_GNU in
+libc/inet/netinet/in.h. Currently, this flag is set by the Makefile in
+CFLAGS however CFLAGS could be overwritten by the build system.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>

Having a patch for this is a bit overkill IMO, so I've replaced that by passing:

Quoted 1 line
	CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE?

This is broader brush, unless this define is only passed for asyncsendto.c alone its not equivalent and I think the original patch is more appropriate or even better if the Makefile can pass -D_GNU_SOURCE just for this one file.

Quoted 32 lines

in the .mk file.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 14

Quoted 3 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +3 -0
+config BR2_PACKAGE_MINISSDPD
+	bool "minissdpd"
+	select BR2_PACKAGE_LIBNFNETLINK

Missing "depends on BR2_USE_MMU", since fork() is used.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 20

Quoted 6 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +6 -0
+NAME=minissdpd
+PIDFILE=/var/run/$NAME.pid
+DAEMON=/usr/sbin/$NAME
+CFGFILE=/etc/default/$NAME
+
+IF=eth0

IF is not really a good variable name IMO, too close to the "if" keyword. I renamed it to IFACE.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 22

Quoted 2 lines
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +2 -0
+define MINISSDPD_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \

Passing TARGET_CONFIGURE_OPTS at install time wasn't needed.

package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch line 23

Quoted 1 line
package/minissdpd/0001-Set-_GNU_SOURCE-in-asyncsendto.c.patch new file +1 -0
+Environment="IF=eth0"

I've also changed IF to IFACE here.

Applied with those changes.

Thanks!

Quoted 9 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160803/9e7f8d48/attachment.asc>