Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:= dropbear
  5. PKG_VERSION:= 2014.63
  6. PKG_RELEASE:= 2
  7. PKG_MD5SUM:= 7066bb9a2da708f3ed06314fdc9c47fd
  8. PKG_DESCR:= SSH 2 server/client designed for embedded systems
  9. PKG_SECTION:= net/security
  10. PKG_URL:= http://matt.ucc.asn.au/dropbear/
  11. PKG_SITES:= http://matt.ucc.asn.au/dropbear/releases/
  12. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
  13. PKG_DFLT_DROPBEAR:= y if !ADK_TOOLCHAIN_ONLY && !ADK_PKG_TEST
  14. PKG_SUBPKGS:= DROPBEAR DBCONVERT
  15. PKGSD_DBCONVERT:= Utility for converting SSH private keys
  16. PKG_FLAVOURS_DROPBEAR:= WITH_UTMP
  17. PKGFD_WITH_UTMP:= support writing /var/run/utmp
  18. include $(TOPDIR)/mk/package.mk
  19. $(eval $(call PKG_template,DROPBEAR,dropbear,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  20. $(eval $(call PKG_template,DBCONVERT,dropbearconvert,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_DBCONVERT},${PKG_SECTION}))
  21. TARGET_LDFLAGS+= $(ADK_TARGET_ABI_CFLAGS)
  22. ifeq ($(ADK_STATIC),y)
  23. TARGET_LDFLAGS+= -static
  24. endif
  25. TARGET_LDFLAGS+= -static-libgcc
  26. BUILD_STYLE:= manual
  27. INSTALL_STYLE:= manual
  28. CONFIGURE_ARGS+= --disable-pam \
  29. --enable-openpty \
  30. --enable-syslog \
  31. --enable-shadow \
  32. --disable-lastlog \
  33. --disable-utmpx \
  34. --disable-wtmp \
  35. --disable-wtmpx \
  36. --disable-loginfunc \
  37. --disable-pututxline \
  38. --disable-zlib
  39. ifeq (${ADK_PACKAGE_DROPBEAR_WITH_UTMP},)
  40. CONFIGURE_ARGS+= --disable-utmp --disable-pututline
  41. else
  42. CONFIGURE_ENV+= conf_utmp_location=/var/run/utmp
  43. endif
  44. pre-configure:
  45. $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(WRKBUILD)/options.h
  46. $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(WRKBUILD)/options.h
  47. do-build:
  48. cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} \
  49. PROGRAMS="dropbear dbclient dropbearkey scp" MULTI=1 SCPPROGRESS=1
  50. cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} \
  51. PROGRAMS=dropbearconvert
  52. do-install:
  53. # main package
  54. $(INSTALL_DIR) $(IDIR_DROPBEAR)/usr/bin $(IDIR_DROPBEAR)/bin
  55. $(INSTALL_DIR) $(IDIR_DROPBEAR)/usr/sbin
  56. $(INSTALL_BIN) $(WRKBUILD)/dropbearmulti \
  57. $(IDIR_DROPBEAR)/usr/sbin/dropbear
  58. ln -sf ../usr/sbin/dropbear $(IDIR_DROPBEAR)/bin/scp
  59. ln -sf ../usr/sbin/dropbear $(IDIR_DROPBEAR)/bin/ssh
  60. ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/dbclient
  61. ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/dropbearkey
  62. # subpackage dropbearconvert
  63. $(INSTALL_DIR) $(IDIR_DBCONVERT)/usr/bin
  64. $(INSTALL_BIN) $(WRKBUILD)/dropbearconvert \
  65. $(IDIR_DBCONVERT)/usr/bin/dropbearconvert
  66. # ssh pubkey
  67. test -z $(ADK_RUNTIME_SSH_PUBKEY) || ( \
  68. $(INSTALL_DIR) $(IDIR_DROPBEAR)/etc/dropbear; \
  69. echo $(ADK_RUNTIME_SSH_PUBKEY) \
  70. >$(IDIR_DROPBEAR)/etc/dropbear/authorized_keys; \
  71. )
  72. include ${TOPDIR}/mk/pkg-bottom.mk