summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-02-03 12:29:48 +0000
committerEric Andersen <andersen@codepoet.org>2003-02-03 12:29:48 +0000
commitfa7f8b8ecaaf78f32ef6417a58530c421b4f99f4 (patch)
treee0de1b83e09565592f998faf4ea238780676909a /make
parent45923fa7d3fd8f2b1e0443144de7dd2c1b6d553d (diff)
downloadbuildroot-novena-fa7f8b8ecaaf78f32ef6417a58530c421b4f99f4.tar.gz
buildroot-novena-fa7f8b8ecaaf78f32ef6417a58530c421b4f99f4.zip
Add dhcp relay daemon
Diffstat (limited to 'make')
-rw-r--r--make/dhcp_relay.mk50
1 files changed, 50 insertions, 0 deletions
diff --git a/make/dhcp_relay.mk b/make/dhcp_relay.mk
new file mode 100644
index 000000000..228fde323
--- /dev/null
+++ b/make/dhcp_relay.mk
@@ -0,0 +1,50 @@
+#############################################################
+#
+# dhcp_relay
+#
+#############################################################
+DHCP_RELAY_SOURCE:=dhcp-2.0pl5.tar.gz
+DHCP_RELAY_SITE:=ftp://ftp.isc.org/isc/dhcp
+DHCP_RELAY_CAT:=zcat
+DHCP_RELAY_DIR:=$(BUILD_DIR)/dhcp-2.0pl5
+DHCP_RELAY_BINARY:=relay/dhcrelay
+DHCP_RELAY_TARGET_BINARY:=usr/sbin/dhcrelay
+BVARS=PREDEFINES='-D_PATH_DHCPD_DB=\"/var/lib/dhcp/dhcpd.leases\" \
+ -D_PATH_DHCLIENT_DB=\"/var/lib/dhcp/dhclient.leases\"' \
+ VARDB=/var/lib/dhcp
+
+$(DL_DIR)/$(DHCP_RELAY_SOURCE):
+ $(WGET) -P $(DL_DIR) $(DHCP_RELAY_SITE)/$(DHCP_RELAY_SOURCE)
+
+dhcp_relay-source: $(DL_DIR)/$(DHCP_RELAY_SOURCE)
+
+$(DHCP_RELAY_DIR)/.unpacked: $(DL_DIR)/$(DHCP_RELAY_SOURCE)
+ $(DHCP_RELAY_CAT) $(DL_DIR)/$(DHCP_RELAY_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ touch $(DHCP_RELAY_DIR)/.unpacked
+
+$(DHCP_RELAY_DIR)/.configured: $(DHCP_RELAY_DIR)/.unpacked
+ (cd $(DHCP_RELAY_DIR); PATH=$(STAGING_DIR)/bin:$$PATH \
+ CC=$(TARGET_CC) \
+ ./configure \
+ );
+ touch $(DHCP_RELAY_DIR)/.configured
+
+$(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY): $(DHCP_RELAY_DIR)/.configured
+ $(MAKE) CC=$(TARGET_CC) $(BVARS) -C $(DHCP_RELAY_DIR)
+ $(STRIP) $(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY)
+
+$(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY): $(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY)
+ (cd $(TARGET_DIR)/var/lib; ln -sf /tmp dhcp)
+ cp -a $(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY) $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY)
+ rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
+ $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
+
+dhcp_relay: uclibc $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY)
+
+dhcp_relay-clean:
+ $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(DHCP_RELAY_DIR) uninstall
+ -$(MAKE) -C $(DHCP_RELAY_DIR) clean
+
+dhcp_relay-dirclean:
+ rm -rf $(DHCP_RELAY_DIR)
+