Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #
  2. # Copyright (C) 2006-2009 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:=0.53.1
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:= \
  13. http://matt.ucc.asn.au/dropbear/releases/ \
  14. http://www.mirrors.wiretapped.net/security/cryptography/apps/ssh/dropbear/
  15. PKG_MD5SUM:=6b8d901859d9b8a18e2f6bfe0a892a03
  16. PKG_BUILD_PARALLEL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/dropbear/Default
  19. URL:=http://matt.ucc.asn.au/dropbear/
  20. endef
  21. define Package/dropbear
  22. $(call Package/dropbear/Default)
  23. SECTION:=net
  24. CATEGORY:=Base system
  25. TITLE:=Small SSH2 client/server
  26. endef
  27. define Package/dropbear/description
  28. A small SSH2 server/client designed for small memory environments.
  29. endef
  30. define Package/dropbear/conffiles
  31. /etc/dropbear/dropbear_rsa_host_key
  32. /etc/dropbear/dropbear_dss_host_key
  33. /etc/config/dropbear
  34. endef
  35. define Package/dropbearconvert
  36. $(call Package/dropbear/Default)
  37. SECTION:=utils
  38. CATEGORY:=Utilities
  39. TITLE:=Utility for converting SSH keys
  40. endef
  41. CONFIGURE_ARGS += \
  42. --with-shared \
  43. --disable-pam \
  44. --enable-openpty \
  45. --enable-syslog \
  46. $(if $(CONFIG_SHADOW_PASSWORDS),,--disable-shadow) \
  47. --disable-lastlog \
  48. --disable-utmp \
  49. --disable-utmpx \
  50. --disable-wtmp \
  51. --disable-wtmpx \
  52. --disable-loginfunc \
  53. --disable-pututline \
  54. --disable-pututxline \
  55. --disable-zlib \
  56. --enable-bundled-libtom
  57. TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections
  58. TARGET_LDFLAGS += -Wl,--gc-sections
  59. define Build/Configure
  60. $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(PKG_BUILD_DIR)/options.h
  61. $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(PKG_BUILD_DIR)/options.h
  62. $(call Build/Configure/Default)
  63. endef
  64. define Build/Compile
  65. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  66. $(TARGET_CONFIGURE_OPTS) \
  67. LD="$(TARGET_CC)" \
  68. PROGRAMS="dropbear dbclient dropbearkey scp" \
  69. MULTI=1 SCPPROGRESS=1
  70. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  71. $(TARGET_CONFIGURE_OPTS) \
  72. LD="$(TARGET_CC)" \
  73. PROGRAMS="dropbearconvert"
  74. endef
  75. define Package/dropbear/install
  76. $(INSTALL_DIR) $(1)/usr/sbin
  77. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti $(1)/usr/sbin/dropbear
  78. $(INSTALL_DIR) $(1)/usr/bin
  79. ln -sf ../sbin/dropbear $(1)/usr/bin/scp
  80. ln -sf ../sbin/dropbear $(1)/usr/bin/ssh
  81. ln -sf ../sbin/dropbear $(1)/usr/bin/dbclient
  82. ln -sf ../sbin/dropbear $(1)/usr/bin/dropbearkey
  83. $(INSTALL_DIR) $(1)/etc/config
  84. $(INSTALL_DATA) ./files/dropbear.config $(1)/etc/config/dropbear
  85. $(INSTALL_DIR) $(1)/etc/init.d
  86. $(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
  87. $(INSTALL_DIR) $(1)/usr/lib/opkg/info
  88. $(INSTALL_DIR) $(1)/etc/dropbear
  89. touch $(1)/etc/dropbear/dropbear_rsa_host_key
  90. touch $(1)/etc/dropbear/dropbear_dss_host_key
  91. endef
  92. define Package/dropbearconvert/install
  93. $(INSTALL_DIR) $(1)/usr/bin
  94. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearconvert $(1)/usr/bin/dropbearconvert
  95. endef
  96. $(eval $(call BuildPackage,dropbear))
  97. $(eval $(call BuildPackage,dropbearconvert))