dropbear.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #############################################################
  2. #
  3. # dropbear
  4. #
  5. #############################################################
  6. DROPBEAR_VERSION = 2012.55
  7. DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
  8. DROPBEAR_TARGET_BINS = dbclient dropbearkey dropbearconvert scp ssh
  9. DROPBEAR_MAKE = $(MAKE) MULTI=1 SCPPROGRESS=1 \
  10. PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
  11. ifeq ($(BR2_PREFER_STATIC_LIB),y)
  12. DROPBEAR_MAKE += STATIC=1
  13. endif
  14. define DROPBEAR_FIX_XAUTH
  15. $(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(@D)/options.h
  16. endef
  17. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_FIX_XAUTH
  18. define DROPBEAR_DISABLE_REVERSE_DNS
  19. $(SED) 's,^#define DO_HOST_LOOKUP.*,/* #define DO_HOST_LOOKUP */,' $(@D)/options.h
  20. endef
  21. define DROPBEAR_BUILD_SMALL
  22. echo "#define DROPBEAR_SMALL_CODE" >>$(@D)/options.h
  23. echo "#define NO_FAST_EXPTMOD" >>$(@D)/options.h
  24. endef
  25. define DROPBEAR_BUILD_FEATURED
  26. echo "#define DROPBEAR_BLOWFISH" >>$(@D)/options.h
  27. endef
  28. ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),y)
  29. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_REVERSE_DNS
  30. endif
  31. ifeq ($(BR2_PACKAGE_DROPBEAR_SMALL),y)
  32. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_BUILD_SMALL
  33. DROPBEAR_CONF_OPT += --disable-zlib
  34. else
  35. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_BUILD_FEATURED
  36. DROPBEAR_DEPENDENCIES += zlib
  37. endif
  38. ifneq ($(BR2_PACKAGE_DROPBEAR_WTMP),y)
  39. DROPBEAR_CONF_OPT += --disable-wtmp
  40. endif
  41. ifneq ($(BR2_PACKAGE_DROPBEAR_LASTLOG),y)
  42. DROPBEAR_CONF_OPT += --disable-lastlog
  43. endif
  44. define DROPBEAR_INSTALL_TARGET_CMDS
  45. $(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear
  46. for f in $(DROPBEAR_TARGET_BINS); do \
  47. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
  48. done
  49. if [ ! -f $(TARGET_DIR)/etc/init.d/S50dropbear ]; then \
  50. $(INSTALL) -m 0755 -D package/dropbear/S50dropbear $(TARGET_DIR)/etc/init.d/S50dropbear; \
  51. fi
  52. endef
  53. define DROPBEAR_UNINSTALL_TARGET_CMDS
  54. rm -f $(TARGET_DIR)/usr/sbin/dropbear
  55. rm -f $(addprefix $(TARGET_DIR)/usr/bin/, $(DROPBEAR_TARGET_BINS))
  56. rm -f $(TARGET_DIR)/etc/init.d/S50dropbear
  57. endef
  58. $(eval $(call AUTOTARGETS))