Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Oct 2016 02:43:32 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r424664 - in head: . dns dns/openmdns dns/openmdns/files
Message-ID:  <201610260243.u9Q2hWCS095021@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Wed Oct 26 02:43:32 2016
New Revision: 424664
URL: https://svnweb.freebsd.org/changeset/ports/424664

Log:
  dns/openmdns: add new port
  
  OpenMDNS is a full implementation of MDNS/DNS-SD, it aims to be a light
  replacement for Avahi/Bonjour. Currently OpenMDNS is about 10% of the size
  of Avahi.
  
  http://www.haesbaert.org/openmdns/

Added:
  head/dns/openmdns/
  head/dns/openmdns/Makefile   (contents, props changed)
  head/dns/openmdns/distinfo   (contents, props changed)
  head/dns/openmdns/files/
  head/dns/openmdns/files/mdnsd.in   (contents, props changed)
  head/dns/openmdns/files/patch-compat   (contents, props changed)
  head/dns/openmdns/files/patch-mdnsd_kiface.c   (contents, props changed)
  head/dns/openmdns/files/patch-mdnsd_mdnsd.h   (contents, props changed)
  head/dns/openmdns/files/patch-mdnsd_packet.c   (contents, props changed)
  head/dns/openmdns/pkg-descr   (contents, props changed)
Modified:
  head/GIDs
  head/UIDs
  head/dns/Makefile   (contents, props changed)

Modified: head/GIDs
==============================================================================
--- head/GIDs	Wed Oct 26 02:40:32 2016	(r424663)
+++ head/GIDs	Wed Oct 26 02:43:32 2016	(r424664)
@@ -118,7 +118,7 @@ polipo:*:173:
 flowtools:*:174:
 twms:*:175:
 mlvpn:*:176:
-# free: 177
+_mdnsd:*:177:
 otpw:*:178:
 gdnsd:*:179:
 rt:*:180:

Modified: head/UIDs
==============================================================================
--- head/UIDs	Wed Oct 26 02:40:32 2016	(r424663)
+++ head/UIDs	Wed Oct 26 02:43:32 2016	(r424664)
@@ -123,7 +123,7 @@ polipo:*:173:173::0:0:polipo web cache:/
 flowtools:*:174:174::0:0:Flow-tools collector pseudo-user:/nonexistent:/usr/sbin/nologin
 twms:*:175:175::0:0:tWMS pseudo-user:/nonexistent:/usr/sbin/nologin
 mlvpn:*:176:176::0:0:mlVPN pseudo-user:/var/run/mlvpn:/usr/sbin/nologin
-# free: 177
+_mdnsd:*:177:177::0:0:Multicast DNS Daemon:/var/empty:/usr/sbin/nologin
 otpw:*:178:178::0:0:OTPW pseudo-user:/var/lib/otpw:/usr/sbin/nologin
 gdnsd:*:179:179::0:0:gDNSd pseudo-user:/nonexistent:/usr/sbin/nologin
 # free: 180

Modified: head/dns/Makefile
==============================================================================
--- head/dns/Makefile	Wed Oct 26 02:40:32 2016	(r424663)
+++ head/dns/Makefile	Wed Oct 26 02:43:32 2016	(r424664)
@@ -108,6 +108,7 @@
     SUBDIR += opendnssec
     SUBDIR += opendnssec13
     SUBDIR += opendnssec2
+    SUBDIR += openmdns
     SUBDIR += openresolv
     SUBDIR += p5-AnyEvent-CacheDNS
     SUBDIR += p5-AnyEvent-DNS-EtcHosts

