2
1

dropbear.mk 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #############################################################
  2. #
  3. # dropbear
  4. #
  5. #############################################################
  6. DROPBEAR_VERSION:=0.52
  7. DROPBEAR_SOURCE:=dropbear-$(DROPBEAR_VERSION).tar.gz
  8. DROPBEAR_SITE:=http://matt.ucc.asn.au/dropbear/releases/
  9. DROPBEAR_DIR:=$(BUILD_DIR)/dropbear-$(DROPBEAR_VERSION)
  10. DROPBEAR_CAT:=$(ZCAT)
  11. DROPBEAR_BINARY:=dropbearmulti
  12. DROPBEAR_TARGET_BINARY:=usr/sbin/dropbear
  13. $(DL_DIR)/$(DROPBEAR_SOURCE):
  14. $(call DOWNLOAD,$(DROPBEAR_SITE),$(DROPBEAR_SOURCE))
  15. dropbear-source: $(DL_DIR)/$(DROPBEAR_SOURCE)
  16. $(DROPBEAR_DIR)/.unpacked: $(DL_DIR)/$(DROPBEAR_SOURCE)
  17. $(DROPBEAR_CAT) $(DL_DIR)/$(DROPBEAR_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  18. toolchain/patch-kernel.sh $(DROPBEAR_DIR) package/dropbear/ dropbear\*.patch
  19. $(SED) 's,^/\* #define DROPBEAR_MULTI.*,#define DROPBEAR_MULTI,g' $(DROPBEAR_DIR)/options.h
  20. $(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(DROPBEAR_DIR)/options.h
  21. $(CONFIG_UPDATE) $(DROPBEAR_DIR)
  22. touch $@
  23. $(DROPBEAR_DIR)/.configured: $(DROPBEAR_DIR)/.unpacked
  24. (cd $(DROPBEAR_DIR); rm -rf config.cache; \
  25. autoconf; \
  26. $(TARGET_CONFIGURE_OPTS) \
  27. $(TARGET_CONFIGURE_ARGS) \
  28. ./configure \
  29. --target=$(GNU_TARGET_NAME) \
  30. --host=$(GNU_TARGET_NAME) \
  31. --build=$(GNU_HOST_NAME) \
  32. --prefix=/usr \
  33. --sysconfdir=/etc \
  34. --localstatedir=/var \
  35. $(DISABLE_NLS) \
  36. --with-shared \
  37. )
  38. touch $@
  39. $(DROPBEAR_DIR)/$(DROPBEAR_BINARY): $(DROPBEAR_DIR)/.configured
  40. $(TARGET_CONFIGURE_OPTS) $(MAKE) LD=$(TARGET_CC) \
  41. PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" \
  42. MULTI=1 SCPPROGRESS=1 -C $(DROPBEAR_DIR)
  43. $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY): $(DROPBEAR_DIR)/$(DROPBEAR_BINARY)
  44. $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/sbin
  45. $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/bin
  46. $(INSTALL) -m 755 $(DROPBEAR_DIR)/$(DROPBEAR_BINARY) \
  47. $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  48. $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  49. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/scp
  50. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/ssh
  51. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dbclient
  52. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearkey
  53. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearconvert
  54. mkdir -p $(TARGET_DIR)/etc/init.d
  55. $(INSTALL) -m 755 package/dropbear/S50dropbear $(TARGET_DIR)/etc/init.d/S50dropbear
  56. dropbear: uclibc zlib $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  57. dropbear-clean:
  58. -$(MAKE) -C $(DROPBEAR_DIR) clean
  59. rm -f $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  60. rm -f $(TARGET_DIR)/usr/bin/{scp,ssh,dbclient,dropbearkey,dropbearconvert}
  61. rm -f $(TARGET_DIR)/etc/init.d/S50dropbear
  62. dropbear-dirclean:
  63. rm -rf $(DROPBEAR_DIR)
  64. #############################################################
  65. #
  66. # Toplevel Makefile options
  67. #
  68. #############################################################
  69. ifeq ($(BR2_PACKAGE_DROPBEAR),y)
  70. TARGETS+=dropbear
  71. endif