2 # Copyright (C) 2006-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://cdn.openbsd.org
/pub
/OpenBSD
/OpenSSH
/portable
/ \
16 https
://ftp.openbsd.org
/pub
/OpenBSD
/OpenSSH
/portable
/
17 PKG_HASH
:=3608fd9088db2163ceb3e600c85ab79d0de3d221e59192ea1923e23263866a85
20 PKG_LICENSE_FILES
:=LICENCE
21 PKG_CPE_ID
:=cpe
:/a
:openssh
:openssh
24 PKG_CONFIG_DEPENDS
:= \
25 CONFIG_OPENSSH_LIBFIDO2
27 PKG_BUILD_DEPENDS
+= OPENSSH_LIBFIDO2
:libfido2
29 include $(INCLUDE_DIR
)/package.mk
31 define Package
/openssh
/Default
36 MAINTAINER
:=Peter Wagner
<tripolar@gmx.at
>
37 URL
:=https
://www.openssh.com
/
41 define Package
/openssh-moduli
42 $(call Package
/openssh
/Default
)
43 DEPENDS
+= +openssh-keygen
47 define Package
/openssh-moduli
/description
48 OpenSSH server moduli file.
51 define Package
/openssh-client
52 $(call Package
/openssh
/Default
)
53 DEPENDS
+= +libopenssl
+zlib
56 200:/usr
/bin
/ssh
:/usr
/libexec
/ssh-openssh \
57 200:/usr
/bin
/scp
:/usr
/libexec
/scp-openssh
60 define Package
/openssh-client
/description
64 define Package
/openssh-client
/conffiles
68 define Package
/openssh-client-utils
69 $(call Package
/openssh
/Default
)
70 DEPENDS
+= +libopenssl
+zlib
+openssh-client
+openssh-keygen
71 TITLE
+= client utilities
74 define Package
/openssh-client-utils
/description
75 OpenSSH client utilities.
78 define Package
/openssh-keygen
79 $(call Package
/openssh
/Default
)
80 DEPENDS
+= +libopenssl
+zlib
84 define Package
/openssh-keygen
/description
88 define Package
/openssh-server
89 $(call Package
/openssh
/Default
)
90 DEPENDS
+= +libopenssl
+zlib
+openssh-keygen
+OPENSSH_LIBFIDO2
:libfido2
92 USERID
:=sshd
=22:sshd
=22
96 define Package
/openssh-server
/config
97 source
"$(SOURCE)/Config.in"
100 define Package
/openssh-server
/description
104 define Package
/openssh-server
/conffiles
106 /etc
/ssh
/sshd_config.d
/
107 /etc
/ssh
/ssh_host_ed25519_key
108 /etc
/ssh
/ssh_host_ed25519_key.pub
109 /etc
/ssh
/ssh_host_rsa_key
110 /etc
/ssh
/ssh_host_rsa_key.pub
111 /root
/.ssh
/authorized_keys
114 define Package
/openssh-server-pam
115 $(call Package
/openssh
/Default
)
116 DEPENDS
+= +libopenssl
+zlib
+libpthread
+openssh-keygen
+libpam
117 TITLE
+= server
(with PAM support
)
119 USERID
:=sshd
=22:sshd
=22
122 define Package
/openssh-server-pam
/description
123 OpenSSH server
(with PAM support
).
126 define Package
/openssh-server-pam
/conffiles
128 /etc
/security
/access-sshd-local.conf
129 $(Package
/openssh-server
/conffiles
)
132 define Package
/openssh-sftp-client
133 $(call Package
/openssh
/Default
)
137 define Package
/openssh-sftp-client
/description
141 define Package
/openssh-sftp-server
142 $(call Package
/openssh
/Default
)
146 define Package
/openssh-sftp-server
/description
150 define Package
/openssh-sftp-avahi-service
151 $(call Package
/openssh
/Default
)
152 TITLE
+= (SFTP Avahi service
)
153 DEPENDS
:=+openssh-sftp-server
+avahi-daemon
156 define Package
/openssh-sftp-avahi-service
/description
157 This package contains the service definition for announcing
158 SFTP support via mDNS
/DNS-SD.
161 define Package
/openssh-sftp-avahi-service
/conffiles
162 /etc
/avahi
/services
/sftp-ssh.service
166 --sysconfdir
=/etc
/ssh \
167 --with-privsep-user
=sshd \
168 --with-privsep-path
=/var
/empty \
170 --disable-etc-default-login \
177 --without-kerberos5 \
178 --with-stackprotect \
179 --with
$(if
$(CONFIG_OPENSSL_ENGINE
),,out
)-ssl-engine \
180 --with
$(if
$(CONFIG_OPENSSH_LIBFIDO2
),,out
)-security-key-builtin
182 ifeq ($(BUILD_VARIANT
),with-pam
)
190 CONFIGURE_VARS
+= LD
="$(TARGET_CC)" PATH_PASSWD_PROG
="/bin/passwd"
192 ifeq ($(BUILD_VARIANT
),with-pam
)
193 TARGET_LDFLAGS
+= -lpthread
197 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
198 DESTDIR
="$(PKG_INSTALL_DIR)" \
203 define Package
/openssh-moduli
/install
204 install -d
-m0700
$(1)/etc
/ssh
205 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/etc
/ssh
/moduli
$(1)/etc
/ssh
/
208 define Package
/openssh-client
/install
209 install -d
-m0700
$(1)/etc
/ssh
210 $(CP
) $(PKG_INSTALL_DIR
)/etc
/ssh
/ssh_config
$(1)/etc
/ssh
/
211 $(INSTALL_DIR
) $(1)/usr
/libexec
212 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ssh
$(1)/usr
/libexec
/ssh-openssh
213 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/scp
$(1)/usr
/libexec
/scp-openssh
216 define Package
/openssh-client-utils
/install
217 $(INSTALL_DIR
) $(1)/usr
/bin
218 $(INSTALL_BIN
) $(foreach bin
,add agent keyscan keysign
,$(PKG_BUILD_DIR
)/ssh-
$(bin
)) $(1)/usr
/bin
/
221 define Package
/openssh-keygen
/install
222 $(INSTALL_DIR
) $(1)/usr
/bin
223 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ssh-keygen
$(1)/usr
/bin
/
226 define Package
/openssh-server
/install
227 install -d
-m0700
$(1)/etc
/ssh
$(1)/etc
/ssh
/sshd_config.d
228 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/etc
/ssh
/sshd_config
$(1)/etc
/ssh
/
229 sed
-r
-i
's,^#(HostKey /etc/ssh/ssh_host_(rsa|ed25519)_key)$$$$,\1,' $(1)/etc
/ssh
/sshd_config
230 $(INSTALL_DIR
) $(1)/etc
/init.d
231 $(INSTALL_BIN
) .
/files
/sshd.init
$(1)/etc
/init.d
/sshd
232 $(INSTALL_DIR
) $(1)/lib
/preinit
233 $(INSTALL_BIN
) .
/files
/sshd.failsafe
$(1)/lib
/preinit
/99_10_failsafe_sshd
234 $(INSTALL_DIR
) $(1)/usr
/sbin
235 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/sshd
$(1)/usr
/sbin
/
238 define Package
/openssh-server-pam
/install
239 $(call Package
/openssh-server
/install,$(1))
240 sed
-i
's,#PasswordAuthentication yes,PasswordAuthentication no,g' $(1)/etc
/ssh
/sshd_config
241 sed
-i
's,#UsePAM no,UsePAM yes,g' $(1)/etc
/ssh
/sshd_config
242 $(INSTALL_DIR
) $(1)/etc
/pam.d
243 $(INSTALL_DATA
) .
/files
/sshd.pam
$(1)/etc
/pam.d
/sshd
244 $(INSTALL_DIR
) $(1)/etc
/security
245 $(INSTALL_DATA
) .
/files
/sshd.pam-access
$(1)/etc
/security
/access-sshd-local.conf
248 define Package
/openssh-sftp-client
/install
249 $(INSTALL_DIR
) $(1)/usr
/bin
250 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/sftp
$(1)/usr
/bin
/
253 define Package
/openssh-sftp-server
/install
254 $(INSTALL_DIR
) $(1)/usr
/lib
255 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/sftp-server
$(1)/usr
/lib
/
256 $(INSTALL_DIR
) $(1)/usr
/libexec
257 ln
-sf ..
/lib
/sftp-server
$(1)/usr
/libexec
/sftp-server
260 define Package
/openssh-sftp-avahi-service
/install
261 $(INSTALL_DIR
) $(1)/etc
/avahi
/services
262 $(INSTALL_DATA
) .
/files
/sftp-ssh.service
$(1)/etc
/avahi
/services
/
265 $(eval
$(call BuildPackage
,openssh-client
))
266 $(eval
$(call BuildPackage
,openssh-moduli
))
267 $(eval
$(call BuildPackage
,openssh-client-utils
))
268 $(eval
$(call BuildPackage
,openssh-keygen
))
269 $(eval
$(call BuildPackage
,openssh-server
))
270 $(eval
$(call BuildPackage
,openssh-server-pam
))
271 $(eval
$(call BuildPackage
,openssh-sftp-client
))
272 $(eval
$(call BuildPackage
,openssh-sftp-server
))
273 $(eval
$(call BuildPackage
,openssh-sftp-avahi-service
))