summaryrefslogtreecommitdiff
path: root/package/dhcp-forwarder
diff options
context:
space:
mode:
Diffstat (limited to 'package/dhcp-forwarder')
-rw-r--r--package/dhcp-forwarder/Config.in8
-rw-r--r--package/dhcp-forwarder/Makefile36
-rw-r--r--package/dhcp-forwarder/files/dhcp-fwd.init26
-rw-r--r--package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles1
-rw-r--r--package/dhcp-forwarder/ipkg/dhcp-forwarder.control4
-rw-r--r--package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst3
-rw-r--r--package/dhcp-forwarder/patches/00-big_endian.patch11
-rw-r--r--package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch35
8 files changed, 124 insertions, 0 deletions
diff --git a/package/dhcp-forwarder/Config.in b/package/dhcp-forwarder/Config.in
new file mode 100644
index 000000000..cfe8f7d36
--- /dev/null
+++ b/package/dhcp-forwarder/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_DHCP_FORWARDER
+ prompt "dhcp-forwarder.................... DHCP relay agent"
+ tristate
+ default n
+ help
+ A DHCP relay agent
+
+ http://www.nongnu.org/dhcp-fwd/
diff --git a/package/dhcp-forwarder/Makefile b/package/dhcp-forwarder/Makefile
new file mode 100644
index 000000000..880e1a3cb
--- /dev/null
+++ b/package/dhcp-forwarder/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dhcp-forwarder
+PKG_VERSION:= 0.7
+PKG_RELEASE:= 12
+PKG_MD5SUM:= e7f876e615ebc3f96418f6477b4451e2
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://savannah.nongnu.org/download/dhcp-fwd/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DHCP_FORWARDER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull="yes"
+CONFIGURE_ARGS+= --disable-dietlibc
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= cfg_filename="/etc/dhcp-fwd.conf"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DHCP_FORWARDER}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_DHCP_FORWARDER}/usr/sbin
+ ${INSTALL_DATA} ${WRKBUILD}/contrib/dhcp-fwd.conf \
+ ${IDIR_DHCP_FORWARDER}/etc/
+ ${INSTALL_BIN} ./files/dhcp-fwd.init \
+ ${IDIR_DHCP_FORWARDER}/etc/init.d/dhcp-fwd
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dhcp-fwd \
+ ${IDIR_DHCP_FORWARDER}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dhcp-forwarder/files/dhcp-fwd.init b/package/dhcp-forwarder/files/dhcp-fwd.init
new file mode 100644
index 000000000..1481095fe
--- /dev/null
+++ b/package/dhcp-forwarder/files/dhcp-fwd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${dhcp-fwd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ dhcp-fwd
+ ;;
+stop)
+ killall dhcp-fwd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles b/package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles
new file mode 100644
index 000000000..70be85a8a
--- /dev/null
+++ b/package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles
@@ -0,0 +1 @@
+/etc/dhcp-fwd.conf
diff --git a/package/dhcp-forwarder/ipkg/dhcp-forwarder.control b/package/dhcp-forwarder/ipkg/dhcp-forwarder.control
new file mode 100644
index 000000000..9958ddb39
--- /dev/null
+++ b/package/dhcp-forwarder/ipkg/dhcp-forwarder.control
@@ -0,0 +1,4 @@
+Package: dhcp-forwarder
+Priority: optional
+Section: net
+Description: a DHCP relay agent
diff --git a/package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst b/package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst
new file mode 100644
index 000000000..9ba16f5b0
--- /dev/null
+++ b/package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf dhcp_fwd dhcp_fwd NO
diff --git a/package/dhcp-forwarder/patches/00-big_endian.patch b/package/dhcp-forwarder/patches/00-big_endian.patch
new file mode 100644
index 000000000..add157d3f
--- /dev/null
+++ b/package/dhcp-forwarder/patches/00-big_endian.patch
@@ -0,0 +1,11 @@
+--- dhcp-forwarder-0.7/src/dhcp.h 2004-06-22 03:46:56.000000000 -0700
++++ dhcp-forwarder-0.7-x/src/dhcp.h 2005-10-06 17:04:14.000000000 -0700
+@@ -89,7 +89,7 @@
+ optDHCP_COOKIE = 0x63538263u,
+ flgDHCP_BCAST = 0x0080u
+ #else
+- DHCP_COOKIE = 0x63825363u,
++ optDHCP_COOKIE = 0x63825363u,
+ flgDHCP_BCAST = 0x8000u
+ #endif
+ };
diff --git a/package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch b/package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch
new file mode 100644
index 000000000..ef8491330
--- /dev/null
+++ b/package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch
@@ -0,0 +1,35 @@
+diff -pur dhcp-forwarder-0.7-orig/src/wrappers.h dhcp-forwarder-0.7-patched/src/wrappers.h
+--- dhcp-forwarder-0.7-orig/src/wrappers.h 2004-06-22 12:46:56.000000000 +0200
++++ dhcp-forwarder-0.7-patched/src/wrappers.h 2005-12-27 12:28:10.464289435 +0100
+@@ -65,7 +65,14 @@ Egetgrnam(char const *name)
+ /*@*/
+ {
+ /*@observer@*/struct group const *res = getgrnam(name);
+- FatalErrnoError(res==0, 1, "getgrnam()");
++
++ FatalErrnoError((res == NULL) && (errno != 0), 1, "getgrnam()");
++
++ if (res == NULL)
++ {
++ fprintf (stderr, "No such group: `%s'\n", name);
++ exit (1);
++ }
+
+ /*@-freshtrans@*/
+ /*@-mustfreefresh@*/
+@@ -80,7 +87,14 @@ Egetpwnam(char const *name)
+ /*@*/
+ {
+ struct passwd const *res = getpwnam(name);
+- FatalErrnoError(res==0, 1, "getpwnam()");
++
++ FatalErrnoError((res == NULL) && (errno != 0), 1, "getpwnam()");
++
++ if (res == NULL)
++ {
++ fprintf (stderr, "No such user: `%s'\n", name);
++ exit (1);
++ }
+
+ return res;
+ }