summaryrefslogtreecommitdiff
path: root/net/isc-dhcp
diff options
context:
space:
mode:
authoradrianp <adrianp@pkgsrc.org>2007-12-12 20:02:08 +0000
committeradrianp <adrianp@pkgsrc.org>2007-12-12 20:02:08 +0000
commita0e153f9b269894d0ba5e5f4843cc5cab0b4ccf9 (patch)
tree81d2e9e4d9d92b18156857d5f5a7c4a81c4b1ca0 /net/isc-dhcp
parent76e2494bf308f47458ad7486ab1bf1218e414c83 (diff)
downloadpkgsrc-a0e153f9b269894d0ba5e5f4843cc5cab0b4ccf9.tar.gz
This package provides the ISC Dynamic Host Configuration Protocol (DHCP)
server and DHCP relay agent. It includes an DHCP (and BOOTP) server daemon used to distribute network information, an Object Management API command shell for querying and modifying DHCP server attributes (while it is running), and an agent for relaying DHCP and BOOTP requests between subnets. This package contains the Base component. Imported from pkgsrc-wip. Inital packaging by reed@
Diffstat (limited to 'net/isc-dhcp')
-rw-r--r--net/isc-dhcp/DESCR9
-rw-r--r--net/isc-dhcp/Makefile30
-rw-r--r--net/isc-dhcp/Makefile.common50
-rw-r--r--net/isc-dhcp/PLIST25
-rw-r--r--net/isc-dhcp/TODO4
-rw-r--r--net/isc-dhcp/buildlink3.mk19
-rw-r--r--net/isc-dhcp/distinfo8
-rwxr-xr-xnet/isc-dhcp/files/isc_dhclient.sh33
-rwxr-xr-xnet/isc-dhcp/files/isc_dhcpd.sh35
-rwxr-xr-xnet/isc-dhcp/files/isc_dhcrelay.sh33
-rw-r--r--net/isc-dhcp/files/site.conf25
-rw-r--r--net/isc-dhcp/files/site.h6
-rw-r--r--net/isc-dhcp/patches/patch-ab13
-rw-r--r--net/isc-dhcp/patches/patch-ac38
-rw-r--r--net/isc-dhcp/patches/patch-ad18
15 files changed, 346 insertions, 0 deletions
diff --git a/net/isc-dhcp/DESCR b/net/isc-dhcp/DESCR
new file mode 100644
index 00000000000..1297b8b3ba1
--- /dev/null
+++ b/net/isc-dhcp/DESCR
@@ -0,0 +1,9 @@
+This package provides the ISC Dynamic Host Configuration Protocol (DHCP)
+server and DHCP relay agent.
+
+It includes an DHCP (and BOOTP) server daemon used to distribute network
+information, an Object Management API command shell for querying and
+modifying DHCP server attributes (while it is running), and an agent
+for relaying DHCP and BOOTP requests between subnets.
+
+This package contains the Base component.
diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile
new file mode 100644
index 00000000000..7cb1cf178dd
--- /dev/null
+++ b/net/isc-dhcp/Makefile
@@ -0,0 +1,30 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+#
+
+COMMENT= ISC Dynamic Host Configuration Protocol (DHCP) Base
+COMPONENT= base
+SUBDIR= common minires dst
+
+MAN_FILES= man5/dhcp-eval.5 man5/dhcp-options.5
+
+post-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/isc-dhcp-${COMPONENT}
+ ${INSTALL_DATA_DIR} ${PREFIX}/include/isc-dhcp
+ ${INSTALL_DATA_DIR} ${PREFIX}/include/omapip
+
+ ${INSTALL_DATA} ${WRKSRC}/README \
+ ${PREFIX}/share/doc/isc-dhcp-${COMPONENT}
+ ${INSTALL_DATA} ${WRKSRC}/RELNOTES \
+ ${PREFIX}/share/doc/isc-dhcp-${COMPONENT}
+ ${INSTALL_DATA} ${WRKSRC}/doc/References.txt \
+ ${PREFIX}/share/doc/isc-dhcp-${COMPONENT}
+ ${INSTALL_DATA} ${WRKSRC}/includes/isc-dhcp/*.h \
+ ${PREFIX}/include/isc-dhcp
+ ${INSTALL_DATA} ${WRKSRC}/includes/omapip/*.h \
+ ${PREFIX}/include/omapip
+ ${INSTALL_LIB} \
+ ${WRKSRC}/work.`${WRKSRC}/configure --print-sysname`/dst/*.a \
+ ${PREFIX}/lib
+
+.include "../../wip/isc-dhcp/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/isc-dhcp/Makefile.common b/net/isc-dhcp/Makefile.common
new file mode 100644
index 00000000000..5b2f776f5e8
--- /dev/null
+++ b/net/isc-dhcp/Makefile.common
@@ -0,0 +1,50 @@
+# $NetBSD: Makefile.common,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+#
+
+DISTNAME= dhcp-3.1.0
+PKGNAME= ${DISTNAME:S/dhcp/isc-dhcp-${COMPONENT}/}
+CATEGORIES= net
+MASTER_SITES= http://ftp.isc.org/isc/dhcp/ \
+ http://ftp.isc.org/isc/dhcp/dhcp-3.0-history/
+
+MAINTAINER= adrianp@NetBSD.org
+HOMEPAGE= http://www.isc.org/sw/dhcp/
+
+.include "../../mk/bsd.prefs.mk"
+
+HAS_CONFIGURE= yes
+DHCP_HOME?= ${VARBASE}/db/isc-dhcp
+DHCP_SYSLOG_LEVEL?= 1
+PKG_SYSCONFSUBDIR= dhcp
+USE_TOOLS+= nroff
+
+FILESDIR= ${.CURDIR}/../isc-dhcp/files
+PATCHDIR= ${.CURDIR}/../isc-dhcp/patches
+EGDIR= ${PREFIX}/share/examples/isc-dhcp-${COMPONENT}
+BUILD_DEFS+= VARBASE DHCP_HOME DHCP_SYSLOG_LEVEL
+
+SUBST_CLASSES+= conf
+SUBST_STAGE.conf= pre-configure
+SUBST_MESSAGE.conf= Fixing configuration files.
+SUBST_FILES.conf= includes/site.h site.conf
+SUBST_SED.conf= -e 's|@@DHCP_SYSLOG_LEVEL@@|${DHCP_SYSLOG_LEVEL}|g'
+SUBST_SED.conf+= -e 's|@@VARBASE@@|${VARBASE}|g'
+SUBST_SED.conf+= -e 's|@@SYSCONFDIR@@|${PKG_SYSCONFDIR}|g'
+SUBST_SED.conf+= -e 's|@@PREFIX@@|${PREFIX}|g'
+SUBST_SED.conf+= -e 's|@@CC@@|${CC:Q}|g'
+SUBST_SED.conf+= -e 's|@@CFLAGS@@|${CFLAGS:Q}|g'
+SUBST_SED.conf+= -e 's|@@PKGMANDIR@@|${PKGMANDIR}|g'
+
+post-extract:
+ ${CAT} ${FILESDIR}/site.h >> ${WRKSRC}/includes/site.h
+ ${CAT} ${FILESDIR}/site.conf >> ${WRKSRC}/site.conf
+
+do-install:
+. for d in ${SUBDIR}
+ cd ${WRKSRC}/work.`${WRKSRC}/configure --print-sysname`/${d} \
+ && ${SETENV} ${MAKE_ENV} ${MAKE} install
+. endfor
+
+. for m in ${MAN_FILES}
+ ${CHMOD} ${MANMODE} ${PREFIX}/${PKGMANDIR}/${m}
+. endfor
diff --git a/net/isc-dhcp/PLIST b/net/isc-dhcp/PLIST
new file mode 100644
index 00000000000..6615a9224c3
--- /dev/null
+++ b/net/isc-dhcp/PLIST
@@ -0,0 +1,25 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+include/isc-dhcp/boolean.h
+include/isc-dhcp/dst.h
+include/isc-dhcp/int.h
+include/isc-dhcp/lang.h
+include/isc-dhcp/list.h
+include/isc-dhcp/result.h
+include/isc-dhcp/types.h
+include/omapip/alloc.h
+include/omapip/buffer.h
+include/omapip/convert.h
+include/omapip/hash.h
+include/omapip/omapip.h
+include/omapip/omapip_p.h
+include/omapip/trace.h
+include/omapip/trace_mr.h
+lib/libdst.a
+man/man5/dhcp-eval.5
+man/man5/dhcp-options.5
+share/doc/isc-dhcp-base/README
+share/doc/isc-dhcp-base/RELNOTES
+share/doc/isc-dhcp-base/References.txt
+@dirrm share/doc/isc-dhcp-base
+@dirrm include/isc-dhcp
+@dirrm include/omapip
diff --git a/net/isc-dhcp/TODO b/net/isc-dhcp/TODO
new file mode 100644
index 00000000000..b4f53d5893a
--- /dev/null
+++ b/net/isc-dhcp/TODO
@@ -0,0 +1,4 @@
+set up patch for NetBSD, like:
+includes/cf/netbsd.h
+and common/bpf.c and common/fddi.c to use NETBSD_FDDI
+(see NetBSD's /usr/src/dist/dhcp)
diff --git a/net/isc-dhcp/buildlink3.mk b/net/isc-dhcp/buildlink3.mk
new file mode 100644
index 00000000000..9c95fc26928
--- /dev/null
+++ b/net/isc-dhcp/buildlink3.mk
@@ -0,0 +1,19 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+ISC_DHCP_BASE_BUILDLINK3_MK:= ${ISC_DHCP_BASE_BUILDLINK3_MK}+
+
+.if ${BUILDLINK_DEPTH} == "+"
+BUILDLINK_DEPENDS+= isc-dhcp-base
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nisc-dhcp-base}
+BUILDLINK_PACKAGES+= isc-dhcp-base
+BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}isc-dhcp-base
+
+.if ${ISC_DHCP_BASE_BUILDLINK3_MK} == "+"
+BUILDLINK_API_DEPENDS.isc-dhcp-base+= isc-dhcp-base>=3.1.0
+BUILDLINK_PKGSRCDIR.isc-dhcp-base?= ../../wip/isc-dhcp
+.endif # ISC_DHCP_BASE_BUILDLINK3_MK
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/net/isc-dhcp/distinfo b/net/isc-dhcp/distinfo
new file mode 100644
index 00000000000..ce1717dd70b
--- /dev/null
+++ b/net/isc-dhcp/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+
+SHA1 (dhcp-3.1.0.tar.gz) = f33d017f055648e6571aa26cf314d37857491a2e
+RMD160 (dhcp-3.1.0.tar.gz) = 59ef8b695b66d3cb61437e25a179d9f17639017d
+Size (dhcp-3.1.0.tar.gz) = 797100 bytes
+SHA1 (patch-ab) = e5d0a682c0228ce1c63533fe361f5649d5dd2c17
+SHA1 (patch-ac) = 14f834431c1cb97d0b9c11ae43abc7b758bac923
+SHA1 (patch-ad) = bd10d5f519065ecbd061f3ccff6685c390a1118a
diff --git a/net/isc-dhcp/files/isc_dhclient.sh b/net/isc-dhcp/files/isc_dhclient.sh
new file mode 100755
index 00000000000..1f76834f9e6
--- /dev/null
+++ b/net/isc-dhcp/files/isc_dhclient.sh
@@ -0,0 +1,33 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: isc_dhclient.sh,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+#
+
+# PROVIDE: dhclient
+# REQUIRE: network mountcritlocal
+# BEFORE: NETWORKING
+#
+# Note that there no syslog logging of dhclient messages at boot because
+# dhclient needs to start before services that syslog depends upon do.
+#
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="dhclient"
+rcvar="isc_dhclient"
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/isc-dhcp/${name}.pid"
+start_precmd="isc_dhclient_precmd"
+
+isc_dhclient_precmd()
+{
+ if [ ! -d @VARBASE@/run/isc-dhcp ]; then
+ @MKDIR@ @VARBASE@/run/isc-dhcp
+ @CHMOD@ 0770 @VARBASE@/run/isc-dhcp
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/isc-dhcp/files/isc_dhcpd.sh b/net/isc-dhcp/files/isc_dhcpd.sh
new file mode 100755
index 00000000000..49b5662d48d
--- /dev/null
+++ b/net/isc-dhcp/files/isc_dhcpd.sh
@@ -0,0 +1,35 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: isc_dhcpd.sh,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+#
+
+# PROVIDE: dhcpd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="dhcpd"
+rcvar="isc_dhcpd"
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/isc-dhcp/${name}.pid"
+required_files="@PKG_SYSCONFDIR@/${name}.conf @DHCP_HOME@/${name}.leases"
+start_precmd="isc_dhcpd_precmd"
+
+isc_dhcpd_precmd()
+{
+ if [ ! -d @VARBASE@/run/isc-dhcp ]; then
+ @MKDIR@ @VARBASE@/run/isc-dhcp
+ @CHMOD@ 0770 @VARBASE@/run/isc-dhcp
+ fi
+
+ if [ ! -f @DHCP_HOME@/dhcpd.leases ]; then
+ @TOUCH@ @DHCP_HOME@/dhcpd.leases
+ @CHMOD@ 0640 @DHCP_HOME@/dhcpd.leases
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/isc-dhcp/files/isc_dhcrelay.sh b/net/isc-dhcp/files/isc_dhcrelay.sh
new file mode 100755
index 00000000000..8d8ea273696
--- /dev/null
+++ b/net/isc-dhcp/files/isc_dhcrelay.sh
@@ -0,0 +1,33 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: isc_dhcrelay.sh,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+#
+
+# PROVIDE: dhcrelay
+# REQUIRE: DAEMON
+# BEFORE: NETWORKING
+#
+# Note that there no syslog logging of dhclient messages at boot because
+# dhclient needs to start before services that syslog depends upon do.
+#
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="dhcrelay"
+rcvar="isc_dhcrelay"
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/isc-dhcp/${name}.pid"
+start_precmd="isc_dhcrelay_precmd"
+
+isc_dhcrelay_precmd()
+{
+ if [ ! -d @VARBASE@/run/isc-dhcp ]; then
+ @MKDIR@ @VARBASE@/run/isc-dhcp
+ @CHMOD@ 0770 @VARBASE@/run/isc-dhcp
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/isc-dhcp/files/site.conf b/net/isc-dhcp/files/site.conf
new file mode 100644
index 00000000000..26fd78756e1
--- /dev/null
+++ b/net/isc-dhcp/files/site.conf
@@ -0,0 +1,25 @@
+CC = @@CC@@
+CC_OPTIONS = @@CFLAGS@@
+USERBINDIR = @@PREFIX@@/bin
+BINDIR = @@PREFIX@@/sbin
+CLIENTBINDIR = @@PREFIX@@/sbin
+ADMMANDIR = @@PREFIX@@/@@PKGMANDIR@@/man8
+FFMANDIR = @@PREFIX@@/@@PKGMANDIR@@/man5
+LIBMANDIR = @@PREFIX@@/@@PKGMANDIR@@/man3
+USRMANDIR = @@PREFIX@@/@@PKGMANDIR@@/man1
+ADMMANEXT = .8
+FFMANEXT = .5
+LIBMANEXT = .3
+USRMANEXT = .1
+MANCAT = man
+#ADMMANDIR = @@PREFIX@@/@@PKGMANDIR@@/cat8
+#FFMANDIR = @@PREFIX@@/@@PKGMANDIR@@/cat5
+#LIBMANDIR = @@PREFIX@@/@@PKGMANDIR@@/cat3
+#USRMANDIR = @@PREFIX@@/@@PKGMANDIR@@/cat1
+ETC = @@SYSCONFDIR@@
+VARRUN = @@VARBASE@@/run/isc-dhcp
+VARDB = @@VARBASE@@/db/isc-dhcp
+LIBDIR = @@PREFIX@@/lib
+INCDIR = @@PREFIX@@/include
+CLIENT_PATH = '"PATH=@@PREFIX@@/bin:@@PREFIX@@/sbin:/usr/ucb:/usr/bin:/usr/sbin:/bin:/sbin"'
+DEBUG =
diff --git a/net/isc-dhcp/files/site.h b/net/isc-dhcp/files/site.h
new file mode 100644
index 00000000000..6f9ba313b28
--- /dev/null
+++ b/net/isc-dhcp/files/site.h
@@ -0,0 +1,6 @@
+#define _PATH_DHCPD_CONF "@@SYSCONFDIR@@/dhcpd.conf"
+#define _PATH_DHCPD_PID "@@VARBASE@@/run/isc-dhcp/isc-dhcpd.pid"
+#define _PATH_DHCPD_DB "@@VARBASE@@/db/isc-dhcp/dhcpd.leases"
+#define _PATH_DHCLIENT_DB "@@VARBASE@@/db/isc-dhcp/dhclient.leases"
+#define _PATH_DHCLIENT_SCRIPT "@@PREFIX@@/sbin/dhclient-script"
+#define DHCPD_LOG_FACILITY LOG_LOCAL@@DHCP_SYSLOG_LEVEL@@
diff --git a/net/isc-dhcp/patches/patch-ab b/net/isc-dhcp/patches/patch-ab
new file mode 100644
index 00000000000..c995b704e98
--- /dev/null
+++ b/net/isc-dhcp/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+
+--- configure.orig 2004-09-10 23:02:30.000000000 +0200
++++ configure
+@@ -259,7 +259,7 @@ for foo in $dirs; do
+ <Makefile.conf; \
+ cat site.conf; \
+ echo "TOP = `pwd`"; \
+- echo CC_OPTIONS = $copts; \
++ echo CC_OPTIONS ?= $copts; \
+ cat $foo/Makefile.dist) \
+ >${workname}/$bar/Makefile
+ done
diff --git a/net/isc-dhcp/patches/patch-ac b/net/isc-dhcp/patches/patch-ac
new file mode 100644
index 00000000000..89d464a1f60
--- /dev/null
+++ b/net/isc-dhcp/patches/patch-ac
@@ -0,0 +1,38 @@
+$NetBSD: patch-ac,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+
+--- minires/res_send.c.orig 2004-06-10 18:59:44.000000000 +0100
++++ minires/res_send.c
+@@ -80,15 +80,4 @@ static const char rcsid[] = "$Id: res_se
+ #endif /* LIBC_SCCS and not lint */
+
+-/* Rename the I/O functions in case we're tracing. */
+-#define send trace_mr_send
+-#define recvfrom trace_mr_recvfrom
+-#define read trace_mr_read
+-#define connect trace_mr_connect
+-#define socket trace_mr_socket
+-#define bind trace_mr_bind
+-#define close trace_mr_close
+-#define select trace_mr_select
+-#define time trace_mr_time
+-
+ /*
+ * Send query to name server and wait for reply.
+@@ -112,5 +101,17 @@ static const char rcsid[] = "$Id: res_se
+ #include <unistd.h>
+
++/* Rename the I/O functions in case we're tracing. */
++#define send trace_mr_send
++#define recvfrom trace_mr_recvfrom
++#define read trace_mr_read
++#define connect trace_mr_connect
++#define socket trace_mr_socket
++#define bind trace_mr_bind
++#define close trace_mr_close
++#define select trace_mr_select
++#define time trace_mr_time
++
+ #include "minires/minires.h"
++#include "omapip/trace_mr.h"
+ #include "arpa/nameser.h"
+
diff --git a/net/isc-dhcp/patches/patch-ad b/net/isc-dhcp/patches/patch-ad
new file mode 100644
index 00000000000..649e1f3c16b
--- /dev/null
+++ b/net/isc-dhcp/patches/patch-ad
@@ -0,0 +1,18 @@
+$NetBSD: patch-ad,v 1.1.1.1 2007/12/12 20:02:08 adrianp Exp $
+
+--- /dev/null 2007-11-18 12:32:58.000000000 +0000
++++ includes/omapip/trace_mr.h 2007-11-18 12:35:30.000000000 +0000
+@@ -0,0 +1,13 @@
++ssize_t trace_mr_send (int, const void *, size_t, int);
++ssize_t trace_mr_read_playback (struct sockaddr_in *, void *, size_t);
++void trace_mr_read_record (struct sockaddr_in *, void *, ssize_t);
++ssize_t trace_mr_recvfrom (int s, void *, size_t, int,
++ struct sockaddr *, SOCKLEN_T *);
++ssize_t trace_mr_read (int, void *, size_t);
++int trace_mr_connect (int s, struct sockaddr *, SOCKLEN_T);
++int trace_mr_socket (int, int, int);
++int trace_mr_bind (int, struct sockaddr *, SOCKLEN_T);
++int trace_mr_close (int);
++time_t trace_mr_time (time_t *);
++int trace_mr_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
++unsigned int trace_mr_res_randomid (unsigned int);