Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=dropbear
  9. PKG_VERSION:=2014.63
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:= \
  13. http://matt.ucc.asn.au/dropbear/releases/ \
  14. https://dropbear.nl/mirror/releases/
  15. PKG_MD5SUM:=7066bb9a2da708f3ed06314fdc9c47fd
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_CONFIG_DEPENDS:=CONFIG_DROPBEAR_ECC
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/dropbear/Default
  22. URL:=http://matt.ucc.asn.au/dropbear/
  23. endef
  24. define Package/dropbear/config
  25. source "$(SOURCE)/Config.in"
  26. endef
  27. define Package/dropbear
  28. $(call Package/dropbear/Default)
  29. SECTION:=net
  30. CATEGORY:=Base system
  31. TITLE:=Small SSH2 client/server
  32. endef
  33. define Package/dropbear/description
  34. A small SSH2 server/client designed for small memory environments.
  35. endef
  36. define Package/dropbear/conffiles
  37. /etc/dropbear/dropbear_rsa_host_key
  38. /etc/dropbear/dropbear_dss_host_key
  39. /etc/config/dropbear
  40. endef
  41. define Package/dropbearconvert
  42. $(call Package/dropbear/Default)
  43. SECTION:=utils
  44. CATEGORY:=Utilities
  45. TITLE:=Utility for converting SSH keys
  46. endef
  47. CONFIGURE_ARGS += \
  48. --disable-pam \
  49. --enable-openpty \
  50. --enable-syslog \
  51. $(if $(CONFIG_SHADOW_PASSWORDS),,--disable-shadow) \
  52. --disable-lastlog \
  53. --disable-utmp \
  54. --disable-utmpx \
  55. --disable-wtmp \
  56. --disable-wtmpx \
  57. --disable-loginfunc \
  58. --disable-pututline \
  59. --disable-pututxline \
  60. --disable-zlib \
  61. --enable-bundled-libtom
  62. TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections
  63. TARGET_LDFLAGS += -Wl,--gc-sections
  64. define Build/Configure
  65. $(Build/Configure/Default)
  66. # Enforce that all replacements are made, otherwise options.h has changed
  67. # format and this logic is broken.
  68. for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH DROPBEAR_CURVE25519; do \
  69. awk 'BEGIN { rc = 1 } \
  70. /'$$$$OPTION'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_ECC),,// )#define '$$$$OPTION'"; rc = 0 } \
  71. { print } \
  72. END { exit(rc) }' $(PKG_BUILD_DIR)/options.h \
  73. >$(PKG_BUILD_DIR)/options.h.new && \
  74. mv $(PKG_BUILD_DIR)/options.h.new $(PKG_BUILD_DIR)/options.h || exit 1; \
  75. done
  76. endef
  77. define Build/Compile
  78. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  79. $(TARGET_CONFIGURE_OPTS) \
  80. PROGRAMS="dropbear dbclient dropbearkey scp" \
  81. MULTI=1 SCPPROGRESS=1
  82. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  83. $(TARGET_CONFIGURE_OPTS) \
  84. PROGRAMS="dropbearconvert"
  85. endef
  86. define Package/dropbear/install
  87. $(INSTALL_DIR) $(1)/usr/sbin
  88. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti $(1)/usr/sbin/dropbear
  89. $(INSTALL_DIR) $(1)/usr/bin
  90. ln -sf ../sbin/dropbear $(1)/usr/bin/scp
  91. ln -sf ../sbin/dropbear $(1)/usr/bin/ssh
  92. ln -sf ../sbin/dropbear $(1)/usr/bin/dbclient
  93. ln -sf ../sbin/dropbear $(1)/usr/bin/dropbearkey
  94. $(INSTALL_DIR) $(1)/etc/config
  95. $(INSTALL_DATA) ./files/dropbear.config $(1)/etc/config/dropbear
  96. $(INSTALL_DIR) $(1)/etc/init.d
  97. $(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
  98. $(INSTALL_DIR) $(1)/usr/lib/opkg/info
  99. $(INSTALL_DIR) $(1)/etc/dropbear
  100. touch $(1)/etc/dropbear/dropbear_rsa_host_key
  101. touch $(1)/etc/dropbear/dropbear_dss_host_key
  102. endef
  103. define Package/dropbearconvert/install
  104. $(INSTALL_DIR) $(1)/usr/bin
  105. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearconvert $(1)/usr/bin/dropbearconvert
  106. endef
  107. $(eval $(call BuildPackage,dropbear))
  108. $(eval $(call BuildPackage,dropbearconvert))