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.

264 lines
6.5 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.2p1
  10. PKG_RELEASE:=4
  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:=43925151e6cf6cee1450190c0e9af4dc36b41c12737619edff8bcebdff64e671
  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/bin/openssh-ssh \
  43. 200:/usr/bin/scp:/usr/bin/openssh-scp \
  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_*_key
  78. /etc/ssh/ssh_host_*_key.pub
  79. endef
  80. define Package/openssh-server-pam
  81. $(call Package/openssh/Default)
  82. DEPENDS+= +libpthread +openssh-keygen +libpam
  83. TITLE+= server (with PAM support)
  84. VARIANT:=with-pam
  85. USERID:=sshd=22:sshd=22
  86. endef
  87. define Package/openssh-server-pam/description
  88. OpenSSH server (with PAM support).
  89. endef
  90. define Package/openssh-server-pam/conffiles
  91. /etc/pam.d/sshd
  92. /etc/security/access-sshd-local.conf
  93. /etc/ssh/sshd_config
  94. endef
  95. define Package/openssh-sftp-client
  96. $(call Package/openssh/Default)
  97. TITLE+= SFTP client
  98. endef
  99. define Package/openssh-sftp-client/description
  100. OpenSSH SFTP client.
  101. endef
  102. define Package/openssh-sftp-server
  103. $(call Package/openssh/Default)
  104. TITLE+= SFTP server
  105. endef
  106. define Package/openssh-sftp-server/description
  107. OpenSSH SFTP server.
  108. endef
  109. define Package/openssh-sftp-avahi-service
  110. $(call Package/openssh/Default)
  111. TITLE+= (SFTP Avahi service)
  112. DEPENDS:=+openssh-sftp-server +avahi-daemon
  113. endef
  114. define Package/openssh-sftp-avahi-service/description
  115. This package contains the service definition for announcing
  116. SFTP support via mDNS/DNS-SD.
  117. endef
  118. define Package/openssh-sftp-avahi-service/conffiles
  119. /etc/avahi/services/sftp-ssh.service
  120. endef
  121. CONFIGURE_ARGS += \
  122. $(DISABLE_NLS) \
  123. --sysconfdir=/etc/ssh \
  124. --with-privsep-user=sshd \
  125. --with-privsep-path=/var/empty \
  126. --enable-shared \
  127. --disable-static \
  128. --disable-debug \
  129. --disable-strip \
  130. --disable-etc-default-login \
  131. --disable-lastlog \
  132. --disable-utmp \
  133. --disable-utmpx \
  134. --disable-wtmp \
  135. --disable-wtmpx \
  136. --without-bsd-auth \
  137. --without-kerberos5 \
  138. --without-x \
  139. --with-stackprotect \
  140. --with$(if $(CONFIG_OPENSSL_ENGINE),,out)-ssl-engine
  141. ifeq ($(BUILD_VARIANT),with-pam)
  142. CONFIGURE_ARGS += \
  143. --with-pam
  144. else
  145. CONFIGURE_ARGS += \
  146. --without-pam
  147. endif
  148. CONFIGURE_VARS += LD="$(TARGET_CC)"
  149. ifeq ($(BUILD_VARIANT),with-pam)
  150. TARGET_LDFLAGS += -lpthread
  151. endif
  152. define Build/Compile
  153. $(MAKE) -C $(PKG_BUILD_DIR) \
  154. DESTDIR="$(PKG_INSTALL_DIR)" \
  155. STRIP_OPT="" \
  156. all install
  157. endef
  158. define Package/openssh-moduli/install
  159. $(INSTALL_DIR) $(1)/etc/ssh
  160. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/
  161. endef
  162. define Package/openssh-client/install
  163. $(INSTALL_DIR) $(1)/etc/ssh
  164. chmod 0700 $(1)/etc/ssh
  165. $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
  166. $(INSTALL_DIR) $(1)/usr/bin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/openssh-ssh
  168. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/openssh-scp
  169. endef
  170. define Package/openssh-client-utils/install
  171. $(INSTALL_DIR) $(1)/usr/bin
  172. $(INSTALL_BIN) $(foreach bin,add agent keyscan keysign,$(PKG_BUILD_DIR)/ssh-$(bin)) $(1)/usr/bin/
  173. endef
  174. define Package/openssh-keygen/install
  175. $(INSTALL_DIR) $(1)/usr/bin
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
  177. endef
  178. define Package/openssh-server/install
  179. $(INSTALL_DIR) $(1)/etc/ssh
  180. chmod 0700 $(1)/etc/ssh
  181. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
  182. sed -r -i 's,^#(HostKey /etc/ssh/ssh_host_(rsa|ed25519)_key)$$$$,\1,' $(1)/etc/ssh/sshd_config
  183. $(INSTALL_DIR) $(1)/etc/init.d
  184. $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
  185. $(INSTALL_DIR) $(1)/usr/sbin
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
  187. endef
  188. define Package/openssh-server-pam/install
  189. $(call Package/openssh-server/install,$(1))
  190. sed -i 's,#PasswordAuthentication yes,PasswordAuthentication no,g' $(1)/etc/ssh/sshd_config
  191. sed -i 's,#UsePAM no,UsePAM yes,g' $(1)/etc/ssh/sshd_config
  192. $(INSTALL_DIR) $(1)/etc/pam.d
  193. $(INSTALL_DATA) ./files/sshd.pam $(1)/etc/pam.d/sshd
  194. $(INSTALL_DIR) $(1)/etc/security
  195. $(INSTALL_DATA) ./files/sshd.pam-access $(1)/etc/security/access-sshd-local.conf
  196. endef
  197. define Package/openssh-sftp-client/install
  198. $(INSTALL_DIR) $(1)/usr/bin
  199. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
  200. endef
  201. define Package/openssh-sftp-server/install
  202. $(INSTALL_DIR) $(1)/usr/lib
  203. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
  204. $(INSTALL_DIR) $(1)/usr/libexec
  205. ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
  206. endef
  207. define Package/openssh-sftp-avahi-service/install
  208. $(INSTALL_DIR) $(1)/etc/avahi/services
  209. $(INSTALL_DATA) ./files/sftp-ssh.service $(1)/etc/avahi/services/
  210. endef
  211. $(eval $(call BuildPackage,openssh-client))
  212. $(eval $(call BuildPackage,openssh-moduli))
  213. $(eval $(call BuildPackage,openssh-client-utils))
  214. $(eval $(call BuildPackage,openssh-keygen))
  215. $(eval $(call BuildPackage,openssh-server))
  216. $(eval $(call BuildPackage,openssh-server-pam))
  217. $(eval $(call BuildPackage,openssh-sftp-client))
  218. $(eval $(call BuildPackage,openssh-sftp-server))
  219. $(eval $(call BuildPackage,openssh-sftp-avahi-service))