Makefile 3.5 KB

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