dropbear.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ################################################################################
  2. #
  3. # dropbear
  4. #
  5. ################################################################################
  6. DROPBEAR_VERSION = 2015.67
  7. DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
  8. DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
  9. DROPBEAR_LICENSE = MIT, BSD-2c-like, BSD-2c
  10. DROPBEAR_LICENSE_FILES = LICENSE
  11. DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert scp
  12. DROPBEAR_PROGRAMS = dropbear $(DROPBEAR_TARGET_BINS)
  13. ifeq ($(BR2_PACKAGE_DROPBEAR_CLIENT),y)
  14. # Build dbclient, and create a convenience symlink named ssh
  15. DROPBEAR_PROGRAMS += dbclient
  16. DROPBEAR_TARGET_BINS += dbclient ssh
  17. endif
  18. DROPBEAR_MAKE = \
  19. $(MAKE) MULTI=1 SCPPROGRESS=1 \
  20. PROGRAMS="$(DROPBEAR_PROGRAMS)"
  21. ifeq ($(BR2_STATIC_LIBS),y)
  22. DROPBEAR_MAKE += STATIC=1
  23. endif
  24. define DROPBEAR_FIX_XAUTH
  25. $(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(@D)/options.h
  26. endef
  27. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_FIX_XAUTH
  28. define DROPBEAR_ENABLE_REVERSE_DNS
  29. $(SED) 's:.*\(#define DO_HOST_LOOKUP\).*:\1:' $(@D)/options.h
  30. endef
  31. define DROPBEAR_BUILD_SMALL
  32. $(SED) 's:.*\(#define NO_FAST_EXPTMOD\).*:\1:' $(@D)/options.h
  33. endef
  34. define DROPBEAR_BUILD_FEATURED
  35. $(SED) 's:^#define DROPBEAR_SMALL_CODE::' $(@D)/options.h
  36. $(SED) 's:.*\(#define DROPBEAR_BLOWFISH\).*:\1:' $(@D)/options.h
  37. $(SED) 's:.*\(#define DROPBEAR_TWOFISH128\).*:\1:' $(@D)/options.h
  38. $(SED) 's:.*\(#define DROPBEAR_TWOFISH256\).*:\1:' $(@D)/options.h
  39. endef
  40. define DROPBEAR_DISABLE_STANDALONE
  41. $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
  42. endef
  43. define DROPBEAR_INSTALL_INIT_SYSTEMD
  44. $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
  45. $(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
  46. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  47. ln -fs ../../../../usr/lib/systemd/system/dropbear.service \
  48. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dropbear.service
  49. endef
  50. ifeq ($(BR2_USE_MMU),y)
  51. define DROPBEAR_INSTALL_INIT_SYSV
  52. $(INSTALL) -D -m 755 package/dropbear/S50dropbear \
  53. $(TARGET_DIR)/etc/init.d/S50dropbear
  54. endef
  55. else
  56. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_STANDALONE
  57. endif
  58. ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),)
  59. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ENABLE_REVERSE_DNS
  60. endif
  61. ifeq ($(BR2_PACKAGE_DROPBEAR_SMALL),y)
  62. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_BUILD_SMALL
  63. DROPBEAR_CONF_OPTS += --disable-zlib
  64. else
  65. DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_BUILD_FEATURED
  66. DROPBEAR_DEPENDENCIES += zlib
  67. endif
  68. ifneq ($(BR2_PACKAGE_DROPBEAR_WTMP),y)
  69. DROPBEAR_CONF_OPTS += --disable-wtmp
  70. endif
  71. ifneq ($(BR2_PACKAGE_DROPBEAR_LASTLOG),y)
  72. DROPBEAR_CONF_OPTS += --disable-lastlog
  73. endif
  74. define DROPBEAR_INSTALL_TARGET_CMDS
  75. $(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear
  76. for f in $(DROPBEAR_TARGET_BINS); do \
  77. ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
  78. done
  79. ln -snf ../var/run/dropbear $(TARGET_DIR)/etc/dropbear
  80. endef
  81. $(eval $(autotools-package))