[packages] massive change: replace occurences of -I$(STAGING_DIR)/{include,usr/includ...
[openwrt/svn-archive/archive.git] / ipv6 / dhcp6 / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=dhcp6
11 PKG_VERSION:=1.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=dhcpv6-linux-$(PKG_VERSION).zip
15 PKG_SOURCE_URL:=@SF/dhcpv6-linux
16 PKG_MD5SUM:=86193dfa62137db3ea459543db4f1102
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_UNPACK:=unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/dhcp6/Default
24 SECTION:=ipv6
25 CATEGORY:=IPv6
26 DEPENDS:=+libncurses
27 TITLE:=IPv6 DHCP
28 URL:=http://sourceforge.net/projects/dhcpv6-linux
29 endef
30
31 define Package/dhcp6-client
32 $(call Package/dhcp6/Default)
33 TITLE+= client
34 endef
35
36 define Package/dhcp6-client/conffiles
37 /etc/dhcp6/solicit.conf
38 endef
39
40 define Package/dhcp6-server
41 $(call Package/dhcp6/Default)
42 TITLE+= server
43 endef
44
45 define Package/dhcp6-server/conffiles
46 /etc/dhcpd6/dhcpd6.conf
47 /etc/dhcpd6/leases6.conf
48 /etc/dhcpd6/partial_leases6.conf
49 endef
50
51 define Build/Prepare
52 $(call Build/Prepare/Default)
53 # prevent package from rebuilding
54 find $(PKG_BUILD_DIR) | xargs touch
55 endef
56
57 define Build/Compile
58 $(MAKE) -C $(PKG_BUILD_DIR)/client \
59 CC="$(TARGET_CC)" \
60 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
61 LDFLAGS="$(TARGET_LDFLAGS)"
62 $(MAKE) -C $(PKG_BUILD_DIR)/server \
63 CC="$(TARGET_CC)" \
64 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
65 LDFLAGS="$(TARGET_LDFLAGS)"
66 endef
67
68 define Package/dhcp6-client/install
69 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/dhcp6
70 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/cli $(1)/usr/sbin/dhcp6client
71 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/solicit.conf $(1)/etc/dhcp6/
72 endef
73
74 define Package/dhcp6-server/install
75 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/dhcpd6
76 $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/serv $(1)/usr/sbin/dhcpd6
77 $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/*.conf $(1)/etc/dhcpd6/
78 endef
79
80 $(eval $(call BuildPackage,dhcp6-client))
81 $(eval $(call BuildPackage,dhcp6-server))