summaryrefslogtreecommitdiff
path: root/net/lmd/files
diff options
context:
space:
mode:
Diffstat (limited to 'net/lmd/files')
-rw-r--r--net/lmd/files/lmd.sh35
-rw-r--r--net/lmd/files/patch-Makefile29
-rw-r--r--net/lmd/files/patch-main.c11
-rw-r--r--net/lmd/files/patch-modules_check::Makefile22
4 files changed, 97 insertions, 0 deletions
diff --git a/net/lmd/files/lmd.sh b/net/lmd/files/lmd.sh
new file mode 100644
index 000000000000..e9d93c2833e7
--- /dev/null
+++ b/net/lmd/files/lmd.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 ${lmd_enable:-NO} in
+ [Yy][Ee][Ss])
+ [ -f ${PREFIX}/etc/lmd.conf ] && ${lmd_program:-${PREFIX}/sbin/lmd} ${lmd_flags} && echo -n ' lmd'
+ ;;
+ esac
+ ;;
+stop)
+ case ${lmd_enable:-NO} in
+ [Yy][Ee][Ss])
+ [ -f ${PREFIX}/etc/lmd.conf ] && /usr/bin/killall lmd && echo -n ' lmd'
+ ;;
+ esac
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/net/lmd/files/patch-Makefile b/net/lmd/files/patch-Makefile
new file mode 100644
index 000000000000..211e76b7a333
--- /dev/null
+++ b/net/lmd/files/patch-Makefile
@@ -0,0 +1,29 @@
+--- Makefile.orig Mon Nov 26 07:30:14 2001
++++ Makefile Tue May 14 14:18:21 2002
+@@ -1,18 +1,21 @@
+ SRCS=main.c socket.c chkmodules.c conf.c
+ OBJS=${SRCS:.c=.o}
+ DYNLIB=modules_check/ldd_http_module.so
+-OPTS=-O3 -fomit-frame-pointer -pipe -Wall -ansi
++OPTS=${CFLAGS} ${CPPFLAGS} -Wall -ansi
+ #DEBUG=-DDEBUG -g
+-LIBS=-L/usr/local/lib -lm
++LIBS=-L${PREFIX}/lib -lm
++CC?=cc
++
++all: lmd modules_check/ldd_http_module.so
+
+ lmd: ${OBJS} ${DYNLIB}
+- gcc ${DEBUG} ${OPTS} ${OBJS} -o lmd ${LIBS}
++ ${CC} ${DEBUG} ${OPTS} ${OBJS} -o lmd ${LIBS}
+
+ .c.o: ${SRCS}
+- gcc ${DEBUG} ${OPTS} -c $<
++ ${CC} ${DEBUG} ${OPTS} -c $<
+
+ modules_check/ldd_http_module.so:
+- cd ./modules_check && make && cd ..
++ cd ./modules_check && make 'CC=${CC}' 'CFLAGS=${CFLAGS}' 'CPPFLAGS=${CPPFLAGS}' && cd ..
+
+ clean:
+ rm -rf ${OBJS} lmd *.core *~ modules_check/*.so
diff --git a/net/lmd/files/patch-main.c b/net/lmd/files/patch-main.c
new file mode 100644
index 000000000000..6da527ce86b4
--- /dev/null
+++ b/net/lmd/files/patch-main.c
@@ -0,0 +1,11 @@
+--- main.c.orig Mon Nov 26 06:45:34 2001
++++ main.c Tue May 14 14:09:46 2002
+@@ -1,7 +1,7 @@
+ #include "main.h"
+ #include <math.h>
+ #define TIMETOSLEEP 60
+-#define CONFIGFILE "/usr/local/etc/lmd.conf"
++#define CONFIGFILE PREFIX "/etc/lmd.conf"
+
+ char bufferout[2][1024];
+ char **loaddservers;
diff --git a/net/lmd/files/patch-modules_check::Makefile b/net/lmd/files/patch-modules_check::Makefile
new file mode 100644
index 000000000000..7ef750a84888
--- /dev/null
+++ b/net/lmd/files/patch-modules_check::Makefile
@@ -0,0 +1,22 @@
+--- modules_check/Makefile.orig Mon Nov 26 07:31:09 2001
++++ modules_check/Makefile Tue May 14 14:16:16 2002
+@@ -1,14 +1,15 @@
+ # If you want to debug lmd comment out this line and recompile it
+ # Launch lmd with -v option to see debug messages
+ #DEBUG=-DDEBUG
+-OPTS=-Wall -fomit-frame-pointer -O2 -pipe -ansi
++OPTS=${CFLAGS} ${CPPFLAGS} -ansi
++CC?=cc
+
+ all: socket.o
+- gcc ${DEBUG} ${OPTS} -c ldd_http_module.c
+- gcc ${DEBUG} -shared ldd_http_module.o socket.o -o ldd_http_module.so
++ ${CC} ${DEBUG} ${OPTS} -c ldd_http_module.c
++ ${CC} ${DEBUG} -shared ldd_http_module.o socket.o -o ldd_http_module.so
+
+ socket.o:
+- gcc -c ../socket.c -o socket.o
++ ${CC} -c ../socket.c -o socket.o
+
+ clean:
+ rm *.so *.o