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.

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