summaryrefslogtreecommitdiff
path: root/net/loadd/files
diff options
context:
space:
mode:
Diffstat (limited to 'net/loadd/files')
-rw-r--r--net/loadd/files/010.loadd.sh35
-rw-r--r--net/loadd/files/patch-Makefile29
-rw-r--r--net/loadd/files/patch-define.h11
-rw-r--r--net/loadd/files/patch-main.c11
4 files changed, 86 insertions, 0 deletions
diff --git a/net/loadd/files/010.loadd.sh b/net/loadd/files/010.loadd.sh
new file mode 100644
index 000000000000..a20c4440d37b
--- /dev/null
+++ b/net/loadd/files/010.loadd.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 64
+fi
+
+if [ -r /etc/defaults/rc.conf ]; then
+ . /etc/defaults/rc.conf
+ source_rc_confs
+elif [ -r /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
+case "$1" in
+start)
+ case ${loadd_enable:-NO} in
+ [Yy][Ee][Ss])
+ [ -f ${PREFIX}/etc/loadd.conf && ${loadd_program:-${PREFIX}/libexec/loadd} ${loadd_flags:--d} && echo -n ' loadd'
+ ;;
+ esac
+ ;;
+stop)
+ case ${loadd_enable:-NO} in
+ [Yy][Ee][Ss])
+ [ -f ${PREFIX}/etc/loadd.conf ] && /usr/bin/killall loadd && echo -n ' loadd'
+ ;;
+ esac
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/net/loadd/files/patch-Makefile b/net/loadd/files/patch-Makefile
new file mode 100644
index 000000000000..4e80c30e23ec
--- /dev/null
+++ b/net/loadd/files/patch-Makefile
@@ -0,0 +1,29 @@
+--- Makefile.orig Mon Nov 26 07:44:48 2001
++++ Makefile Tue May 14 14:55:55 2002
+@@ -3,18 +3,21 @@
+
+ SRCS=main.c socket.c icmp.c conf.c threads.c network.c aliasing.c tri.c
+ OBJS=${SRCS:.c=.o}
+-OPTS=-pthread -pipe -Wall -ansi -O2 -march=pentiumpro -fomit-frame-pointer -ffast-math
++OPTS=${CFLAGS} ${CPPFLAGS} -Wall -ansi
+ #DEBUG=-DDEBUG -DDEBUGALIAS #-DDEBUGHASHTABLE
+ #DEBUG=-DDEBUGMONITOR
+-DEFINE=-D_THREAD_SAFE -D_REENTRANT
+-LIBS=-L/usr/local/lib `glib12-config --libs`
++DEFINE=${PTHREAD_CFLAGS}
++LIBS=-L${PREFIX}/lib `glib12-config --libs` ${PTHREAD_LIBS}
+ INCLUDE=`glib12-config --cflags`
++CC?=cc
++
++all: loadd
+
+ loadd: ${OBJS}
+- gcc ${INCLUDE} ${DEFINE} ${DEBUG} ${OPTS} ${OBJS} -o loadd ${LIBS}
++ ${CC} ${INCLUDE} ${DEFINE} ${DEBUG} ${OPTS} ${OBJS} -o loadd ${LIBS}
+
+ .c.o: ${SRCS}
+- gcc ${INCLUDE} ${DEFINE} ${DEBUG} ${OPTS} -c $<
++ ${CC} ${INCLUDE} ${DEFINE} ${DEBUG} ${OPTS} -c $<
+
+ clean:
+ rm -rf ${OBJS} loadd *.core *~
diff --git a/net/loadd/files/patch-define.h b/net/loadd/files/patch-define.h
new file mode 100644
index 000000000000..8e8351247e59
--- /dev/null
+++ b/net/loadd/files/patch-define.h
@@ -0,0 +1,11 @@
+--- define.h.orig Tue Oct 2 22:43:20 2001
++++ define.h Tue May 14 14:45:36 2002
+@@ -5,7 +5,7 @@
+ #define MONITORINGPORT 8670 /* En UDP */
+ #define PINGINTERVAL 60000000
+ #define REFRESHTIMEOUT 1
+-#define CONFFILE "/usr/local/etc/loadd2.conf"
++#define CONFFILE PREFIX "/etc/loadd.conf"
+ #define CALC_CHECKSUM(acc, cksum) { \
+ acc += cksum; \
+ if (acc < 0) \
diff --git a/net/loadd/files/patch-main.c b/net/loadd/files/patch-main.c
new file mode 100644
index 000000000000..8a5be982437d
--- /dev/null
+++ b/net/loadd/files/patch-main.c
@@ -0,0 +1,11 @@
+--- main.c.orig Mon Nov 26 05:59:19 2001
++++ main.c Tue May 14 14:46:25 2002
+@@ -270,7 +270,7 @@
+ break;
+ }
+ if (! *conffile)
+- strncpy(conffile, "/usr/local/etc/loadd.conf", sizeof(conffile) - 1);
++ strncpy(conffile, PREFIX "/etc/loadd.conf", sizeof(conffile) - 1);
+ argc -= optind;
+ argv += optind;
+ ht = loadd_main_init(conffile);