aboutsummaryrefslogtreecommitdiff
path: root/package/dhcp/dhcp.mk
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-07-16 11:18:07 +0200
committerGravatar Peter Korsgaard <jacmet@sunsite.dk>2010-07-17 00:08:25 +0200
commit5061e1c2047d2fbcd35bcc0b065b420172dcc43a (patch)
tree0963c298176ec06be7a67e682d1fdc3f7f16192b /package/dhcp/dhcp.mk
parent1eb59f598f52b65b3d3adfcf74729091e95015f0 (diff)
downloadbuildroot-5061e1c2047d2fbcd35bcc0b065b420172dcc43a.tar.gz
buildroot-5061e1c2047d2fbcd35bcc0b065b420172dcc43a.tar.bz2
dhcp: Bump to 4.1.1-P1 and convert to autotools
dhcp 3.0.5 was causing build issues due to its build system not based on the autotools. Instead of work-arounding dhcp 3.0.5 issues, this commit bumps to 4.1.1 which uses the autotools as the build system. The package is therefore converted to the autotools infrastructure. The dhcp_xecute patch is no longer needed, this feature seems to have been merged into the upstream dhcp (according to the manpage). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/dhcp/dhcp.mk')
-rw-r--r--package/dhcp/dhcp.mk126
1 files changed, 37 insertions, 89 deletions
diff --git a/package/dhcp/dhcp.mk b/package/dhcp/dhcp.mk
index 57e0a5dcd8..bf3f775bd1 100644
--- a/package/dhcp/dhcp.mk
+++ b/package/dhcp/dhcp.mk
@@ -3,108 +3,56 @@
# dhcp
#
#############################################################
-DHCP_VERSION:=3.0.5
-DHCP_SOURCE:=dhcp-$(DHCP_VERSION).tar.gz
-DHCP_SITE:=ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history
-DHCP_CAT:=$(ZCAT)
-DHCP_DIR:=$(BUILD_DIR)/dhcp-$(DHCP_VERSION)
-DHCP_SERVER_BINARY:=work.linux-2.2/server/dhcpd
-DHCP_RELAY_BINARY:=work.linux-2.2/relay/dhcrelay
-DHCP_CLIENT_BINARY:=work.linux-2.2/client/dhclient
-DHCP_SERVER_TARGET_BINARY:=usr/sbin/dhcpd
-DHCP_RELAY_TARGET_BINARY:=usr/sbin/dhcrelay
-DHCP_CLIENT_TARGET_BINARY:=usr/sbin/dhclient
-BVARS=PREDEFINES='-D_PATH_DHCPD_DB=\"/var/lib/dhcp/dhcpd.leases\" \
- -D_PATH_DHCLIENT_DB=\"/var/lib/dhcp/dhclient.leases\"' \
- VARDB=/var/lib/dhcp
+DHCP_VERSION = 4.1.1-P1
+DHCP_SOURCE = dhcp-$(DHCP_VERSION).tar.gz
+DHCP_SITE = http://ftp.isc.org/isc/dhcp/
+DHCP_CONF_ENV = ac_cv_file__dev_random=yes
+DHCP_CONF_OPT = \
+ --localstatedir=/var/lib/dhcp \
+ --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
+ --with-cli-lease-file=/var/lib/dhcp/dhclient.leases \
+ --with-srv-pid-file=/var/run/dhcpd.pid \
+ --with-cli-pid-file=/var/run/dhclient.pid \
+ --with-relay-pid-file=/var/run/dhcrelay.pid \
+ --disable-dhcpv6
-$(DL_DIR)/$(DHCP_SOURCE):
- $(call DOWNLOAD,$(DHCP_SITE),$(DHCP_SOURCE))
-
-dhcp-source: $(DL_DIR)/$(DHCP_SOURCE)
-
-dhcp_server-source: dhcp-source
-dhcp_relay-source: dhcp-source
-dhcp_client-source: dhcp-source
-
-$(DHCP_DIR)/.unpacked: $(DL_DIR)/$(DHCP_SOURCE)
- $(DHCP_CAT) $(DL_DIR)/$(DHCP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- toolchain/patch-kernel.sh $(DHCP_DIR) package/dhcp/ dhcp\*.patch
- touch $@
-
-$(DHCP_DIR)/.configured: $(DHCP_DIR)/.unpacked
- (cd $(DHCP_DIR); \
- $(TARGET_CONFIGURE_OPTS) \
- $(TARGET_CONFIGURE_ARGS) \
- ./configure; \
- )
- touch $@
-
-$(DHCP_DIR)/$(DHCP_RELAY_BINARY): $(DHCP_DIR)/.configured
- $(MAKE) $(TARGET_CONFIGURE_OPTS) $(BVARS) -C $(DHCP_DIR)
- $(STRIPCMD) $(DHCP_DIR)/$(DHCP_RELAY_BINARY)
-
-$(TARGET_DIR)/$(DHCP_SERVER_TARGET_BINARY): $(DHCP_DIR)/$(DHCP_RELAY_BINARY)
+ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
+define DHCP_INSTALL_SERVER
mkdir -p $(TARGET_DIR)/var/lib
- (cd $(TARGET_DIR)/var/lib; \
- ln -snf /tmp dhcp; \
- )
- $(INSTALL) -m 0755 -D $(DHCP_DIR)/$(DHCP_SERVER_BINARY) \
- $(TARGET_DIR)/$(DHCP_SERVER_TARGET_BINARY)
- mkdir -p $(TARGET_DIR)/etc/init.d
- $(INSTALL) -m 0755 -D package/dhcp/S80dhcp-server \
- $(TARGET_DIR)/etc/init.d
+ (cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
+ $(INSTALL) -m 0755 -D $(@D)/server/dhcpd $(TARGET_DIR)/usr/sbin/dhcpd
+ $(INSTALL) -m 0755 -D package/dhcp/S80dhcp-server $(TARGET_DIR)/etc/init.d
mkdir -p $(TARGET_DIR)/etc/dhcp
- $(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf \
- $(TARGET_DIR)/etc/dhcp/dhcpd.conf
- rm -rf $(TARGET_DIR)/share/locale
+ $(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf $(TARGET_DIR)/etc/dhcp/dhcpd.conf
+endef
+endif
-$(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY): $(DHCP_DIR)/$(DHCP_RELAY_BINARY)
+ifeq ($(BR2_PACKAGE_DHCP_RELAY),y)
+define DHCP_INSTALL_RELAY
mkdir -p $(TARGET_DIR)/var/lib
(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
- $(INSTALL) -m 0755 -D $(DHCP_DIR)/$(DHCP_RELAY_BINARY) \
- $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY)
- mkdir -p $(TARGET_DIR)/etc/init.d
- $(INSTALL) -m 0755 -D package/dhcp/S80dhcp-relay \
- $(TARGET_DIR)/etc/init.d
+ $(INSTALL) -m 0755 -D $(DHCP_DIR)/relay/dhcrelay $(TARGET_DIR)/usr/sbin/
+ $(INSTALL) -m 0755 -D package/dhcp/S80dhcp-relay $(TARGET_DIR)/etc/init.d
+endef
+endif
-$(TARGET_DIR)/$(DHCP_CLIENT_TARGET_BINARY): $(DHCP_DIR)/$(DHCP_RELAY_BINARY)
+ifeq ($(BR2_PACKAGE_DHCP_CLIENT),y)
+define DHCP_INSTALL_CLIENT
mkdir -p $(TARGET_DIR)/var/lib
(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
- $(INSTALL) -m 0755 -D $(DHCP_DIR)/$(DHCP_CLIENT_BINARY) \
- $(TARGET_DIR)/$(DHCP_CLIENT_TARGET_BINARY)
+ $(INSTALL) -m 0755 -D $(DHCP_DIR)/client/dhclient $(TARGET_DIR)/usr/sbin
mkdir -p $(TARGET_DIR)/etc/dhcp
$(INSTALL) -m 0644 -D package/dhcp/dhclient.conf \
$(TARGET_DIR)/etc/dhcp/dhclient.conf
$(INSTALL) -m 0755 -D package/dhcp/dhclient-script \
$(TARGET_DIR)/sbin/dhclient-script
+endef
+endif
-dhcp_server: $(TARGET_DIR)/$(DHCP_SERVER_TARGET_BINARY)
-
-dhcp_relay: $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY)
-
-dhcp_client: $(TARGET_DIR)/$(DHCP_CLIENT_TARGET_BINARY)
-
-dhcp-clean:
- -$(MAKE) -C $(DHCP_DIR) clean
-
-dhcp-dirclean:
- rm -rf $(DHCP_DIR)
+define DHCP_INSTALL_TARGET_CMDS
+ $(DHCP_INSTALL_RELAY)
+ $(DHCP_INSTALL_SERVER)
+ $(DHCP_INSTALL_CLIENT)
+endef
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-#ifeq ($(BR2_PACKAGE_ISC_DHCP),y)
-#TARGETS+=dhcp
-#endif
-ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
-TARGETS+=dhcp_server
-endif
-ifeq ($(BR2_PACKAGE_DHCP_RELAY),y)
-TARGETS+=dhcp_relay
-endif
-ifeq ($(BR2_PACKAGE_DHCP_CLIENT),y)
-TARGETS+=dhcp_client
-endif
+$(eval $(call AUTOTARGETS,package,dhcp))