+++ /dev/null
-#
-# Copyright (C) 2006-2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=dhcp
-PKG_VERSION:=3.1.0
-PKG_RELEASE:=5
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/
-PKG_MD5SUM:=27d179a3c3fbef576566b456a1168246
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/dhcp/Default
- SECTION:=net
- CATEGORY:=Network
- SUBMENU:=IP Addresses and Names
- TITLE:=ISC's DHCP
- URL:=https://www.isc.org/software/dhcp
-endef
-
-define Package/dhcp-relay
- $(call Package/dhcp/Default)
- TITLE+= relay
-endef
-
-define Package/dhcp-server
- $(call Package/dhcp/Default)
- TITLE+= server
-endef
-
-
-define Build/Configure
- # it's not GNU autoconf stuff
- (cd $(PKG_BUILD_DIR) ; \
- UNAME_S=Linux \
- UNAME_M=$(ARCH) \
- UNAME_R=2.6.23 \
- ./configure \
- --copts "$(TARGET_CFLAGS)" \
- );
-endef
-
-define Build/Compile
- UNAME_S=Linux \
- UNAME_M=$(ARCH) \
- UNAME_R=2.6.23 \
- $(MAKE) -C $(PKG_BUILD_DIR) \
- $(TARGET_CONFIGURE_OPTS) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- all install
-endef
-
-
-define Package/dhcp-relay/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcrelay $(1)/usr/sbin/
-endef
-
-define Package/dhcp-server/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_DIR) $(1)/usr/local/lib
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcpd $(1)/usr/sbin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/omshell $(1)/usr/bin/
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/dhcpd.init $(1)/etc/init.d/dhcpd
-endef
-
-$(eval $(call BuildPackage,dhcp-relay))
-$(eval $(call BuildPackage,dhcp-server))
+++ /dev/null
-#!/bin/sh /etc/rc.common
-START=60
-
-lease_file=/tmp/dhcpd.leases
-config_file=/etc/dhcpd.conf
-pid_file=/var/run/dhcpd.pid
-hosts_file=/tmp/dhcpd.hosts
-dhcp_ifs=""
-
-parse_dhcp() {
- local cfg="$1"
- config_get net "$cfg" interface
- [ -n "$net" ] || return 0
-
- config_get_bool ignore "$1" ignore 0
- if [ "$ignore" -eq 1 ]; then return 0; fi
-
- local dev
- network_get_device dev "$net" && append dhcp_ifs "$dev"
-}
-
-parse_host_entry() {
- local cfg="$1"
-
- config_get name "$cfg" name
-
- config_get ip "$cfg" ip
- [ -n "$ip" ] || return 0
-
- local i=0
- config_get mac "$cfg" mac
- for m in $mac; do
- local hostid="$name"
- if [ $i -ne 0 ]; then hostid="$name"_"$i"; fi
-
- echo "host $hostid {" >> "$hosts_file"
- echo "hardware ethernet $m;" >> "$hosts_file"
- echo "fixed-address $ip;" >> "$hosts_file"
- echo "}" >> $hosts_file
-
- i=$((i+1))
- done
-}
-
-init_config() {
- echo " #Automatically generated by dhcpd initscript, any modifications will be overwritten" > "$hosts_file"
-
- . /lib/functions/network.sh
-
- config_load dhcp
- config_foreach parse_host_entry host
- config_foreach parse_dhcp dhcp
-}
-
-start() {
- if [ -e $pid_file ] ; then
- echo " dhcpd already running with PID `cat $pid_file`"
- return 1
- fi
-
- echo Starting isc-dhcpd
-
- if [ ! -e $lease_file ]; then
- echo " Creating $lease_file"
- touch $lease_file
- fi
-
- /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file
-
- if [ $? -ne 0 ]; then
- echo " isc-dhcpd failed to start"
- fi
-}
-
-stop() {
- echo "Stopping isc-dhcpd"
- if [ -e $pid_file ]; then
- kill -KILL `cat $pid_file`
-
- if [ $? -ne 0 ]; then
- echo " PID " `cat $pid_file` not found
- echo " Is the DHCP server running?"
- fi
-
- rm -f $pid_file
- else
- echo " $pid_file not found"
- fi
-}
+++ /dev/null
-diff -urN dhcp-3.1.0.orig/client/Makefile.dist dhcp-3.1.0/client/Makefile.dist
---- dhcp-3.1.0.orig/client/Makefile.dist 2005-03-17 12:14:55.000000000 -0800
-+++ dhcp-3.1.0/client/Makefile.dist 2008-06-12 01:12:58.000000000 -0700
-@@ -35,7 +35,7 @@
- CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) \
- -DCLIENT_PATH=${CLIENT_PATH}
-
--all: $(PROG) $(CATMANPAGES)
-+all: $(PROG)
-
- install: all
- for dir in $(CLIENTBINDIR) $(ETC) $(FFMANDIR) $(ADMMANDIR) $(VARDB); \
-@@ -58,14 +58,6 @@
- $(DESTDIR)$(CLIENTBINDIR)/dhclient-script; \
- $(CHMOD) 700 $(DESTDIR)$(CLIENTBINDIR)/dhclient-script; \
- fi
-- $(MANINSTALL) $(MANFROM) dhclient.$(MANCAT)8 $(MANTO) \
-- $(DESTDIR)$(ADMMANDIR)/dhclient$(ADMMANEXT)
-- $(MANINSTALL) $(MANFROM) dhclient-script.$(MANCAT)8 $(MANTO) \
-- $(DESTDIR)$(ADMMANDIR)/dhclient-script$(ADMMANEXT)
-- $(MANINSTALL) $(MANFROM) dhclient.conf.$(MANCAT)5 $(MANTO) \
-- $(DESTDIR)$(FFMANDIR)/dhclient.conf$(FFMANEXT)
-- $(MANINSTALL) $(MANFROM) dhclient.leases.$(MANCAT)5 $(MANTO) \
-- $(DESTDIR)$(FFMANDIR)/dhclient.leases$(FFMANEXT)
-
- depend:
- $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRCS)
-diff -urN dhcp-3.1.0.orig/common/Makefile.dist dhcp-3.1.0/common/Makefile.dist
---- dhcp-3.1.0.orig/common/Makefile.dist 2005-03-17 12:14:56.000000000 -0800
-+++ dhcp-3.1.0/common/Makefile.dist 2008-06-12 01:12:58.000000000 -0700
-@@ -35,7 +35,7 @@
- INCLUDES = -I$(TOP) $(BINDINC) -I$(TOP)/includes
- CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
-
--all: libdhcp.a $(CATMANPAGES)
-+all: libdhcp.a
-
- libdhcp.a: $(OBJ)
- rm -f libdhcp.a
-@@ -53,10 +53,6 @@
- fi; \
- done; \
- done
-- $(MANINSTALL) $(MANFROM) dhcp-options.$(MANCAT)5 $(MANTO) \
-- $(DESTDIR)$(FFMANDIR)/dhcp-options$(FFMANEXT)
-- $(MANINSTALL) $(MANFROM) dhcp-eval.$(MANCAT)5 $(MANTO) \
-- $(DESTDIR)$(FFMANDIR)/dhcp-eval$(FFMANEXT)
-
- depend:
- $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRC)
-diff -urN dhcp-3.1.0.orig/dhcpctl/Makefile.dist dhcp-3.1.0/dhcpctl/Makefile.dist
---- dhcp-3.1.0.orig/dhcpctl/Makefile.dist 2005-03-17 12:15:02.000000000 -0800
-+++ dhcp-3.1.0/dhcpctl/Makefile.dist 2008-06-12 01:13:51.000000000 -0700
-@@ -34,7 +34,7 @@
- DHCPCTLLIBS = libdhcpctl.a ../common/libdhcp.a $(BINDLIB) \
- ../omapip/libomapi.a ../dst/libdst.a
-
--all: libdhcpctl.a omshell cltest $(CATMANPAGES)
-+all: libdhcpctl.a omshell cltest
-
- omshell: omshell.o $(DHCPCTLLIBS)
- $(CC) $(DEBUG) $(LFLAGS) -o omshell omshell.o $(DHCPCTLLIBS) $(LIBS)
-@@ -47,7 +47,7 @@
- ar cruv libdhcpctl.a $(OBJ)
- $(RANLIB) libdhcpctl.a
-
--install: all $(CATMANPAGES)
-+install: all
- for dir in $(LIBDIR) $(LIBMANDIR) $(INCDIR) $(USRMANDIR) \
- $(USERBINDIR); do \
- foo=""; \
-@@ -63,16 +63,8 @@
- $(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libdhcpctl.a
- $(INSTALL) dhcpctl.h $(DESTDIR)$(INCDIR)
- $(CHMOD) 644 $(DESTDIR)$(INCDIR)/dhcpctl.h
-- for man in $(MAN); do \
-- prefix=`echo $$man |sed -e 's/\.[0-9]$$//'`; \
-- suffix=`echo $$man |sed -e 's/.*\.\([0-9]\)$$/\1/'`; \
-- $(MANINSTALL) $(MANFROM) $${prefix}.$(MANCAT)$${suffix} $(MANTO) \
-- $(DESTDIR)$(LIBMANDIR)/$${prefix}$(LIBMANEXT); \
-- done
- $(INSTALL) omshell $(DESTDIR)$(USERBINDIR)
- $(CHMOD) 755 $(DESTDIR)$(USERBINDIR)/omshell
-- $(MANINSTALL) $(MANFROM) omshell.$(MANCAT)1 $(MANTO) \
-- $(DESTDIR)$(USRMANDIR)/omshell$(USRMANEXT)
-
- depend:
- $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRC)
-diff -urN dhcp-3.1.0.orig/omapip/Makefile.dist dhcp-3.1.0/omapip/Makefile.dist
---- dhcp-3.1.0.orig/omapip/Makefile.dist 2005-03-17 12:15:20.000000000 -0800
-+++ dhcp-3.1.0/omapip/Makefile.dist 2008-06-12 01:12:58.000000000 -0700
-@@ -40,7 +40,7 @@
- INCLUDES = $(BINDINC) -I$(TOP)/includes
- CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
-
--all: libomapi.a svtest $(CATMANPAGES)
-+all: libomapi.a svtest
-
- svtest: test.o libomapi.a $(BINDLIB) ../dst/libdst.a
- $(CC) $(DEBUG) $(LFLAGS) -o svtest test.o $(BINDLIB) \
-@@ -75,12 +75,6 @@
- $(DESTDIR)$(INCDIR)/isc-dhcp; \
- $(CHMOD) 644 $(DESTDIR)$(INCDIR)/isc-dhcp/$$file; \
- done
-- for man in $(MAN); do \
-- prefix=`echo $$man |sed -e 's/\.[0-9]$$//'`; \
-- suffix=`echo $$man |sed -e 's/.*\.\([0-9]\)$$/\1/'`; \
-- $(MANINSTALL) $(MANFROM) $${prefix}.$(MANCAT)$${suffix} $(MANTO) \
-- $(DESTDIR)$(LIBMANDIR)/$${prefix}$(LIBMANEXT); \
-- done
-
- depend:
- $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRC)
-diff -urN dhcp-3.1.0.orig/relay/Makefile.dist dhcp-3.1.0/relay/Makefile.dist
---- dhcp-3.1.0.orig/relay/Makefile.dist 2005-03-17 12:15:24.000000000 -0800
-+++ dhcp-3.1.0/relay/Makefile.dist 2008-06-12 01:12:58.000000000 -0700
-@@ -33,7 +33,7 @@
- DHCPLIB = ../common/libdhcp.a $(BINDLIB) ../omapip/libomapi.a ../dst/libdst.a
- CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
-
--all: $(PROG) $(CATMANPAGES)
-+all: $(PROG)
-
- install: all
- for dir in $(BINDIR) $(ADMMANDIR); do \
-@@ -48,8 +48,6 @@
- done
- $(INSTALL) dhcrelay $(DESTDIR)$(BINDIR)
- $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcrelay
-- $(MANINSTALL) $(MANFROM) dhcrelay.$(MANCAT)8 $(MANTO) \
-- $(DESTDIR)$(ADMMANDIR)/dhcrelay$(ADMMANEXT)
-
- depend:
- $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRCS)
-diff -urN dhcp-3.1.0.orig/server/Makefile.dist dhcp-3.1.0/server/Makefile.dist
---- dhcp-3.1.0.orig/server/Makefile.dist 2006-07-25 06:26:00.000000000 -0700
-+++ dhcp-3.1.0/server/Makefile.dist 2008-06-12 01:12:58.000000000 -0700
-@@ -35,7 +35,7 @@
- DHCPLIB = ../common/libdhcp.a $(BINDLIB) ../omapip/libomapi.a ../dst/libdst.a
- CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
-
--all: $(PROG) $(CATMANPAGES)
-+all: $(PROG)
-
- install: all
- for dir in $(BINDIR) $(ADMMANDIR) $(FFMANDIR) $(VARDB); do \
-@@ -50,12 +50,6 @@
- done
- $(INSTALL) dhcpd $(DESTDIR)$(BINDIR)
- $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcpd
-- $(MANINSTALL) $(MANFROM) dhcpd.$(MANCAT)8 $(MANTO) \
-- $(DESTDIR)$(ADMMANDIR)/dhcpd$(ADMMANEXT)
-- $(MANINSTALL) $(MANFROM) dhcpd.conf.$(MANCAT)5 $(MANTO) \
-- $(DESTDIR)$(FFMANDIR)/dhcpd.conf$(FFMANEXT)
-- $(MANINSTALL) $(MANFROM) dhcpd.leases.$(MANCAT)5 $(MANTO) \
-- $(DESTDIR)$(FFMANDIR)/dhcpd.leases$(FFMANEXT)
- $(TOUCH) $(DESTDIR)$(VARDB)/dhcpd.leases
- # Note file mode is hardcoded to mode 0664 in server/db.c (889).
- $(CHMOD) 664 $(DESTDIR)$(VARDB)/dhcpd.leases