Added: head/dns/openmdns/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/Makefile	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,51 @@
+# $FreeBSD$
+
+PORTNAME=	openmdns
+DISTVERSION=	0.6-8
+DISTVERSIONSUFFIX=	-g07cf5c1
+CATEGORIES=	dns
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	Multicast DNS and Service Discovery daemon
+
+LICENSE=	ISCL
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	haesbaert
+GH_PROJECT=	mdnsd
+
+USES=		localbase uidfix
+USE_RC_SUBR=	mdnsd
+MAKE_ENV=	LDADD="${LIBS}"
+MAKE_ARGS=	BINDIR="${PREFIX}/sbin" \
+		MANDIR="${PREFIX}/man/man"
+CFLAGS+=	-D__dead=__dead2
+LDFLAGS+=	-Wl,--as-needed # -lutil
+LIBS+=		-lopenbsd
+SUB_LIST=	COMMENT="${COMMENT}"
+PLIST_FILES=	sbin/mdnsctl \
+		sbin/mdnsd \
+		man/man8/mdnsctl.8.gz \
+		man/man8/mdnsd.8.gz
+PORTDOCS=	*
+
+USERS=		_mdnsd
+GROUPS=		_mdnsd
+
+OPTIONS_DEFINE=	DOCS STATIC
+
+STATIC_BUILD_DEPENDS=	${LOCALBASE}/lib/libevent.a:devel/libevent2 \
+			${LOCALBASE}/lib/libopenbsd.a:devel/libopenbsd
+STATIC_MAKE_ENV=	NO_SHARED=1
+STATIC_LIB_DEPENDS_OFF=	libevent.so:devel/libevent2 \
+			libopenbsd.so:devel/libopenbsd
+
+post-patch:
+# warning: duplicate script for target "maninstall" ignored
+	@${REINPLACE_CMD} '/bsd\.man\.mk/d' ${WRKSRC}/*/Makefile
+
+post-install-DOCS-on:
+	(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
+	${INSTALL_MAN} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>

Added: head/dns/openmdns/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/distinfo	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,5 @@
+TIMESTAMP = 1477213204
+SHA256 (libopenbsd-r298107.tar.xz) = f2acd6156d948a4f9a73d9dce65a6f23b3969f87026100edb35c31fc10abc307
+SIZE (libopenbsd-r298107.tar.xz) = 13536
+SHA256 (haesbaert-mdnsd-0.6-8-g07cf5c1_GH0.tar.gz) = f04c0d77d900490cb7429a076ddba0b279b999db2faf299d5880522fa37f865c
+SIZE (haesbaert-mdnsd-0.6-8-g07cf5c1_GH0.tar.gz) = 2935405

Added: head/dns/openmdns/files/mdnsd.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/files/mdnsd.in	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: mdnsd
+# REQUIRE: LOGIN FILESYSTEMS
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="mdnsd"
+desc="%%COMMENT%%"
+rcvar="${name}_enable"
+command="%%PREFIX%%/sbin/${name}"
+command_args="em0"
+extra_commands="reload"
+
+load_rc_config $name
+run_rc_command "$1"

Added: head/dns/openmdns/files/patch-compat
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/files/patch-compat	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,62 @@
+--- mdnsd/mdns.h.orig	2015-05-29 14:18:11 UTC
++++ mdnsd/mdns.h
+@@ -31,6 +31,37 @@
+ #include <event.h>
+ #include <string.h>
+ 
++#ifndef T_NSEC
++#define	T_NSEC			47  /* from OpenBSD */
++#endif
++
++#ifndef IFT_CARP
++#define	IFT_CARP		0xf8 /* from DragonFly and NetBSD */
++#endif
++
++#ifndef LINK_STATE_IS_UP /* from DragonFly and OpenBSD */
++#define	LINK_STATE_IS_UP(_s)	((_s) >= LINK_STATE_UP)
++#endif
++
++/* Copied from <sys/time.h> on OpenBSD */
++#ifndef timespeccmp
++#define	timespeccmp(tsp, usp, cmp)					\
++	(((tsp)->tv_sec == (usp)->tv_sec) ?				\
++	    ((tsp)->tv_nsec cmp (usp)->tv_nsec) :			\
++	    ((tsp)->tv_sec cmp (usp)->tv_sec))
++#endif
++#ifndef timespecsub
++#define	timespecsub(tsp, usp, vsp)					\
++	do {								\
++		(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;		\
++		(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;	\
++		if ((vsp)->tv_nsec < 0) {				\
++			(vsp)->tv_sec--;				\
++			(vsp)->tv_nsec += 1000000000L;			\
++		}							\
++	} while (0)
++#endif
++
+ #define MAXCHARSTR	MAXHOSTNAMELEN
+ #define MAXLABELLEN	64
+ #define MAXPROTOLEN	4
+--- mdnsd/mdnsd.c.orig	2015-05-29 14:18:11 UTC
++++ mdnsd/mdnsd.c
+@@ -46,7 +46,9 @@ void		fetchmyname(char [MAXHOSTNAMELEN])
+ void		fetchhinfo(struct hinfo *);
+ 
+ struct mdnsd_conf	*conf = NULL;
++#ifdef __OpenBSD__
+ extern char		*malloc_options;
++#endif
+ 
+ __dead void
+ usage(void)
+@@ -230,7 +232,9 @@ main(int argc, char *argv[])
+ 		switch (ch) {
+ 		case 'd':
+ 			debug = 1;
++#ifdef __OpenBSD__
+ 			malloc_options = "AFGJPX";
++#endif
+ 			break;
+ 		case 'v':
+ 			display_version();

Added: head/dns/openmdns/files/patch-mdnsd_kiface.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/files/patch-mdnsd_kiface.c	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,18 @@
+In file included from kiface.c:25:0:
+kiface.c:67:1: error: expected ';', identifier or '(' before 'void'
+ RB_GENERATE(kif_tree, kif_node, entry, kif_compare)
+ ^
+
+--- mdnsd/kiface.c.orig	2015-05-29 14:18:11 UTC
++++ mdnsd/kiface.c
+@@ -63,8 +63,8 @@ struct {
+ 
+ 
+ RB_HEAD(kif_tree, kif_node) kit;
+-RB_PROTOTYPE(kif_tree, kif_node, entry, kif_compare)
+-RB_GENERATE(kif_tree, kif_node, entry, kif_compare)
++RB_PROTOTYPE(kif_tree, kif_node, entry, kif_compare);
++RB_GENERATE(kif_tree, kif_node, entry, kif_compare);
+ 
+ int
+ kif_init(void)

Added: head/dns/openmdns/files/patch-mdnsd_mdnsd.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/files/patch-mdnsd_mdnsd.h	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,25 @@
+In file included from log.c:33:
+In file included from mdnsd/log.h:24:
+In file included from mdnsd/mdnsd.h:30:
+/usr/local/include/imsg.h:31:2: error: type name requires a specifier or qualifier
+        TAILQ_ENTRY(ibuf)        entry;
+        ^
+/usr/local/include/imsg.h:31:14: error: a parameter list without types is only allowed in a function
+      definition
+        TAILQ_ENTRY(ibuf)        entry;
+                    ^
+/usr/local/include/imsg.h:31:19: error: expected ';' at end of declaration list
+        TAILQ_ENTRY(ibuf)        entry;
+                         ^
+[...]
+
+--- mdnsd/mdnsd.h.orig	2015-05-29 14:18:11 UTC
++++ mdnsd/mdnsd.h
+@@ -18,6 +18,7 @@
+ #define	_MDNSD_H_
+ 
+ #include <sys/param.h>
++#include <sys/queue.h>
+ #include <sys/socket.h>
+ #include <sys/tree.h>
+ #include <sys/types.h>

Added: head/dns/openmdns/files/patch-mdnsd_packet.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/files/patch-mdnsd_packet.c	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,44 @@
+packet.c:919:22: error: passing 'u_char [64]' to parameter of type 'const char *' converts between
+      pointers to integer types with different sign [-Werror=pointer-sign]
+                if (strlcat(dname, label, MAXHOSTNAMELEN) >= MAXHOSTNAMELEN)  {
+                                   ^~~~~
+/usr/include/string.h:92:59: note: passing argument to parameter here
+size_t   strlcat(char * __restrict, const char * __restrict, size_t);
+                                                           ^
+packet.c:986:7: error: assigning to 'char *' from 'u_int8_t *' (aka 'unsigned char *') converts
+      between pointers to integer types with different sign [-Werror=pointer-sign]
+                buf = *pbuf;
+                    ^ ~~~~~
+packet.c:1025:7: error: assigning to 'char *' from 'u_int8_t *' (aka 'unsigned char *') converts
+      between pointers to integer types with different sign [-Werror=pointer-sign]
+                buf = *pbuf;
+                    ^ ~~~~~
+packet.c:1033:22: error: passing 'char *' to parameter of type 'u_int8_t *' (aka 'unsigned char *')
+      converts between pointers to integer types with different sign [-Werror=pointer-sign]
+                if (rr_parse_dname(buf, tmplen, rr->rdata.SRV.target) == -1)
+                                   ^~~
+packet.c:71:32: note: passing argument to parameter here
+int              rr_parse_dname(u_int8_t *, u_int16_t, char [MAXHOSTNAMELEN]);
+                                          ^
+4 errors generated.
+
+--- mdnsd/packet.c.orig	2015-05-29 14:18:11 UTC
++++ mdnsd/packet.c
+@@ -853,7 +853,7 @@ pkt_parse_dname(u_int8_t *buf, u_int16_t
+ 	int jumped = 0;
+ 	u_int16_t oldlen = len;
+ 	size_t slen;
+-	u_char label[MAXLABELLEN];
++	char label[MAXLABELLEN];
+ 
+ 	/* be extra safe */
+ 	bzero(dname, MAXHOSTNAMELEN);
+@@ -948,7 +948,7 @@ pkt_parse_rr(u_int8_t **pbuf, u_int16_t 
+ 	u_int16_t us, rdlen, tmplen;
+ 	u_int32_t ul;
+ 	ssize_t n;
+-	char *buf;
++	u_char *buf;
+ 
+ 	n = pkt_parse_dname(*pbuf, *len, rr->rrs.dname);
+ 	if (n == -1)

Added: head/dns/openmdns/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/openmdns/pkg-descr	Wed Oct 26 02:43:32 2016	(r424664)
@@ -0,0 +1,5 @@
+OpenMDNS is a full implementation of MDNS/DNS-SD, it aims to be a light
+replacement for Avahi/Bonjour. Currently, OpenMDNS is about 10% of the size
+of Avahi.
+
+WWW: http://www.haesbaert.org/openmdns/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610260243.u9Q2hWCS095021>