resync gpsd with old trunk version
[openwrt/svn-archive/archive.git] / ipv6 / dhcp6 / Makefile
old mode 100755 (executable)
new mode 100644 (file)
index 05cf815..fc09e76
@@ -11,31 +11,36 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=dhcp6
 PKG_VERSION:=1.0
 PKG_RELEASE:=1
-PKG_MD5SUM:=86193dfa62137db3ea459543db4f1102
-PKG_SOURCE_URL:=@SF/dhcpv6-linux
+
 PKG_SOURCE:=dhcpv6-linux-$(PKG_VERSION).zip
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=@SF/dhcpv6-linux
+PKG_MD5SUM:=86193dfa62137db3ea459543db4f1102
 PKG_CAT:=unzip
 
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/dhcp6
+define Package/dhcp6/Default
   SECTION:=ipv6
   CATEGORY:=IPv6
   DEPENDS:=+libncurses
-  SUBMENU:=IPv6 DHCP server and client
-  TITLE:=IPv6 DHCP server and client
-  DESCRIPTION:=IPv6 DHCP server and client
+  TITLE:=IPv6 DHCP
   URL:=http://sourceforge.net/projects/dhcpv6-linux
 endef
 
+define Package/dhcp6-client
+  $(call Package/dhcp6/Default)
+  TITLE+= client
+endef
+
+define Package/dhcp6-client/conffiles
+/etc/dhcp6/solicit.conf
+endef
+
 define Package/dhcp6-server
-  $(call Package/dhcp6)
-  DEFAULT:=m if ALL
-  TITLE:=DHCPv6 server
-  DESCRIPTION:=DHCPv6 server
+  $(call Package/dhcp6/Default)
+  TITLE+= server
 endef
 
 define Package/dhcp6-server/conffiles
@@ -44,28 +49,21 @@ define Package/dhcp6-server/conffiles
 /etc/dhcpd6/partial_leases6.conf
 endef
 
-define Package/dhcp6-client
-  $(call Package/dhcp6)
-  DEFAULT:=m if ALL
-  TITLE:=DHCPv6 client
-  DESCRIPTION:=DHCPv6 client
-endef
-
-define Package/dhcp6-client/conffiles
-/etc/dhcp6/solicit.conf
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       # prevent package from rebuilding
+       find $(PKG_BUILD_DIR) | xargs touch
 endef
 
 define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR)/server \
-               CC="$(TARGET_CC)" STAGING_DIR=$(STAGING_DIR)
        $(MAKE) -C $(PKG_BUILD_DIR)/client \
-               CC="$(TARGET_CC)" STAGING_DIR=$(STAGING_DIR)
-endef
-
-define Package/dhcp6-server/install
-       install -d -m0755 $(1)/usr/sbin $(1)/etc/dhcpd6
-       install -m0755 $(PKG_BUILD_DIR)/server/serv $(1)/usr/sbin/dhcpd6
-       install -m0755 $(PKG_BUILD_DIR)/server/*.conf $(1)/etc/dhcpd6/
+               CC="$(TARGET_CC)" \
+               CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib"
+       $(MAKE) -C $(PKG_BUILD_DIR)/server \
+               CC="$(TARGET_CC)" \
+               CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib"
 endef
 
 define Package/dhcp6-client/install
@@ -74,5 +72,11 @@ define Package/dhcp6-client/install
        install -m0755 $(PKG_BUILD_DIR)/client/solicit.conf $(1)/etc/dhcp6/
 endef
 
-$(eval $(call BuildPackage,dhcp6-server))
+define Package/dhcp6-server/install
+       install -d -m0755 $(1)/usr/sbin $(1)/etc/dhcpd6
+       install -m0755 $(PKG_BUILD_DIR)/server/serv $(1)/usr/sbin/dhcpd6
+       install -m0755 $(PKG_BUILD_DIR)/server/*.conf $(1)/etc/dhcpd6/
+endef
+
 $(eval $(call BuildPackage,dhcp6-client))
+$(eval $(call BuildPackage,dhcp6-server))