-$(PACKAGE_DIR)/$(DROPBEAR_IPK): $(DROPBEAR_DIR)/$(DROPBEAR_BINARY)
- $(SCRIPT_DIR)/make-ipkg-dir.sh $(DROPBEAR_IPK_DIR) dropbear.control $(DROPBEAR_VERSION)-1 $(ARCH)
- mkdir -p $(DROPBEAR_IPK_DIR)/usr/bin
- mkdir -p $(DROPBEAR_IPK_DIR)/usr/sbin
- install -m 755 $(DROPBEAR_DIR)/$(DROPBEAR_BINARY) \
- $(DROPBEAR_IPK_DIR)/$(DROPBEAR_TARGET_BINARY)
- $(STRIP) $(DROPBEAR_IPK_DIR)/usr/sbin/dropbear
- ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/scp
- ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/ssh
- ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/dropbearkey
- ln -sf ../sbin/dropbear $(DROPBEAR_IPK_DIR)/usr/bin/dropbearconvert
- mkdir -p $(DROPBEAR_IPK_DIR)/etc/init.d
- cp ./files/S50dropbear $(DROPBEAR_IPK_DIR)/etc/init.d/
- chmod a+x $(DROPBEAR_IPK_DIR)/etc/init.d/S50dropbear
- $(IPKG_BUILD) $(DROPBEAR_IPK_DIR) $(PACKAGE_DIR)
+define Build/Configure
+ $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(PKG_BUILD_DIR)/options.h
+ $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(PKG_BUILD_DIR)/options.h
+ $(call Build/Configure/Default)
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ $(TARGET_CONFIGURE_OPTS) \
+ LD="$(TARGET_CC)" \
+ PROGRAMS="dropbear dbclient dropbearkey scp" \
+ MULTI=1 SCPPROGRESS=1
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ $(TARGET_CONFIGURE_OPTS) \
+ LD="$(TARGET_CC)" \
+ PROGRAMS="dropbearconvert"
+endef
+
+define Package/dropbear/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti \
+ $(1)/usr/sbin/dropbear
+ $(INSTALL_DIR) $(1)/usr/bin
+ ln -sf ../sbin/dropbear $(1)/usr/bin/scp
+ ln -sf ../sbin/dropbear $(1)/usr/bin/ssh
+ ln -sf ../sbin/dropbear $(1)/usr/bin/dbclient
+ ln -sf ../sbin/dropbear $(1)/usr/bin/dropbearkey
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/dropbear.config $(1)/etc/config/dropbear
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
+endef