Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=dropbear
  10. PKG_VERSION:=0.48.1
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://matt.ucc.asn.au/dropbear/releases/
  14. PKG_MD5SUM:=ca8e53a766faec831882831364568421
  15. PKG_CAT:=zcat
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  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. DESCRIPTION:=\
  27. A small SSH2 server/client designed for small memory environments.
  28. endef
  29. define Package/dropbearconvert
  30. $(call Package/dropbear/Default)
  31. SECTION:=utils
  32. CATEGORY:=Utilities
  33. TITLE:=Utility for converting SSH keys
  34. endef
  35. define Build/Configure
  36. $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(PKG_BUILD_DIR)/options.h
  37. $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(PKG_BUILD_DIR)/options.h
  38. (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
  39. $(TARGET_CONFIGURE_OPTS) \
  40. CFLAGS="$(TARGET_CFLAGS)" \
  41. ./configure \
  42. --target=$(GNU_TARGET_NAME) \
  43. --host=$(GNU_TARGET_NAME) \
  44. --build=$(GNU_HOST_NAME) \
  45. --program-prefix="" \
  46. --program-suffix="" \
  47. --prefix=/usr \
  48. --exec-prefix=/usr \
  49. --bindir=/usr/bin \
  50. --datadir=/usr/share \
  51. --includedir=/usr/include \
  52. --infodir=/usr/share/info \
  53. --libdir=/usr/lib \
  54. --libexecdir=/usr/lib \
  55. --localstatedir=/var \
  56. --mandir=/usr/share/man \
  57. --sbindir=/usr/sbin \
  58. --sysconfdir=/etc \
  59. $(DISABLE_LARGEFILE) \
  60. $(DISABLE_NLS) \
  61. --with-shared \
  62. --disable-pam \
  63. --enable-openpty \
  64. --enable-syslog \
  65. --disable-shadow \
  66. --disable-lastlog \
  67. --disable-utmp \
  68. --disable-utmpx \
  69. --disable-wtmp \
  70. --disable-wtmpx \
  71. --disable-loginfunc \
  72. --disable-pututline \
  73. --disable-pututxline \
  74. --disable-zlib \
  75. );
  76. endef
  77. define Build/Compile
  78. $(MAKE) -C $(PKG_BUILD_DIR) \
  79. $(TARGET_CONFIGURE_OPTS) \
  80. LD="$(TARGET_CC)" \
  81. PROGRAMS="dropbear dbclient dropbearkey scp" \
  82. MULTI=1 SCPPROGRESS=1
  83. $(MAKE) -C $(PKG_BUILD_DIR) \
  84. $(TARGET_CONFIGURE_OPTS) \
  85. LD="$(TARGET_CC)" \
  86. PROGRAMS="dropbearconvert"
  87. endef
  88. define Package/dropbear/install
  89. $(INSTALL_DIR) $(1)/usr/sbin
  90. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti \
  91. $(1)/usr/sbin/dropbear
  92. $(INSTALL_DIR) $(1)/usr/bin
  93. ln -sf ../sbin/dropbear $(1)/usr/bin/scp
  94. ln -sf ../sbin/dropbear $(1)/usr/bin/ssh
  95. ln -sf ../sbin/dropbear $(1)/usr/bin/dbclient
  96. ln -sf ../sbin/dropbear $(1)/usr/bin/dropbearkey
  97. $(INSTALL_DIR) $(1)/etc/config
  98. $(INSTALL_DATA) ./files/dropbear.config $(1)/etc/config/dropbear
  99. $(INSTALL_DIR) $(1)/etc/init.d
  100. $(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
  101. endef
  102. define Package/dropbearconvert/install
  103. $(INSTALL_DIR) $(1)/usr/bin
  104. $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearconvert \
  105. $(1)/usr/bin/dropbearconvert
  106. endef
  107. $(eval $(call BuildPackage,dropbear))
  108. $(eval $(call BuildPackage,dropbearconvert))