aboutsummaryrefslogtreecommitdiff
path: root/net/irrd
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2014-09-02 18:01:38 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2014-09-02 18:01:38 +0000
commita5a9cdf79fb052ed4da0fd53782135888e5c21c1 (patch)
tree4936c966f3244f3f12a68dcc37df309d1f04aecf /net/irrd
parent4d2406103b0a4fcdd36fe505baccea42e3ec9e99 (diff)
downloadports-a5a9cdf79fb052ed4da0fd53782135888e5c21c1.tar.gz
ports-a5a9cdf79fb052ed4da0fd53782135888e5c21c1.zip
Notes
Diffstat (limited to 'net/irrd')
-rw-r--r--net/irrd/Makefile75
-rw-r--r--net/irrd/distinfo2
-rw-r--r--net/irrd/files/irrd.in28
-rw-r--r--net/irrd/files/patch-config_file.c11
-rw-r--r--net/irrd/files/patch-configure11
-rw-r--r--net/irrd/files/patch-database.c16
-rw-r--r--net/irrd/files/patch-lib_mrt_prefix.c22
-rw-r--r--net/irrd/files/patch-uii_commands.c55
-rw-r--r--net/irrd/pkg-descr3
9 files changed, 223 insertions, 0 deletions
diff --git a/net/irrd/Makefile b/net/irrd/Makefile
new file mode 100644
index 000000000000..5388e77746de
--- /dev/null
+++ b/net/irrd/Makefile
@@ -0,0 +1,75 @@
+# Created by: TAKANO Yuji <takano@net-chef.net>
+# $FreeBSD$
+
+PORTNAME= irrd
+PORTVERSION= 2.3.10
+PORTREVISION= 2
+CATEGORIES= net ipv6
+MASTER_SITES= http://www.irrd.net/
+DISTNAME= ${PORTNAME}${PORTVERSION}
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= ume@FreeBSD.org
+COMMENT= Internet Routing Registry database server
+
+RUN_DEPENDS= wget:${PORTSDIR}/ftp/wget
+
+WRKSRC= ${WRKDIR}/${PORTNAME}${PORTVERSION}/src
+
+IRRD_CONFDIR= ${PREFIX}/etc
+
+USES= shebangfix
+USE_RC_SUBR= irrd
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= YACC="${YACC}"
+MAKE_JOBS_UNSAFE= yes
+#CONFIGURE_ARGS+= --disable-thread
+DESTDIRNAME= STAGEDIR
+
+.if defined(WITHOUT_IPV6)
+CONFIGURE_ARGS+= --disable-ipv6
+.else
+CONFIGURE_ARGS+= --enable-ipv6
+.endif
+
+SHEBANG_FILES= programs/irrdcacher/irrdcacher \
+ programs/irrdcacher/ripe2rpsl
+
+PLIST_FILES= etc/irrd.conf.sample \
+ man/man8/irrd.8.gz \
+ sbin/irr_notify \
+ sbin/irr_rpsl_check \
+ sbin/irr_rpsl_submit \
+ sbin/irrd \
+ sbin/irrdcacher \
+ sbin/ripe2rpsl
+
+post-patch:
+ ${REINPLACE_CMD} -e 's|/etc/irrd.conf|${IRRD_CONFDIR}/irrd.conf|g' \
+ ${WRKSRC}/programs/IRRd/irrd.8 \
+ ${WRKSRC}/programs/IRRd/main.c \
+ ${WRKSRC}/programs/hdr_comm/read_conf.c \
+ ${WRKSRC}/programs/irr_notify/main.c \
+ ${WRKSRC}/programs/irr_rpsl_check/main.c \
+ ${WRKSRC}/programs/irr_rpsl_submit/main.c \
+ ${WRKSRC}/programs/irrdcacher/irrdcacher \
+ ${WRKSRC}/programs/rps_dist/rpsdist.c
+ ${REINPLACE_CMD} -e 's|\($$(DESTDIR)\)|$$(STAGEDIR)\1|g' \
+ -e 's|\( -m 755 \)| -s\1|g' \
+ -e 's| -o root -g bin||g' \
+ ${WRKSRC}/programs/IRRd/Makefile \
+ ${WRKSRC}/programs/irr_notify/Makefile \
+ ${WRKSRC}/programs/irr_rpsl_check/Makefile \
+ ${WRKSRC}/programs/irr_rpsl_submit/Makefile
+
+post-install:
+ @${INSTALL_SCRIPT} ${WRKSRC}/programs/irrdcacher/irrdcacher \
+ ${STAGEDIR}${PREFIX}/sbin
+ @${INSTALL_SCRIPT} ${WRKSRC}/programs/irrdcacher/ripe2rpsl \
+ ${STAGEDIR}${PREFIX}/sbin
+ @${INSTALL_DATA} ${WRKSRC}/../samples/irrd.conf.sample \
+ ${STAGEDIR}${IRRD_CONFDIR}
+ @${INSTALL_DATA} ${WRKSRC}/programs/IRRd/irrd.8 \
+ ${STAGEDIR}${PREFIX}/man/man8
+
+.include <bsd.port.mk>
diff --git a/net/irrd/distinfo b/net/irrd/distinfo
new file mode 100644
index 000000000000..6130da0b3323
--- /dev/null
+++ b/net/irrd/distinfo
@@ -0,0 +1,2 @@
+SHA256 (irrd2.3.10.tgz) = b3ebedc1a1a24a7a87519bdf6776fbda335deb454333b6d09f7bb9fabca35746
+SIZE (irrd2.3.10.tgz) = 772658
diff --git a/net/irrd/files/irrd.in b/net/irrd/files/irrd.in
new file mode 100644
index 000000000000..72ac0ecefe40
--- /dev/null
+++ b/net/irrd/files/irrd.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: irrd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Define these irrd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/irrd
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+irrd_enable="${irrd_enable:-NO}" # Enable irrd
+#irrd_program="%%PREFIX%%/sbin/irrd" # Location of irrd
+irrd_flags="${irrd_flags:--u}" # Flags to irrd program
+
+. /etc/rc.subr
+
+name="irrd"
+rcvar=irrd_enable
+command="%%PREFIX%%/sbin/irrd"
+required_files="%%PREFIX%%/etc/irrd.conf"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/irrd/files/patch-config_file.c b/net/irrd/files/patch-config_file.c
new file mode 100644
index 000000000000..52723b198ac9
--- /dev/null
+++ b/net/irrd/files/patch-config_file.c
@@ -0,0 +1,11 @@
+--- lib/config/config_file.c.orig 2009-03-25 00:38:11.000000000 +0300
++++ lib/config/config_file.c 2011-06-24 17:09:08.000000000 +0400
+@@ -772,7 +772,7 @@
+ Deref_Prefix (prefix);
+ return (1);
+ }
+- if (prefix_compare2 (UII->prefix, prefix) != 0) {
++ if ( UII->prefix == NULL || prefix_compare2 (UII->prefix, prefix) != 0) {
+ set_uii (UII, UII_ADDR, prefix, 0);
+ listen_uii2 (NULL);
+ }
diff --git a/net/irrd/files/patch-configure b/net/irrd/files/patch-configure
new file mode 100644
index 000000000000..c34662282724
--- /dev/null
+++ b/net/irrd/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig 2006-09-12 21:40:55.000000000 +0400
++++ configure 2008-02-15 16:23:17.000000000 +0300
+@@ -6011,7 +6011,7 @@
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-#include <netinet/in.h>
++#include <netinet6/in6.h>
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
diff --git a/net/irrd/files/patch-database.c b/net/irrd/files/patch-database.c
new file mode 100644
index 000000000000..fc32c929eb34
--- /dev/null
+++ b/net/irrd/files/patch-database.c
@@ -0,0 +1,16 @@
+--- programs/IRRd/database.c~ 2009-03-25 00:21:26.000000000 +0300
++++ programs/IRRd/database.c 2012-03-15 10:53:03.000000000 +0400
+@@ -59,9 +59,11 @@
+
+ db->radix_v4 = New_Radix (32);
+ db->radix_v6 = New_Radix (128);
+- fclose (db->db_fp);
+
+- db->db_fp = NULL;
++ if (db->db_fp) {
++ fclose (db->db_fp);
++ db->db_fp = NULL;
++ }
+ }
+
+
diff --git a/net/irrd/files/patch-lib_mrt_prefix.c b/net/irrd/files/patch-lib_mrt_prefix.c
new file mode 100644
index 000000000000..28ef751dd7e9
--- /dev/null
+++ b/net/irrd/files/patch-lib_mrt_prefix.c
@@ -0,0 +1,22 @@
+Index: lib/mrt/prefix.c
+diff -u -p lib/mrt/prefix.c.orig lib/mrt/prefix.c
+--- lib/mrt/prefix.c.orig Fri Aug 31 03:10:31 2001
++++ lib/mrt/prefix.c Mon May 1 12:05:11 2006
+@@ -15,7 +15,7 @@
+ #include <ws2tcpip.h>
+ #endif /* NT */
+
+-#ifndef __GLIBC__
++#if !defined(__GLIBC__) && !defined(__FreeBSD__)
+ #ifdef __osf__
+
+ /* apparently, OSF's gethostby{name,addr}_r's are different, broken, and
+@@ -50,7 +50,7 @@ struct hostent *gethostbyaddr_r
+ For the time being, this part tries to convert Linux glibc 2.X
+ gethostXX_r into Solaris's that we use to code MRT. -- masaki
+ */
+-#if __GLIBC__ >= 2
++#if __GLIBC__ >= 2 || (defined(__FreeBSD__) && defined(HAVE_GETHOSTBYNAME_R))
+ /* Glibc 2.X
+
+ int gethostbyname_r (const char *name, struct hostent *result_buf,
diff --git a/net/irrd/files/patch-uii_commands.c b/net/irrd/files/patch-uii_commands.c
new file mode 100644
index 000000000000..9f1dbfe8b986
--- /dev/null
+++ b/net/irrd/files/patch-uii_commands.c
@@ -0,0 +1,55 @@
+--- programs/IRRd/uii_commands.c.orig Tue Feb 5 05:53:57 2002
++++ programs/IRRd/uii_commands.c Thu Apr 22 18:13:29 2004
+@@ -14,6 +14,8 @@
+ #include <ctype.h>
+ #include "irrd.h"
+
++#include <errno.h>
++
+ #include <fcntl.h>
+ #ifndef SETPGRP_VOID
+ #endif
+@@ -720,6 +722,10 @@
+
+ void run_cmd (char *cmd, FILE **in, FILE **out) {
+ int pin[2], pout[2];
++ int pid;
++ int omask, pstat;
++ pid_t ppid;
++ extern int errno;
+
+ if (in != NULL)
+ *in = NULL;
+@@ -733,7 +739,9 @@
+ if (out != NULL)
+ pipe (pout);
+
+- if (fork() == 0) { /* We're the child */
++/* if (fork() == 0) { */
++ pid = fork();
++ if (pid == 0) { /* We're the child */
+ if (in != NULL) {
+ close (pin[1]);
+ dup2 (pin[0], 0);
+@@ -747,7 +755,7 @@
+ close (pout[1]);
+ }
+
+- execl("/bin/sh", "sh", "-c", cmd, NULL);
++ execlp("/bin/sh", "sh", "-c", cmd, NULL);
+ _exit(127);
+ }
+
+@@ -761,6 +769,12 @@
+ close (pin[0]);
+ *in = fdopen (pin[1], "w");
+ }
++
++ omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
++ do {
++ ppid = waitpid(pid, (int *) &pstat, 0);
++ } while (pid == -1 && errno == EINTR);
++ (void)sigsetmask(omask);
+ }
+
+ int kill_irrd (uii_connection_t *uii) {
diff --git a/net/irrd/pkg-descr b/net/irrd/pkg-descr
new file mode 100644
index 000000000000..fbadf223c414
--- /dev/null
+++ b/net/irrd/pkg-descr
@@ -0,0 +1,3 @@
+Internet Routing Registry Daemon (IRRd).
+
+WWW: http://www.irrd.net/