Port dhcp6 to -ng, now builds two packages : dhcp6-server and dhcp6-client
[openwrt/svn-archive/archive.git] / net / dhcp6 / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=dhcp6
12 PKG_VERSION:=1.0
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=86193dfa62137db3ea459543db4f1102
15 PKG_SOURCE_URL:=@SF/dhcpv6-linux
16 PKG_SOURCE:=dhcpv6-linux-$(PKG_VERSION).zip
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18 PKG_CAT:=unzip
19
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/dhcp6
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:=+libncurses
28 SUBMENU:=IPv6 DHCP server and client
29 TITLE:=IPv6 DHCP server and client
30 DESCRIPTION:=IPv6 DHCP server and client
31 URL:=http://sourceforge.net/projects/dhcpv6-linux
32 endef
33
34 define Package/dhcp6-server
35 $(call Package/dhcp6)
36 DEFAULT:=m if ALL
37 TITLE:=DHCPv6 server
38 DESCRIPTION:=DHCPv6 server
39 endef
40
41 define Package/dhcp6-server/conffiles
42 /etc/dhcpd6/dhcpd6.conf
43 /etc/dhcpd6/leases6.conf
44 /etc/dhcpd6/partial_leases6.conf
45 endef
46
47 define Package/dhcp6-client
48 $(call Package/dhcp6)
49 DEFAULT:=m if ALL
50 TITLE:=DHCPv6 client
51 DESCRIPTION:=DHCPv6 client
52 endef
53
54 define Package/dhcp6-client/conffiles
55 /etc/dhcp6/solicit.conf
56 endef
57
58
59 define Build/Compile
60 $(MAKE) -C $(PKG_BUILD_DIR)/server \
61 CC=$(TARGET_CC) STAGING_DIR=$(STAGING_DIR)
62 $(MAKE) -C $(PKG_BUILD_DIR)/client \
63 CC=$(TARGET_CC) STAGING_DIR=$(STAGING_DIR)
64 endef
65
66 define Package/dhcp6-server/install
67 install -d -m0755 $(1)/usr/sbin $(1)/etc/dhcpd6
68 install -m0755 $(PKG_BUILD_DIR)/server/serv $(1)/usr/sbin/dhcpd6
69 install -m0755 $(PKG_BUILD_DIR)/server/*.conf $(1)/etc/dhcpd6/
70 endef
71
72 define Package/dhcp6-client/install
73 install -d $(1)/usr/sbin $(1)/etc/dhcp6
74 install -m0755 $(PKG_BUILD_DIR)/client/cli $(1)/usr/sbin/dhcp6client
75 install -m0755 $(PKG_BUILD_DIR)/client/solicit.conf $(1)/etc/dhcp6/
76 endef
77
78 $(eval $(call BuildPackage,dhcp6-server))
79 $(eval $(call BuildPackage,dhcp6-client))