openssh.mk 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ################################################################################
  2. #
  3. # openssh
  4. #
  5. ################################################################################
  6. OPENSSH_VERSION = 7.5p1
  7. OPENSSH_SITE = http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable
  8. OPENSSH_LICENSE = BSD-3-Clause, BSD-2-Clause, Public Domain
  9. OPENSSH_LICENSE_FILES = LICENCE
  10. OPENSSH_CONF_ENV = LD="$(TARGET_CC)" LDFLAGS="$(TARGET_CFLAGS)"
  11. OPENSSH_CONF_OPTS = \
  12. --sysconfdir=/etc/ssh \
  13. --disable-lastlog \
  14. --disable-utmp \
  15. --disable-utmpx \
  16. --disable-wtmp \
  17. --disable-wtmpx \
  18. --disable-strip
  19. define OPENSSH_USERS
  20. sshd -1 sshd -1 * - - - SSH drop priv user
  21. endef
  22. ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
  23. OPENSSH_CONF_OPTS += --without-pie
  24. endif
  25. OPENSSH_DEPENDENCIES = zlib openssl
  26. ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
  27. OPENSSH_DEPENDENCIES += cryptodev-linux
  28. OPENSSH_CONF_OPTS += --with-ssl-engine
  29. else
  30. OPENSSH_CONF_OPTS += --without-ssl-engine
  31. endif
  32. ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
  33. define OPENSSH_INSTALL_PAM_CONF
  34. $(INSTALL) -D -m 644 $(@D)/contrib/sshd.pam.generic $(TARGET_DIR)/etc/pam.d/sshd
  35. $(SED) '\%password required /lib/security/pam_cracklib.so%d' $(TARGET_DIR)/etc/pam.d/sshd
  36. $(SED) 's/\#UsePAM no/UsePAM yes/' $(TARGET_DIR)/etc/ssh/sshd_config
  37. endef
  38. OPENSSH_DEPENDENCIES += linux-pam
  39. OPENSSH_CONF_OPTS += --with-pam
  40. OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_PAM_CONF
  41. else
  42. OPENSSH_CONF_OPTS += --without-pam
  43. endif
  44. ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
  45. OPENSSH_DEPENDENCIES += libselinux
  46. OPENSSH_CONF_OPTS += --with-selinux
  47. else
  48. OPENSSH_CONF_OPTS += --without-selinux
  49. endif
  50. define OPENSSH_INSTALL_INIT_SYSTEMD
  51. $(INSTALL) -D -m 644 package/openssh/sshd.service \
  52. $(TARGET_DIR)/usr/lib/systemd/system/sshd.service
  53. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  54. ln -fs ../../../../usr/lib/systemd/system/sshd.service \
  55. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshd.service
  56. endef
  57. define OPENSSH_INSTALL_INIT_SYSV
  58. $(INSTALL) -D -m 755 package/openssh/S50sshd \
  59. $(TARGET_DIR)/etc/init.d/S50sshd
  60. endef
  61. $(eval $(autotools-package))