Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. DEFAULT:=y
  26. TITLE:=Small SSH2 client/server
  27. DESCRIPTION:=\
  28. A small SSH2 server/client designed for small memory environments.
  29. endef
  30. define Package/dropbearconvert
  31. $(call Package/dropbear/Default)
  32. SECTION:=utils
  33. CATEGORY:=Utilities
  34. TITLE:=Utility for converting SSH keys
  35. endef
  36. define Build/Configure
  37. $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(PKG_BUILD_DIR)/options.h
  38. $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(PKG_BUILD_DIR)/options.h
  39. (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
  40. $(TARGET_CONFIGURE_OPTS) \
  41. CFLAGS="$(TARGET_CFLAGS)" \
  42. ./configure \
  43. --target=$(GNU_TARGET_NAME) \
  44. --host=$(GNU_TARGET_NAME) \
  45. --build=$(GNU_HOST_NAME) \
  46. --program-prefix="" \
  47. --program-suffix="" \
  48. --prefix=/usr \
  49. --exec-prefix=/usr \
  50. --bindir=/usr/bin \
  51. --datadir=/usr/share \
  52. --includedir=/usr/include \
  53. --infodir=/usr/share/info \
  54. --libdir=/usr/lib \
  55. --libexecdir=/usr/lib \
  56. --localstatedir=/var \
  57. --mandir=/usr/share/man \
  58. --sbindir=/usr/sbin \
  59. --sysconfdir=/etc \
  60. $(DISABLE_LARGEFILE) \
  61. $(DISABLE_NLS) \
  62. --with-shared \
  63. --disable-pam \
  64. --enable-openpty \
  65. --enable-syslog \
  66. --disable-shadow \
  67. --disable-lastlog \
  68. --disable-utmp \
  69. --disable-utmpx \
  70. --disable-wtmp \
  71. --disable-wtmpx \
  72. --disable-loginfunc \
  73. --disable-pututline \
  74. --disable-pututxline \
  75. --disable-zlib \
  76. );
  77. endef
  78. define Build/Compile
  79. $(MAKE) -C $(PKG_BUILD_DIR) \
  80. $(TARGET_CONFIGURE_OPTS) \
  81. LD="$(TARGET_CC)" \
  82. PROGRAMS="dropbear dbclient dropbearkey scp" \
  83. MULTI=1 SCPPROGRESS=1
  84. $(MAKE) -C $(PKG_BUILD_DIR) \
  85. $(TARGET_CONFIGURE_OPTS) \
  86. LD="$(TARGET_CC)" \
  87. PROGRAMS="dropbearconvert"
  88. endef
  89. define Package/dropbear/install
  90. install -d -m0755 $(1)/usr/sbin
  91. install -m0755 $(PKG_BUILD_DIR)/dropbearmulti \
  92. $(1)/usr/sbin/dropbear
  93. install -d -m0755 $(1)/usr/bin
  94. ln -sf ../sbin/dropbear $(1)/usr/bin/scp
  95. ln -sf ../sbin/dropbear $(1)/usr/bin/ssh
  96. ln -sf ../sbin/dropbear $(1)/usr/bin/dbclient
  97. ln -sf ../sbin/dropbear $(1)/usr/bin/dropbearkey
  98. install -d -m0755 $(1)/etc/config
  99. install -m0755 ./files/dropbear.config $(1)/etc/config/dropbear
  100. install -d -m0755 $(1)/etc/init.d
  101. install -m0755 ./files/dropbear.init $(1)/etc/init.d/dropbear
  102. endef
  103. define Package/dropbearconvert/install
  104. install -d -m0755 $(1)/usr/bin
  105. install -m0755 $(PKG_BUILD_DIR)/dropbearconvert \
  106. $(1)/usr/bin/dropbearconvert
  107. endef
  108. $(eval $(call BuildPackage,dropbear))
  109. $(eval $(call BuildPackage,dropbearconvert))