dropbear.mk 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #############################################################
  2. #
  3. # dropbear
  4. #
  5. #############################################################
  6. DROPBEAR_VER:=0.48.1
  7. DROPBEAR_SOURCE:=dropbear-$(DROPBEAR_VER).tar.gz
  8. DROPBEAR_SITE:=http://matt.ucc.asn.au/dropbear/releases/
  9. DROPBEAR_DIR:=$(BUILD_DIR)/dropbear-$(DROPBEAR_VER)
  10. DROPBEAR_CAT:=zcat
  11. DROPBEAR_BINARY:=dropbearmulti
  12. DROPBEAR_TARGET_BINARY:=usr/sbin/dropbear
  13. $(DL_DIR)/$(DROPBEAR_SOURCE):
  14. $(WGET) -P $(DL_DIR) $(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. touch $(DROPBEAR_DIR)/.unpacked
  21. $(DROPBEAR_DIR)/.configured: $(DROPBEAR_DIR)/.unpacked
  22. (cd $(DROPBEAR_DIR); rm -rf config.cache; \
  23. autoconf; \
  24. $(TARGET_CONFIGURE_OPTS) \
  25. CFLAGS="$(TARGET_CFLAGS)" \
  26. ./configure \
  27. --target=$(GNU_TARGET_NAME) \
  28. --host=$(GNU_TARGET_NAME) \
  29. --build=$(GNU_HOST_NAME) \
  30. --prefix=/usr \
  31. --exec-prefix=/usr \
  32. --bindir=/usr/bin \
  33. --sbindir=/usr/sbin \
  34. --libexecdir=/usr/lib \
  35. --sysconfdir=/etc \
  36. --datadir=/usr/share \
  37. --localstatedir=/var \
  38. --mandir=/usr/man \
  39. --infodir=/usr/info \
  40. $(DISABLE_NLS) \
  41. --with-shared \
  42. );
  43. ifeq ($(strip $(BR2_PACKAGE_DROPBEAR_URANDOM)),y)
  44. $(SED) 's,^#define DROPBEAR_RANDOM_DEV.*,#define DROPBEAR_RANDOM_DEV \"/dev/urandom\",' \
  45. $(DROPBEAR_DIR)/options.h
  46. endif
  47. touch $(DROPBEAR_DIR)/.configured
  48. $(DROPBEAR_DIR)/$(DROPBEAR_BINARY): $(DROPBEAR_DIR)/.configured
  49. $(MAKE) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) \
  50. PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" \
  51. MULTI=1 SCPPROGRESS=1 -C $(DROPBEAR_DIR)
  52. $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY): $(DROPBEAR_DIR)/$(DROPBEAR_BINARY)
  53. #$(MAKE) DESTDIR=$(TARGET_DIR) $(TARGET_CONFIGURE_OPTS) \
  54. # LD=$(TARGET_CC) -C $(DROPBEAR_DIR) install
  55. #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
  56. # $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
  57. install -d -m 755 $(TARGET_DIR)/usr/sbin
  58. install -d -m 755 $(TARGET_DIR)/usr/bin
  59. install -m 755 $(DROPBEAR_DIR)/$(DROPBEAR_BINARY) \
  60. $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  61. $(STRIP) $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  62. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/scp
  63. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/ssh
  64. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dbclient
  65. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearkey
  66. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearconvert
  67. cp $(DROPBEAR_DIR)/S50dropbear $(TARGET_DIR)/etc/init.d/
  68. chmod a+x $(TARGET_DIR)/etc/init.d/S50dropbear
  69. dropbear: uclibc zlib $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  70. dropbear-clean:
  71. $(MAKE) DESTDIR=$(TARGET_DIR) $(TARGET_CONFIGURE_OPTS) \
  72. LD=$(TARGET_CC) -C $(DROPBEAR_DIR) uninstall
  73. -$(MAKE) -C $(DROPBEAR_DIR) clean
  74. dropbear-dirclean:
  75. rm -rf $(DROPBEAR_DIR)
  76. #############################################################
  77. #
  78. # Toplevel Makefile options
  79. #
  80. #############################################################
  81. ifeq ($(strip $(BR2_PACKAGE_DROPBEAR)),y)
  82. TARGETS+=dropbear
  83. endif