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.

272 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.2p1
  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:=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. ifeq ($(BUILD_VARIANT),with-pam)
  140. CONFIGURE_ARGS += \
  141. --with-pam
  142. else
  143. CONFIGURE_ARGS += \
  144. --without-pam
  145. endif
  146. ifeq ($(CONFIG_OPENSSL_ENGINE),y)
  147. CONFIGURE_ARGS+= \
  148. --with-ssl-engine
  149. endif
  150. ifneq ($(CONFIG_SSP_SUPPORT),y)
  151. CONFIGURE_ARGS += \
  152. --without-stackprotect
  153. endif
  154. CONFIGURE_VARS += LD="$(TARGET_CC)"
  155. ifeq ($(BUILD_VARIANT),with-pam)
  156. TARGET_LDFLAGS += -lpthread
  157. endif
  158. define Build/Compile
  159. $(MAKE) -C $(PKG_BUILD_DIR) \
  160. DESTDIR="$(PKG_INSTALL_DIR)" \
  161. STRIP_OPT="" \
  162. all install
  163. endef
  164. define Package/openssh-moduli/install
  165. $(INSTALL_DIR) $(1)/etc/ssh
  166. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/
  167. endef
  168. define Package/openssh-client/install
  169. $(INSTALL_DIR) $(1)/etc/ssh
  170. chmod 0700 $(1)/etc/ssh
  171. $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
  172. $(INSTALL_DIR) $(1)/usr/bin
  173. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/openssh-ssh
  174. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/openssh-scp
  175. endef
  176. define Package/openssh-client-utils/install
  177. $(INSTALL_DIR) $(1)/usr/bin
  178. $(INSTALL_BIN) $(foreach bin,add agent keyscan keysign,$(PKG_BUILD_DIR)/ssh-$(bin)) $(1)/usr/bin/
  179. endef
  180. define Package/openssh-keygen/install
  181. $(INSTALL_DIR) $(1)/usr/bin
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
  183. endef
  184. define Package/openssh-server/install
  185. $(INSTALL_DIR) $(1)/etc/ssh
  186. chmod 0700 $(1)/etc/ssh
  187. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
  188. sed -r -i 's,^#(HostKey /etc/ssh/ssh_host_(rsa|ed25519)_key)$$$$,\1,' $(1)/etc/ssh/sshd_config
  189. $(INSTALL_DIR) $(1)/etc/init.d
  190. $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
  191. $(INSTALL_DIR) $(1)/usr/sbin
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
  193. endef
  194. define Package/openssh-server-pam/install
  195. $(call Package/openssh-server/install,$(1))
  196. sed -i 's,#PasswordAuthentication yes,PasswordAuthentication no,g' $(1)/etc/ssh/sshd_config
  197. sed -i 's,#UsePAM no,UsePAM yes,g' $(1)/etc/ssh/sshd_config
  198. $(INSTALL_DIR) $(1)/etc/pam.d
  199. $(INSTALL_DATA) ./files/sshd.pam $(1)/etc/pam.d/sshd
  200. $(INSTALL_DIR) $(1)/etc/security
  201. $(INSTALL_DATA) ./files/sshd.pam-access $(1)/etc/security/access-sshd-local.conf
  202. endef
  203. define Package/openssh-sftp-client/install
  204. $(INSTALL_DIR) $(1)/usr/bin
  205. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
  206. endef
  207. define Package/openssh-sftp-server/install
  208. $(INSTALL_DIR) $(1)/usr/lib
  209. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
  210. $(INSTALL_DIR) $(1)/usr/libexec
  211. ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
  212. endef
  213. define Package/openssh-sftp-avahi-service/install
  214. $(INSTALL_DIR) $(1)/etc/avahi/services
  215. $(INSTALL_DATA) ./files/sftp-ssh.service $(1)/etc/avahi/services/
  216. endef
  217. $(eval $(call BuildPackage,openssh-client))
  218. $(eval $(call BuildPackage,openssh-moduli))
  219. $(eval $(call BuildPackage,openssh-client-utils))
  220. $(eval $(call BuildPackage,openssh-keygen))
  221. $(eval $(call BuildPackage,openssh-server))
  222. $(eval $(call BuildPackage,openssh-server-pam))
  223. $(eval $(call BuildPackage,openssh-sftp-client))
  224. $(eval $(call BuildPackage,openssh-sftp-server))
  225. $(eval $(call BuildPackage,openssh-sftp-avahi-service))