Makefile 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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:= openssh
  5. PKG_VERSION:= 6.6p1
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 3e9800e6bca1fbac0eea4d41baa7f239
  8. PKG_DESCR:= OpenSSH
  9. PKG_SECTION:= net/security
  10. PKG_BUILDDEP:= zlib openssl
  11. PKG_DEPENDS:= zlib libopenssl libpthread libgcc
  12. PKG_URL:= http://www.openssh.com/
  13. PKG_SITES:= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/
  14. PKG_MULTI:= 1
  15. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
  16. PKG_SUBPKGS:= OPENSSH OPENSSH_SERVER OPENSSH_CLIENT OPENSSH_CLIENT_UTILS
  17. PKG_SUBPKGS+= OPENSSH_SFTP_CLIENT OPENSSH_SFTP_SERVER
  18. PKGSD_OPENSSH_SERVER:= OpenSSH server
  19. PKGSD_OPENSSH_CLIENT:= OpenSSH client
  20. PKGSD_OPENSSH_CLIENT_UTILS:= OpenSSH client utilities
  21. PKGSD_OPENSSH_SFTP_CLIENT:= OpenSSH sftp client
  22. PKGSD_OPENSSH_SFTP_SERVER:= OpenSSH sftp server
  23. PKG_CHOICES_OPENSSH:= NOKRB WITH_KRB5 WITH_HEIMDAL
  24. PKGCD_NOKRB:= no Kerberos support
  25. PKGCD_WITH_KRB5:= with MIT Kerberos
  26. PKGCS_WITH_KRB5:= libkrb5 libcom-err
  27. PKGCB_WITH_KRB5:= krb5
  28. PKGCD_WITH_HEIMDAL:= with Heimdal Kerberos
  29. PKGCS_WITH_HEIMDAL:= libheimdal libcom-err
  30. PKGCB_WITH_HEIMDAL:= heimdal
  31. include ${TOPDIR}/mk/package.mk
  32. $(eval $(call PKG_template,OPENSSH,openssh,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  33. $(eval $(call PKG_template,OPENSSH_SERVER,openssh-server,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_OPENSSH_SERVER},${PKGSD_OPENSSH_SERVER},${PKG_SECTION}))
  34. $(eval $(call PKG_template,OPENSSH_CLIENT,openssh-client,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_OPENSSH_CLIENT},${PKGSD_OPENSSH_CLIENT},${PKG_SECTION}))
  35. $(eval $(call PKG_template,OPENSSH_CLIENT_UTILS,openssh-client-utils,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_OPENSSH_CLIENT_UTILS},${PKGSD_OPENSSH_CLIENT_UTILS},${PKG_SECTION}))
  36. $(eval $(call PKG_template,OPENSSH_SFTP_CLIENT,openssh-sftp-client,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_OPENSSH_SFTP_CLIENT},${PKGSD_OPENSSH_SFTP_CLIENT},${PKG_SECTION}))
  37. $(eval $(call PKG_template,OPENSSH_SFTP_SERVER,openssh-sftp-server,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_OPENSSH_SFTP_SERVER},${PKGSD_OPENSSH_SFTP_SERVER},${PKG_SECTION}))
  38. ifeq ($(ADK_PACKAGE_OPENSSH_WITH_KRB5),y)
  39. CONFIGURE_ARGS+= --with-kerberos5="${STAGING_TARGET_DIR}/usr"
  40. endif
  41. ifeq ($(ADK_PACKAGE_OPENSSH_WITH_HEIMDAL),y)
  42. CONFIGURE_ARGS+= --with-kerberos5="${STAGING_TARGET_DIR}/usr"
  43. TARGET_LDFLAGS+= -L$(STAGING_TARGET_DIR)/usr/lib/heimdal -Wl,-rpath -Wl,/usr/lib/heimdal
  44. endif
  45. ifeq ($(ADK_TOOLCHAIN_USE_SSP),y)
  46. CONFIGURE_ARGS+= --with-stackprotect
  47. else
  48. CONFIGURE_ARGS+= --without-stackprotect
  49. endif
  50. CONFIGURE_ENV+= LD='${TARGET_CC}' \
  51. ac_cv_func_setlogin=no \
  52. ac_cv_have_decl_PR_SET_NO_NEW_PRIVS=no \
  53. ac_cv_lib_nsl_yp_match=no
  54. CONFIGURE_ARGS+= --disable-strip \
  55. --disable-etc-default-login \
  56. --disable-lastlog \
  57. --with-sandbox=no \
  58. --disable-utmp \
  59. --disable-utmpx \
  60. --disable-wtmp \
  61. --disable-wtmpx \
  62. --without-bsd-auth \
  63. --without-rpath \
  64. --without-pam \
  65. --without-x \
  66. --without-zlib-version-check \
  67. --sysconfdir=/etc/ssh \
  68. --with-privsep-user=sshd \
  69. --with-privsep-path=/var/run/sshd \
  70. --with-ssl-dir="${STAGING_TARGET_DIR}/usr"
  71. ifeq ($(ADK_STATIC),y)
  72. TARGET_CFLAGS+= -static
  73. TARGET_LDFLAGS+= -static
  74. endif
  75. openssh-install:
  76. ${INSTALL_DIR} ${IDIR_OPENSSH}/etc/ssh
  77. chmod 0700 ${IDIR_OPENSSH}/etc/ssh
  78. openssh-server-install:
  79. ${INSTALL_DIR} ${IDIR_OPENSSH_SERVER}/etc/ssh
  80. ${INSTALL_DIR} ${IDIR_OPENSSH_SERVER}/usr/bin
  81. ${INSTALL_DIR} ${IDIR_OPENSSH_SERVER}/usr/sbin
  82. ${CP} ./files/sshd_config ${IDIR_OPENSSH_SERVER}/etc/ssh
  83. ${INSTALL_BIN} ${WRKINST}/usr/bin/ssh-keygen \
  84. ${IDIR_OPENSSH_SERVER}/usr/bin
  85. ${INSTALL_BIN} ${WRKINST}/usr/sbin/sshd \
  86. ${IDIR_OPENSSH_SERVER}/usr/sbin
  87. # ssh pubkey
  88. test -z $(ADK_RUNTIME_SSH_PUBKEY) || ( \
  89. mkdir -p $(IDIR_OPENSSH_SERVER)/etc/ssh; \
  90. echo $(ADK_RUNTIME_SSH_PUBKEY) \
  91. >$(IDIR_OPENSSH_SERVER)/etc/ssh/authorized_keys; \
  92. )
  93. openssh-client-install:
  94. ${INSTALL_DIR} ${IDIR_OPENSSH_CLIENT}/etc/ssh
  95. ${INSTALL_DIR} ${IDIR_OPENSSH_CLIENT}/usr/bin
  96. ${INSTALL_DATA} ${WRKINST}/etc/ssh/ssh_config \
  97. ${IDIR_OPENSSH_CLIENT}/etc/ssh
  98. ${INSTALL_BIN} ${WRKINST}/usr/bin/{ssh,scp} \
  99. ${IDIR_OPENSSH_CLIENT}/usr/bin
  100. openssh-client-utils-install:
  101. ${INSTALL_DIR} ${IDIR_OPENSSH_CLIENT_UTILS}/usr/bin
  102. ${INSTALL_BIN} ${WRKINST}/usr/bin/ssh-{add,agent,keyscan} \
  103. ${IDIR_OPENSSH_CLIENT_UTILS}/usr/bin
  104. openssh-sftp-client-install:
  105. ${INSTALL_DIR} ${IDIR_OPENSSH_SFTP_CLIENT}/usr/bin
  106. ${INSTALL_BIN} ${WRKINST}/usr/bin/sftp \
  107. ${IDIR_OPENSSH_SFTP_CLIENT}/usr/bin
  108. openssh-sftp-server-install:
  109. ${INSTALL_DIR} ${IDIR_OPENSSH_SFTP_SERVER}/usr/libexec
  110. ${INSTALL_BIN} ${WRKINST}/usr/libexec/sftp-server \
  111. ${IDIR_OPENSSH_SFTP_SERVER}/usr/libexec
  112. include ${TOPDIR}/mk/pkg-bottom.mk