aboutsummaryrefslogtreecommitdiffstats
path: root/net/pimdd
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2015-09-08 03:34:40 +0800
committerhrs <hrs@FreeBSD.org>2015-09-08 03:34:40 +0800
commitade4ea44db1707cda9f58f6d81e1d98fa740a6de (patch)
tree6ad15cf8fbe14154ca8c9ffe9d5e513f7bce494b /net/pimdd
parent0761e7c855b1e3221303b4acd4f78d46edd95bed (diff)
downloadfreebsd-ports-gnome-ade4ea44db1707cda9f58f6d81e1d98fa740a6de.tar.gz
freebsd-ports-gnome-ade4ea44db1707cda9f58f6d81e1d98fa740a6de.tar.zst
freebsd-ports-gnome-ade4ea44db1707cda9f58f6d81e1d98fa740a6de.zip
- Add LICENSE.
- Do not override CFLAGS. - Fix some compiler warnings. - Take maintainership.
Diffstat (limited to 'net/pimdd')
-rw-r--r--net/pimdd/Makefile28
-rw-r--r--net/pimdd/files/patch-Makefile17
-rw-r--r--net/pimdd/files/patch-config.c8
-rw-r--r--net/pimdd/files/patch-debug.c10
-rw-r--r--net/pimdd/files/patch-defs.h (renamed from net/pimdd/files/extra-patch-defs.h)8
-rw-r--r--net/pimdd/files/patch-igmp.c29
-rw-r--r--net/pimdd/files/patch-pathnames.h12
-rw-r--r--net/pimdd/files/patch-pim.c8
-rw-r--r--net/pimdd/files/patch-pim_proto.c6
-rw-r--r--net/pimdd/files/patch-pimdd.h8
-rw-r--r--net/pimdd/files/patch-trace.c8
-rw-r--r--net/pimdd/files/pimdd.in25
12 files changed, 113 insertions, 54 deletions
diff --git a/net/pimdd/Makefile b/net/pimdd/Makefile
index 2963a9d59f9b..25fe22f20262 100644
--- a/net/pimdd/Makefile
+++ b/net/pimdd/Makefile
@@ -3,35 +3,31 @@
PORTNAME= pimdd
PORTVERSION= 0.2.1.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net
MASTER_SITES= http://antc.uoregon.edu/PIMDM/
DISTNAME= pimd-dense
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= hrs@FreeBSD.org
COMMENT= UO Dense Protocol-Independent Multicast (PIM-DM) daemon for IPv4
-MAKE_ARGS+= CC="${CC}"
-
-NO_MAN= yes
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+USE_RC_SUBR= ${PORTNAME}
+CPPFLAGS+= -D_PATH_PIMD_CONF=\\\"${PREFIX}/etc/pimd.conf\\\"
PLIST_FILES= sbin/pimdd \
etc/pimdd.conf.sample
-
PORTDOCS= pimd-dense.html README CHANGES RELEASE.NOTES
-
OPTIONS_DEFINE= DOCS
-EXTRA_PATCHES= ${FILESDIR}/extra-patch-defs.h
-
-post-patch:
- ${REINPLACE_CMD} -e 's|/etc/pimd.conf|${PREFIX}/etc/pimd.conf|g' ${WRKSRC}/pathnames.h
- ${REINPLACE_CMD} -e 's|-Wall -g|${CFLAGS}|' ${WRKSRC}/Makefile
-
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/pimdd ${STAGEDIR}${PREFIX}/sbin/pimdd
- ${INSTALL_DATA} ${WRKSRC}/pimdd.conf ${STAGEDIR}${PREFIX}/etc/pimdd.conf.sample
- ${MKDIR} ${STAGEDIR}${DOCSDIR}
- (cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})
+ ${INSTALL_DATA} ${WRKSRC}/pimdd.conf \
+ ${STAGEDIR}${PREFIX}/etc/pimdd.conf.sample
+
+post-install-DOCS-on:
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>
diff --git a/net/pimdd/files/patch-Makefile b/net/pimdd/files/patch-Makefile
index 9e68a532833c..26738616213e 100644
--- a/net/pimdd/files/patch-Makefile
+++ b/net/pimdd/files/patch-Makefile
@@ -1,20 +1,23 @@
---- Makefile.orig 1999-11-30 18:58:53.000000000 +0100
-+++ Makefile 2013-09-08 09:39:18.947517833 +0200
-@@ -53,7 +53,7 @@
+--- Makefile.orig 1999-11-30 17:58:53 UTC
++++ Makefile
+@@ -53,9 +53,9 @@ PROG_CVS_LAST_VERSION = ${PROG_NAME}_${C
# Support for Resource Reservations), currently used by RSVP.
RSRRDEF= -DRSRR
-CC = gcc
-+#CC = gcc
++CC?= gcc
MCAST_INCLUDE= -Iinclude
- LDFLAGS=
+-LDFLAGS=
++LDFLAGS?=
-@@ -63,7 +63,7 @@
+ #CONFIGCONFIGCONFIG
+ PURIFY= purify -cache-dir=/tmp -collector=/import/pkgs/gcc/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.2/ld
+@@ -63,7 +63,7 @@ PURIFY= purify -cache-dir=/tmp -collect
#CONFIGCONFIGCONFIG
### Compilation flags for different platforms. Uncomment only one of them
## FreeBSD
-CFLAGS= -Wall -g -Iinclude/freebsd ${MCAST_INCLUDE} ${SNMPDEF} ${RSRRDEF} ${MISCDEFS} -DFreeBSD -DPIM
-+CFLAGS= -Wall -g ${MCAST_INCLUDE} ${SNMPDEF} ${RSRRDEF} ${MISCDEFS} -DFreeBSD -DPIM -Dlog=logit
++CFLAGS+= ${MCAST_INCLUDE} ${SNMPDEF} ${RSRRDEF} ${MISCDEFS} -DFreeBSD -DPIM -Dlog=logit ${CPPFLAGS}
## NetBSD -DNetBSD is done by OS
#CFLAGS= -Wall -g -Iinclude/netbsd ${MCAST_INCLUDE} ${SNMPDEF} ${RSRRDEF} ${MISCDEFS} -DPIM
diff --git a/net/pimdd/files/patch-config.c b/net/pimdd/files/patch-config.c
index 760b41585503..6dc33a517647 100644
--- a/net/pimdd/files/patch-config.c
+++ b/net/pimdd/files/patch-config.c
@@ -1,6 +1,6 @@
---- config.c.orig Fri Sep 29 11:55:19 2006
-+++ config.c Fri Sep 29 11:55:43 2006
-@@ -343,7 +343,7 @@
+--- config.c.orig 1999-11-30 17:58:53 UTC
++++ config.c
+@@ -343,7 +343,7 @@ parse_phyint(s)
v->uv_local_pref = n;
}
@@ -9,7 +9,7 @@
if(EQUAL((w = next_word(&s)), ""))
log(LOG_WARNING, 0,
"Missing metric for phyint %s in %s",
-@@ -361,7 +361,7 @@
+@@ -361,7 +361,7 @@ parse_phyint(s)
inet_fmt(local, s1), n);
v->uv_local_metric = n;
}
diff --git a/net/pimdd/files/patch-debug.c b/net/pimdd/files/patch-debug.c
index 41a8adbb4c0e..b1f6393b8839 100644
--- a/net/pimdd/files/patch-debug.c
+++ b/net/pimdd/files/patch-debug.c
@@ -1,6 +1,6 @@
---- debug.c.orig Fri Sep 29 11:54:42 2006
-+++ debug.c Fri Sep 29 11:55:06 2006
-@@ -378,6 +378,7 @@
+--- debug.c.orig 1999-11-30 17:58:53 UTC
++++ debug.c
+@@ -378,6 +378,7 @@ log(int severity, int syserr, char *form
static char fmt[211] = "warning - ";
char *msg;
struct timeval now;
@@ -8,7 +8,7 @@
struct tm *thyme;
va_start(ap, format);
-@@ -394,6 +395,7 @@
+@@ -394,6 +395,7 @@ log(severity, syserr, format, va_alist)
char *msg;
char tbuf[20];
struct timeval now;
@@ -16,7 +16,7 @@
struct tm *thyme;
va_start(ap);
-@@ -408,7 +410,8 @@
+@@ -408,7 +410,8 @@ log(severity, syserr, format, va_alist)
*/
if (haveterminal && (debug || severity <= LOG_WARNING)) {
gettimeofday(&now,NULL);
diff --git a/net/pimdd/files/extra-patch-defs.h b/net/pimdd/files/patch-defs.h
index 1df669efa476..9c9bca445689 100644
--- a/net/pimdd/files/extra-patch-defs.h
+++ b/net/pimdd/files/patch-defs.h
@@ -1,6 +1,6 @@
---- defs.h.orig 2012-07-23 13:50:47.000000000 +0100
-+++ defs.h 2012-07-23 13:35:04.000000000 +0100
-@@ -262,7 +262,7 @@
+--- defs.h.orig 1999-11-30 17:58:53 UTC
++++ defs.h
+@@ -262,7 +262,7 @@ extern char * sys_errlist[];
#ifndef IGMP_MEMBERSHIP_QUERY
#define IGMP_MEMBERSHIP_QUERY IGMP_HOST_MEMBERSHIP_QUERY
@@ -9,7 +9,7 @@
#define IGMP_V1_MEMBERSHIP_REPORT IGMP_HOST_MEMBERSHIP_REPORT
#define IGMP_V2_MEMBERSHIP_REPORT IGMP_HOST_NEW_MEMBERSHIP_REPORT
#else
-@@ -272,7 +272,7 @@
+@@ -272,7 +272,7 @@ extern char * sys_errlist[];
#define IGMP_V2_LEAVE_GROUP IGMP_HOST_LEAVE_MESSAGE
#endif
diff --git a/net/pimdd/files/patch-igmp.c b/net/pimdd/files/patch-igmp.c
index bc6ea80785c6..639eb22c00db 100644
--- a/net/pimdd/files/patch-igmp.c
+++ b/net/pimdd/files/patch-igmp.c
@@ -1,6 +1,15 @@
---- igmp.c.orig 2014-01-22 00:05:49.560452946 +0100
-+++ igmp.c 2014-01-22 00:06:57.098508699 +0100
-@@ -168,7 +168,11 @@
+--- igmp.c.orig 1999-11-30 17:58:53 UTC
++++ igmp.c
+@@ -115,7 +115,7 @@ igmp_read(i, rfd)
+ fd_set *rfd;
+ {
+ register int igmp_recvlen;
+- int dummy = 0;
++ socklen_t dummy = 0;
+
+ igmp_recvlen = recvfrom(igmp_socket, igmp_recv_buf, RECV_BUF_SIZE,
+ 0, NULL, &dummy);
+@@ -168,7 +168,11 @@ accept_igmp(recvlen)
#ifdef RAW_INPUT_IS_RAW
ipdatalen = ntohs(ip->ip_len) - iphdrlen;
#else
@@ -12,3 +21,17 @@
#endif
if (iphdrlen + ipdatalen != recvlen) {
log(LOG_WARNING, 0,
+@@ -257,11 +261,11 @@ accept_igmp(recvlen)
+ return;
+
+ case DVMRP_INFO_REQUEST:
+- dvmrp_accept_info_request(src, dst, (char *)(igmp+1), igmpdatalen);
++ dvmrp_accept_info_request(src, dst, (u_char *)(igmp+1), igmpdatalen);
+ return;
+
+ case DVMRP_INFO_REPLY:
+- dvmrp_accept_info_reply(src, dst, (char *)(igmp+1), igmpdatalen);
++ dvmrp_accept_info_reply(src, dst, (u_char *)(igmp+1), igmpdatalen);
+ return;
+
+ default:
diff --git a/net/pimdd/files/patch-pathnames.h b/net/pimdd/files/patch-pathnames.h
new file mode 100644
index 000000000000..921008e56b8a
--- /dev/null
+++ b/net/pimdd/files/patch-pathnames.h
@@ -0,0 +1,12 @@
+--- pathnames.h.orig 1999-11-30 17:58:53 UTC
++++ pathnames.h
+@@ -47,7 +47,9 @@
+ */
+
+
++#ifndef _PATH_PIMD_CONF
+ #define _PATH_PIMD_CONF "/etc/pimd.conf"
++#endif
+
+ #if (defined(BSD) && (BSD >= 199103))
+ #define _PATH_PIMD_PID "/var/run/pimdd.pid"
diff --git a/net/pimdd/files/patch-pim.c b/net/pimdd/files/patch-pim.c
index 47fd15669be7..4ad2ed4786c4 100644
--- a/net/pimdd/files/patch-pim.c
+++ b/net/pimdd/files/patch-pim.c
@@ -1,6 +1,6 @@
---- pim.c.orig Fri Sep 29 11:54:13 2006
-+++ pim.c Fri Sep 29 11:54:28 2006
-@@ -257,7 +257,6 @@
+--- pim.c.orig 1999-11-30 17:58:53 UTC
++++ pim.c
+@@ -257,7 +257,6 @@ send_pim(buf, src, dst, type, datalen)
pim = (pim_header_t *)(buf + sizeof(struct ip));
pim->pim_type = type;
pim->pim_vers = PIM_PROTOCOL_VERSION;
@@ -8,7 +8,7 @@
pim->pim_cksum = 0;
/* TODO: XXX: if start using this code for PIM_REGISTERS, exclude the
* encapsulated packet from the checsum.
-@@ -349,7 +348,6 @@
+@@ -349,7 +348,6 @@ send_pim_unicast(buf, src, dst, type, da
pim = (pim_header_t *)(buf + sizeof(struct ip));
pim->pim_vers = PIM_PROTOCOL_VERSION;
pim->pim_type = type;
diff --git a/net/pimdd/files/patch-pim_proto.c b/net/pimdd/files/patch-pim_proto.c
index c53844747ec0..07967e3e852b 100644
--- a/net/pimdd/files/patch-pim_proto.c
+++ b/net/pimdd/files/patch-pim_proto.c
@@ -1,6 +1,6 @@
---- pim_proto.c.orig 2014-01-26 12:48:37.048478574 +0100
-+++ pim_proto.c 2014-01-26 12:51:08.180470630 +0100
-@@ -669,7 +669,7 @@
+--- pim_proto.c.orig 1999-11-30 17:58:53 UTC
++++ pim_proto.c
+@@ -669,7 +669,7 @@ receive_pim_join_prune(src, dst, pim_mes
"\tPRUNE src %s, group %s - scheduling delayed join",
inet_fmt(source, s1), inet_fmt(group, s2));
diff --git a/net/pimdd/files/patch-pimdd.h b/net/pimdd/files/patch-pimdd.h
index 004815c21b6d..e694ed0301ca 100644
--- a/net/pimdd/files/patch-pimdd.h
+++ b/net/pimdd/files/patch-pimdd.h
@@ -1,6 +1,6 @@
---- pimdd.h.orig Fri Sep 29 11:53:56 2006
-+++ pimdd.h Fri Sep 29 11:54:07 2006
-@@ -202,7 +202,7 @@
+--- pimdd.h.orig 1999-11-30 17:58:53 UTC
++++ pimdd.h
+@@ -202,7 +202,7 @@ typedef struct pim_jp_encod_grp_ {
#define PIM_ASSERT_RPT_BIT 0x80000000
@@ -9,7 +9,7 @@
/* PIM messages type */
#define PIM_HELLO 0
#ifndef PIM_REGISTER
-@@ -215,6 +215,7 @@
+@@ -215,6 +215,7 @@ typedef struct pim_jp_encod_grp_ {
#define PIM_GRAFT 6
#define PIM_GRAFT_ACK 7
#define PIM_CAND_RP_ADV 8
diff --git a/net/pimdd/files/patch-trace.c b/net/pimdd/files/patch-trace.c
index 591c042e4d69..2f10d11742e2 100644
--- a/net/pimdd/files/patch-trace.c
+++ b/net/pimdd/files/patch-trace.c
@@ -1,6 +1,6 @@
---- trace.c.orig Fri Sep 29 11:55:16 2006
-+++ trace.c Fri Sep 29 11:55:35 2006
-@@ -133,7 +133,7 @@
+--- trace.c.orig 1999-11-30 17:58:53 UTC
++++ trace.c
+@@ -133,7 +133,7 @@ accept_mtrace(src, dst, group, data, no,
/* determine the routing table entry for this traceroute */
mrt = find_route(qry->tr_src, group, MRTF_SG | MRTF_WC | MRTF_PMBR,
DONT_CREATE);
@@ -9,7 +9,7 @@
if (mrt != (mrtentry_t *)NULL) {
if (mrt->upstream != (pim_nbr_entry_t *)NULL)
parent_address = mrt->upstream->address;
-@@ -147,7 +147,7 @@
+@@ -147,7 +147,7 @@ accept_mtrace(src, dst, group, data, no,
*/
} else
log(LOG_DEBUG, 0, "...no route");
diff --git a/net/pimdd/files/pimdd.in b/net/pimdd/files/pimdd.in
new file mode 100644
index 000000000000..eebcd54c7b1b
--- /dev/null
+++ b/net/pimdd/files/pimdd.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# PROVIDE: pimdd
+# REQUIRE: netif routing
+# KEYWORD: nojail
+
+#
+# Add the following to /etc/rc.conf[.local] to enable this service
+#
+# pimdd_enable="YES"
+#
+
+. /etc/rc.subr
+
+name="pimdd"
+rcvar="${name}_enable"
+command="%%PREFIX%%/sbin/${name}"
+required_files="%%PREFIX%%/etc/${name}.conf"
+extra_commands=reload
+
+load_rc_config $name
+: ${pimdd_enable="NO"}
+run_rc_command "$1"
+