aboutsummaryrefslogtreecommitdiff
path: root/net/openmdns
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2018-09-03 00:21:45 +0000
committerJan Beich <jbeich@FreeBSD.org>2018-09-03 00:21:45 +0000
commit5e498e96a22616ea2a9f3d8e373ab54369533d03 (patch)
tree6daef9ed5efb7ede0efd26c8e8dbcdfa9d747933 /net/openmdns
parenta688a5c0b174985f37c860cf1afe2865412afe53 (diff)
downloadports-5e498e96a22616ea2a9f3d8e373ab54369533d03.tar.gz
ports-5e498e96a22616ea2a9f3d8e373ab54369533d03.zip
Reorganize some my ports for better discoverability
devel/onscripter{,-1byte} -> games/onscripter{,-1byte} devel/ponscripter-sekai -> games/ponscripter-sekai devel/renpy{,6} -> games/renpy{,6} devel/rlvm -> games/rlvm dns/openmdns -> net/openmdns (where Bonjour and Avahi are)
Notes
Notes: svn path=/head/; revision=478837
Diffstat (limited to 'net/openmdns')
-rw-r--r--net/openmdns/Makefile52
-rw-r--r--net/openmdns/distinfo3
-rw-r--r--net/openmdns/files/mdnsd.in30
-rw-r--r--net/openmdns/files/patch-compat86
-rw-r--r--net/openmdns/pkg-descr5
5 files changed, 176 insertions, 0 deletions
diff --git a/net/openmdns/Makefile b/net/openmdns/Makefile
new file mode 100644
index 000000000000..232e2b9e6164
--- /dev/null
+++ b/net/openmdns/Makefile
@@ -0,0 +1,52 @@
+# $FreeBSD$
+
+PORTNAME= openmdns
+DISTVERSION= 0.7
+CATEGORIES= net
+
+MAINTAINER= jbeich@FreeBSD.org
+COMMENT= Multicast DNS and Service Discovery daemon
+
+LICENSE= ISCL
+
+USE_GITHUB= yes
+GH_ACCOUNT= haesbaert
+GH_PROJECT= mdnsd
+
+CONFLICTS_INSTALL= mDNSResponder # sbin/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/libevent \
+ ${LOCALBASE}/lib/libopenbsd.a:devel/libopenbsd
+STATIC_MAKE_ENV= NO_SHARED=1
+STATIC_LIB_DEPENDS_OFF= libevent.so:devel/libevent \
+ 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_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/net/openmdns/distinfo b/net/openmdns/distinfo
new file mode 100644
index 000000000000..20a11c6c0c63
--- /dev/null
+++ b/net/openmdns/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1489137852
+SHA256 (haesbaert-mdnsd-0.7_GH0.tar.gz) = cb552f3431e57a3ad09b011f91ebdb8cc100a5c38978fcdb0fea27fc5ebd2880
+SIZE (haesbaert-mdnsd-0.7_GH0.tar.gz) = 2935140
diff --git a/net/openmdns/files/mdnsd.in b/net/openmdns/files/mdnsd.in
new file mode 100644
index 000000000000..824e09d0e0bf
--- /dev/null
+++ b/net/openmdns/files/mdnsd.in
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: mdnsd
+# REQUIRE: NETWORKING
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable this service:
+#
+# mdnsd_enable (bool): Set it to YES to enable mdnsd(8) on startup.
+# Default: NO
+# mdnsd_flags (string): Arguments passed to mdnsd(8) such as the list of
+# network interfaces to listen on e.g., "em0 fxp0".
+# Default: lo0 (no network exposure)
+
+. /etc/rc.subr
+
+name="mdnsd"
+desc="%%COMMENT%%"
+rcvar="${name}_enable"
+command="%%PREFIX%%/sbin/${name}"
+extra_commands="reload"
+
+: ${mdnsd_enable:="NO"}
+: ${mdnsd_flags:="lo0"}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/openmdns/files/patch-compat b/net/openmdns/files/patch-compat
new file mode 100644
index 000000000000..3a227a663734
--- /dev/null
+++ b/net/openmdns/files/patch-compat
@@ -0,0 +1,86 @@
+--- mdnsctl/mdnsctl.c.orig 2017-02-18 03:02:15 UTC
++++ mdnsctl/mdnsctl.c
+@@ -67,8 +67,10 @@ main(int argc, char *argv[])
+ struct mdns mdns;
+ struct mdns_service ms;
+
++#ifdef __OpenBSD__
+ if (pledge("stdio unix", NULL) == -1)
+ err(1, NULL);
++#endif
+
+ /* parse options */
+ if ((res = parse(argc - 1, argv + 1)) == NULL)
+@@ -77,8 +79,10 @@ main(int argc, char *argv[])
+ if ((sockfd = mdns_open(&mdns)) == -1)
+ err(1, "mdns_open");
+
++#ifdef __OpenBSD__
+ if (pledge("stdio", NULL) == -1)
+ err(1, NULL);
++#endif
+
+ mdns_set_lookup_A_hook(&mdns, my_lookup_A_hook);
+ mdns_set_lookup_PTR_hook(&mdns, my_lookup_PTR_hook);
+--- mdnsd/mdns.h.orig 2017-02-18 03:02:15 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 2017-02-18 03:02:15 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();
diff --git a/net/openmdns/pkg-descr b/net/openmdns/pkg-descr
new file mode 100644
index 000000000000..dfd70eab4948
--- /dev/null
+++ b/net/openmdns/pkg-descr
@@ -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/