You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
6.6 KiB

  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=openssh
  9. PKG_VERSION:=8.4p1
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
  13. https://ftp.spline.de/pub/OpenBSD/OpenSSH/portable/
  14. PKG_HASH:=5a01d22e407eb1c05ba8a8f7c654d388a13e9f226e4ed33bd38748dafa1d2b24
  15. PKG_LICENSE:=BSD ISC
  16. PKG_LICENSE_FILES:=LICENCE
  17. PKG_CPE_ID:=cpe:/a:openssh:openssh
  18. PKG_REMOVE_FILES:=
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/openssh/Default
  21. SECTION:=net
  22. CATEGORY:=Network
  23. DEPENDS:=+libopenssl +zlib
  24. TITLE:=OpenSSH
  25. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  26. URL:=http://www.openssh.com/
  27. SUBMENU:=SSH
  28. VARIANT:=without-pam
  29. endef
  30. define Package/openssh-moduli
  31. $(call Package/openssh/Default)
  32. DEPENDS+= +openssh-keygen
  33. TITLE+= moduli file
  34. endef
  35. define Package/openssh-moduli/description
  36. OpenSSH server moduli file.
  37. endef
  38. define Package/openssh-client
  39. $(call Package/openssh/Default)
  40. TITLE+= client
  41. ALTERNATIVES:=\
  42. 200:/usr/bin/ssh:/usr/libexec/ssh-openssh \
  43. 200:/usr/bin/scp:/usr/libexec/scp-openssh
  44. endef
  45. define Package/openssh-client/description
  46. OpenSSH client.
  47. endef
  48. define Package/openssh-client/conffiles
  49. /etc/ssh/ssh_config
  50. endef
  51. define Package/openssh-client-utils
  52. $(call Package/openssh/Default)
  53. DEPENDS+= +openssh-client +openssh-keygen
  54. TITLE+= client utilities
  55. endef
  56. define Package/openssh-client-utils/description
  57. OpenSSH client utilities.
  58. endef
  59. define Package/openssh-keygen
  60. $(call Package/openssh/Default)
  61. TITLE+= keygen
  62. endef
  63. define Package/openssh-keygen/description
  64. OpenSSH keygen.
  65. endef
  66. define Package/openssh-server
  67. $(call Package/openssh/Default)
  68. DEPENDS+= +openssh-keygen
  69. TITLE+= server
  70. USERID:=sshd=22:sshd=22
  71. endef
  72. define Package/openssh-server/description
  73. OpenSSH server.
  74. endef
  75. define Package/openssh-server/conffiles
  76. /etc/ssh/sshd_config
  77. /etc/ssh/ssh_host_ed25519_key
  78. /etc/ssh/ssh_host_ed25519_key.pub
  79. /etc/ssh/ssh_host_rsa_key
  80. /etc/ssh/ssh_host_rsa_key.pub
  81. endef
  82. define Package/openssh-server-pam
  83. $(call Package/openssh/Default)
  84. DEPENDS+= +libpthread +openssh-keygen +libpam
  85. TITLE+= server (with PAM support)
  86. VARIANT:=with-pam
  87. USERID:=sshd=22:sshd=22
  88. endef
  89. define Package/openssh-server-pam/description
  90. OpenSSH server (with PAM support).
  91. endef
  92. define Package/openssh-server-pam/conffiles
  93. /etc/pam.d/sshd
  94. /etc/security/access-sshd-local.conf
  95. /etc/ssh/sshd_config
  96. endef
  97. define Package/openssh-sftp-client
  98. $(call Package/openssh/Default)
  99. TITLE+= SFTP client
  100. endef
  101. define Package/openssh-sftp-client/description
  102. OpenSSH SFTP client.
  103. endef
  104. define Package/openssh-sftp-server
  105. $(call Package/openssh/Default)
  106. TITLE+= SFTP server
  107. endef
  108. define Package/openssh-sftp-server/description
  109. OpenSSH SFTP server.
  110. endef
  111. define Package/openssh-sftp-avahi-service
  112. $(call Package/openssh/Default)
  113. TITLE+= (SFTP Avahi service)
  114. DEPENDS:=+openssh-sftp-server +avahi-daemon
  115. endef
  116. define Package/openssh-sftp-avahi-service/description
  117. This package contains the service definition for announcing
  118. SFTP support via mDNS/DNS-SD.
  119. endef
  120. define Package/openssh-sftp-avahi-service/conffiles
  121. /etc/avahi/services/sftp-ssh.service
  122. endef
  123. CONFIGURE_ARGS += \
  124. --sysconfdir=/etc/ssh \
  125. --with-privsep-user=sshd \
  126. --with-privsep-path=/var/empty \
  127. --disable-strip \
  128. --disable-etc-default-login \
  129. --disable-lastlog \
  130. --disable-utmp \
  131. --disable-utmpx \
  132. --disable-wtmp \
  133. --disable-wtmpx \
  134. --without-bsd-auth \
  135. --without-kerberos5 \
  136. --with-stackprotect \
  137. --with$(if $(CONFIG_OPENSSL_ENGINE),,out)-ssl-engine
  138. ifeq ($(BUILD_VARIANT),with-pam)
  139. CONFIGURE_ARGS += \
  140. --with-pam
  141. else
  142. CONFIGURE_ARGS += \
  143. --without-pam
  144. endif
  145. CONFIGURE_VARS += LD="$(TARGET_CC)"
  146. ifeq ($(BUILD_VARIANT),with-pam)
  147. TARGET_LDFLAGS += -lpthread
  148. endif
  149. define Build/Compile
  150. $(MAKE) -C $(PKG_BUILD_DIR) \
  151. DESTDIR="$(PKG_INSTALL_DIR)" \
  152. STRIP_OPT="" \
  153. all install
  154. endef
  155. define Package/openssh-moduli/install
  156. $(INSTALL_DIR) $(1)/etc/ssh
  157. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/
  158. endef
  159. define Package/openssh-client/install
  160. $(INSTALL_DIR) $(1)/etc/ssh
  161. chmod 0700 $(1)/etc/ssh
  162. $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
  163. $(INSTALL_DIR) $(1)/usr/libexec
  164. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/libexec/ssh-openssh
  165. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/libexec/scp-openssh
  166. endef
  167. define Package/openssh-client-utils/install
  168. $(INSTALL_DIR) $(1)/usr/bin
  169. $(INSTALL_BIN) $(foreach bin,add agent keyscan keysign,$(PKG_BUILD_DIR)/ssh-$(bin)) $(1)/usr/bin/
  170. endef
  171. define Package/openssh-keygen/install
  172. $(INSTALL_DIR) $(1)/usr/bin
  173. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
  174. endef
  175. define Package/openssh-server/install
  176. $(INSTALL_DIR) $(1)/etc/ssh
  177. chmod 0700 $(1)/etc/ssh
  178. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
  179. sed -r -i 's,^#(HostKey /etc/ssh/ssh_host_(rsa|ed25519)_key)$$$$,\1,' $(1)/etc/ssh/sshd_config
  180. $(INSTALL_DIR) $(1)/etc/init.d
  181. $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
  182. $(INSTALL_DIR) $(1)/lib/preinit
  183. $(INSTALL_BIN) ./files/sshd.failsafe $(1)/lib/preinit/99_10_failsafe_sshd
  184. $(INSTALL_DIR) $(1)/usr/sbin
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
  186. endef
  187. define Package/openssh-server-pam/install
  188. $(call Package/openssh-server/install,$(1))
  189. sed -i 's,#PasswordAuthentication yes,PasswordAuthentication no,g' $(1)/etc/ssh/sshd_config
  190. sed -i 's,#UsePAM no,UsePAM yes,g' $(1)/etc/ssh/sshd_config
  191. $(INSTALL_DIR) $(1)/etc/pam.d
  192. $(INSTALL_DATA) ./files/sshd.pam $(1)/etc/pam.d/sshd
  193. $(INSTALL_DIR) $(1)/etc/security
  194. $(INSTALL_DATA) ./files/sshd.pam-access $(1)/etc/security/access-sshd-local.conf
  195. endef
  196. define Package/openssh-sftp-client/install
  197. $(INSTALL_DIR) $(1)/usr/bin
  198. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
  199. endef
  200. define Package/openssh-sftp-server/install
  201. $(INSTALL_DIR) $(1)/usr/lib
  202. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
  203. $(INSTALL_DIR) $(1)/usr/libexec
  204. ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
  205. endef
  206. define Package/openssh-sftp-avahi-service/install
  207. $(INSTALL_DIR) $(1)/etc/avahi/services
  208. $(INSTALL_DATA) ./files/sftp-ssh.service $(1)/etc/avahi/services/
  209. endef
  210. $(eval $(call BuildPackage,openssh-client))
  211. $(eval $(call BuildPackage,openssh-moduli))
  212. $(eval $(call BuildPackage,openssh-client-utils))
  213. $(eval $(call BuildPackage,openssh-keygen))
  214. $(eval $(call BuildPackage,openssh-server))
  215. $(eval $(call BuildPackage,openssh-server-pam))
  216. $(eval $(call BuildPackage,openssh-sftp-client))
  217. $(eval $(call BuildPackage,openssh-sftp-server))
  218. $(eval $(call BuildPackage,openssh-sftp-avahi-service))