2
1

dropbear.mk 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #############################################################
  2. #
  3. # dropbear
  4. #
  5. #############################################################
  6. DROPBEAR_VERSION:=0.50
  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. $(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. $(CONFIG_UPDATE) $(DROPBEAR_DIR)
  21. touch $@
  22. $(DROPBEAR_DIR)/.configured: $(DROPBEAR_DIR)/.unpacked
  23. (cd $(DROPBEAR_DIR); rm -rf config.cache; \
  24. autoconf; \
  25. $(TARGET_CONFIGURE_OPTS) \
  26. $(TARGET_CONFIGURE_ARGS) \
  27. ./configure \
  28. --target=$(GNU_TARGET_NAME) \
  29. --host=$(GNU_TARGET_NAME) \
  30. --build=$(GNU_HOST_NAME) \
  31. --prefix=/usr \
  32. --sysconfdir=/etc \
  33. --localstatedir=/var \
  34. $(DISABLE_NLS) \
  35. --with-shared \
  36. )
  37. touch $@
  38. $(DROPBEAR_DIR)/$(DROPBEAR_BINARY): $(DROPBEAR_DIR)/.configured
  39. $(MAKE) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) \
  40. PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" \
  41. MULTI=1 SCPPROGRESS=1 -C $(DROPBEAR_DIR)
  42. $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY): $(DROPBEAR_DIR)/$(DROPBEAR_BINARY)
  43. $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/sbin
  44. $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/bin
  45. $(INSTALL) -m 755 $(DROPBEAR_DIR)/$(DROPBEAR_BINARY) \
  46. $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  47. $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  48. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/scp
  49. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/ssh
  50. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dbclient
  51. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearkey
  52. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearconvert
  53. mkdir -p $(TARGET_DIR)/etc/init.d
  54. cp -dpf $(DROPBEAR_DIR)/S50dropbear $(TARGET_DIR)/etc/init.d/
  55. chmod a+x $(TARGET_DIR)/etc/init.d/S50dropbear
  56. dropbear: uclibc zlib $(TARGET_DIR)/$(DROPBEAR_TARGET_BINARY)
  57. dropbear-clean:
  58. $(MAKE) DESTDIR=$(TARGET_DIR) $(TARGET_CONFIGURE_OPTS) \
  59. LD=$(TARGET_CC) -C $(DROPBEAR_DIR) uninstall
  60. -$(MAKE) -C $(DROPBEAR_DIR) clean
  61. dropbear-dirclean:
  62. rm -rf $(DROPBEAR_DIR)
  63. #############################################################
  64. #
  65. # Toplevel Makefile options
  66. #
  67. #############################################################
  68. ifeq ($(strip $(BR2_PACKAGE_DROPBEAR)),y)
  69. TARGETS+=dropbear
  70. endif