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.

261 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.3p1
  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. PKG_HASH:=f2befbe0472fe7eb75d23340eb17531cb6b3aac24075e2066b41f814e12387b2
  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_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/bin
  164. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/openssh-ssh
  165. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/openssh-scp
  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)/usr/sbin
  183. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
  184. endef
  185. define Package/openssh-server-pam/install
  186. $(call Package/openssh-server/install,$(1))
  187. sed -i 's,#PasswordAuthentication yes,PasswordAuthentication no,g' $(1)/etc/ssh/sshd_config
  188. sed -i 's,#UsePAM no,UsePAM yes,g' $(1)/etc/ssh/sshd_config
  189. $(INSTALL_DIR) $(1)/etc/pam.d
  190. $(INSTALL_DATA) ./files/sshd.pam $(1)/etc/pam.d/sshd
  191. $(INSTALL_DIR) $(1)/etc/security
  192. $(INSTALL_DATA) ./files/sshd.pam-access $(1)/etc/security/access-sshd-local.conf
  193. endef
  194. define Package/openssh-sftp-client/install
  195. $(INSTALL_DIR) $(1)/usr/bin
  196. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
  197. endef
  198. define Package/openssh-sftp-server/install
  199. $(INSTALL_DIR) $(1)/usr/lib
  200. $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
  201. $(INSTALL_DIR) $(1)/usr/libexec
  202. ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
  203. endef
  204. define Package/openssh-sftp-avahi-service/install
  205. $(INSTALL_DIR) $(1)/etc/avahi/services
  206. $(INSTALL_DATA) ./files/sftp-ssh.service $(1)/etc/avahi/services/
  207. endef
  208. $(eval $(call BuildPackage,openssh-client))
  209. $(eval $(call BuildPackage,openssh-moduli))
  210. $(eval $(call BuildPackage,openssh-client-utils))
  211. $(eval $(call BuildPackage,openssh-keygen))
  212. $(eval $(call BuildPackage,openssh-server))
  213. $(eval $(call BuildPackage,openssh-server-pam))
  214. $(eval $(call BuildPackage,openssh-sftp-client))
  215. $(eval $(call BuildPackage,openssh-sftp-server))
  216. $(eval $(call BuildPackage,openssh-sftp-avahi-service))