summaryrefslogtreecommitdiff
path: root/net/irrd/files
diff options
context:
space:
mode:
Diffstat (limited to 'net/irrd/files')
-rw-r--r--net/irrd/files/irrd.in28
-rw-r--r--net/irrd/files/irrd4.in45
-rw-r--r--net/irrd/files/patch-config_file.c11
-rw-r--r--net/irrd/files/patch-configure19
-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-setup.py35
-rw-r--r--net/irrd/files/patch-uii_commands.c55
-rw-r--r--net/irrd/files/pkg-message.in26
9 files changed, 106 insertions, 151 deletions
diff --git a/net/irrd/files/irrd.in b/net/irrd/files/irrd.in
deleted file mode 100644
index 72ac0ecefe40..000000000000
--- a/net/irrd/files/irrd.in
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/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/irrd4.in b/net/irrd/files/irrd4.in
new file mode 100644
index 000000000000..5ac3954e2f7b
--- /dev/null
+++ b/net/irrd/files/irrd4.in
@@ -0,0 +1,45 @@
+#!/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
+#
+# irrd4_enable (bool): Set to NO by default.
+# Set it to YES to enable irrd4
+# irrd4_uid (string): Set to irrd by default.
+# irrd4_gid (string): Set to irrd by default.
+# irrd4_logfile (path): Set to /var/log/irrd4.log by default.
+# irrd4_pidfile (path): Set to /var/run/irrd4.pid by default.
+# irrd4_config (path): Set to %%PREFIX%%/etc/irrd4.yaml by default.
+
+. /etc/rc.subr
+
+name="irrd4"
+rcvar=irrd4_enable
+command="%%PREFIX%%/bin/twistd"
+
+load_rc_config $name
+
+irrd4_enable=${irrd4_enable-"NO"}
+irrd4_uid=${irrd4_uid-"%%USERS%%"}
+irrd4_gid=${irrd4_gid-"%%GROUPS%%"}
+irrd4_logfile=${irrd4_logfile-"/var/log/irrd4.log"}
+irrd4_pidfile=${irrd4_pidfile-"/var/run/irrd4.pid"}
+irrd4_config=${irrd4_config-"%%PREFIX%%/etc/irrd4.yaml"}
+
+required_files="${irrd4_config}"
+command_interpreter="%%PYTHON_CMD%%"
+pidfile=${irrd4_pidfile}
+
+command_args="--originalname -u ${irrd4_uid} -g ${irrd4_gid} --pidfile ${pidfile} -l ${irrd4_logfile} irrd -c ${irrd4_config}"
+
+run_rc_command "$1"
diff --git a/net/irrd/files/patch-config_file.c b/net/irrd/files/patch-config_file.c
deleted file mode 100644
index 52723b198ac9..000000000000
--- a/net/irrd/files/patch-config_file.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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
deleted file mode 100644
index 094af76d68de..000000000000
--- a/net/irrd/files/patch-configure
+++ /dev/null
@@ -1,19 +0,0 @@
---- configure.orig 2006-09-12 17:40:55 UTC
-+++ configure
-@@ -2638,7 +2638,6 @@
- THREAD_CFLAGS="-D_THREAD_SAFE -pthread"
- fi
- CRYPT_LIB="-lcrypt"
-- ac_pthrlib="c_r"
- ;;
- linux* )
- CRYPT_LIB="-lcrypt"
-@@ -6011,7 +6010,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
deleted file mode 100644
index fc32c929eb34..000000000000
--- a/net/irrd/files/patch-database.c
+++ /dev/null
@@ -1,16 +0,0 @@
---- 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
deleted file mode 100644
index 28ef751dd7e9..000000000000
--- a/net/irrd/files/patch-lib_mrt_prefix.c
+++ /dev/null
@@ -1,22 +0,0 @@
-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-setup.py b/net/irrd/files/patch-setup.py
new file mode 100644
index 000000000000..438f915317f2
--- /dev/null
+++ b/net/irrd/files/patch-setup.py
@@ -0,0 +1,35 @@
+--- setup.py.orig 2019-11-12 12:54:56 UTC
++++ setup.py
+@@ -23,19 +23,19 @@ setuptools.setup(
+ # This list must be kept in sync with requirements.txt version-wise,
+ # but should not include packages used for testing, generating docs
+ # or packages.
+- 'python-gnupg==0.4.4',
+- 'passlib==1.7.1',
+- 'IPy==1.0.0',
+- 'dataclasses==0.6',
+- 'ordered-set==3.1.1',
+- 'dotted==0.1.8',
+- 'beautifultable==0.7.0',
+- 'PyYAML==5.1',
+- 'psycopg2-binary==2.8.2',
+- 'SQLAlchemy==1.3.3',
+- 'alembic==1.0.10',
+- 'ujson==1.35',
+- 'twisted==19.2.1',
++ 'python-gnupg>=0.4.3',
++ 'passlib>=1.7.1',
++ 'IPy>=1.0.0',
++ 'dataclasses==0.6; python_version<"3.7"',
++ 'ordered-set>=3.1.1',
++ 'dotted>=0.1.8',
++ 'beautifultable>=0.7.0',
++ 'PyYAML>=5.1',
++ 'psycopg2>=2.8.2',
++ 'SQLAlchemy>=1.2.19',
++ 'alembic>=1.0.10',
++ 'ujson>=1.35',
++ 'twisted>=18.9.0',
+ ],
+ entry_points={
+ 'console_scripts': [
diff --git a/net/irrd/files/patch-uii_commands.c b/net/irrd/files/patch-uii_commands.c
deleted file mode 100644
index 9f1dbfe8b986..000000000000
--- a/net/irrd/files/patch-uii_commands.c
+++ /dev/null
@@ -1,55 +0,0 @@
---- 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/files/pkg-message.in b/net/irrd/files/pkg-message.in
new file mode 100644
index 000000000000..8c67e1d9a373
--- /dev/null
+++ b/net/irrd/files/pkg-message.in
@@ -0,0 +1,26 @@
+[
+{ type: install
+ message: <<EOM
+1. A working copy of postgresql-server and postgresql-contrib is required.
+
+2. For a fresh install the following should do:
+pkg install postgresql%%PGSQL_DEFAULT%%-server postgresql%%PGSQL_DEFAULT%%-contrib
+
+3. Change the related postgresql server configuration like the following:
+https://irrd.readthedocs.io/en/stable/admins/deployment.html#postgresql-configuration
+
+Follow the documentation to create a database
+
+4. Configure irrd accordingly following the documentation:
+https://irrd.readthedocs.io/en/stable/admins/configuration.html
+
+5. Enable irrd at startup with:
+sysrc irrd4_enable=YES
+
+6. Start the service:
+service irrd4 start
+
+7. First sync of whois database might take a long time depending on resources available
+EOM
+}
+]