|
@@ -0,0 +1,265 @@
|
|
1
|
+#
|
|
2
|
+# Copyright (C) 2006-2011 OpenWrt.org
|
|
3
|
+#
|
|
4
|
+# This is free software, licensed under the GNU General Public License v2.
|
|
5
|
+# See /LICENSE for more information.
|
|
6
|
+#
|
|
7
|
+
|
|
8
|
+include $(TOPDIR)/rules.mk
|
|
9
|
+
|
|
10
|
+PKG_NAME:=openssh
|
|
11
|
+PKG_VERSION:=6.6p1
|
|
12
|
+PKG_RELEASE:=1
|
|
13
|
+
|
|
14
|
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
15
|
+PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
|
|
16
|
+ ftp://openbsd.wiretapped.net/pub/OpenBSD/OpenSSH/portable/ \
|
|
17
|
+ ftp://ftp.belnet.be/packages/openbsd/OpenSSH/portable/ \
|
|
18
|
+ ftp://ftp.de.openbsd.org/pub/unix/OpenBSD/OpenSSH/portable/
|
|
19
|
+PKG_MD5SUM:=3e9800e6bca1fbac0eea4d41baa7f239
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
|
23
|
+
|
|
24
|
+PKG_BUILD_DEPENDS:=libopenssl
|
|
25
|
+
|
|
26
|
+include $(INCLUDE_DIR)/package.mk
|
|
27
|
+
|
|
28
|
+define Package/openssh/Default
|
|
29
|
+ SECTION:=net
|
|
30
|
+ CATEGORY:=Network
|
|
31
|
+ DEPENDS:=+libopenssl +zlib +SSP_SUPPORT:libssp
|
|
32
|
+ TITLE:=OpenSSH
|
|
33
|
+ MAINTAINER:=Peter Wagner <tripolar@gmx.at>
|
|
34
|
+ URL:=http://www.openssh.com/
|
|
35
|
+ SUBMENU:=SSH
|
|
36
|
+ VARIANT:=without-pam
|
|
37
|
+endef
|
|
38
|
+
|
|
39
|
+define Package/openssh-moduli
|
|
40
|
+ $(call Package/openssh/Default)
|
|
41
|
+ DEPENDS+= +openssh-keygen
|
|
42
|
+ TITLE+= moduli file
|
|
43
|
+endef
|
|
44
|
+
|
|
45
|
+define Package/openssh-moduli/description
|
|
46
|
+OpenSSH server moduli file.
|
|
47
|
+endef
|
|
48
|
+
|
|
49
|
+define Package/openssh-client
|
|
50
|
+ $(call Package/openssh/Default)
|
|
51
|
+ TITLE+= client
|
|
52
|
+endef
|
|
53
|
+
|
|
54
|
+define Package/openssh-client/description
|
|
55
|
+OpenSSH client.
|
|
56
|
+endef
|
|
57
|
+
|
|
58
|
+define Package/openssh-client/conffiles
|
|
59
|
+/etc/ssh/ssh_config
|
|
60
|
+endef
|
|
61
|
+
|
|
62
|
+define Package/openssh-client-utils
|
|
63
|
+ $(call Package/openssh/Default)
|
|
64
|
+ DEPENDS+= +openssh-client +openssh-keygen
|
|
65
|
+ TITLE+= client utilities
|
|
66
|
+endef
|
|
67
|
+
|
|
68
|
+define Package/openssh-client-utils/description
|
|
69
|
+OpenSSH client utilities.
|
|
70
|
+endef
|
|
71
|
+
|
|
72
|
+define Package/openssh-keygen
|
|
73
|
+ $(call Package/openssh/Default)
|
|
74
|
+ TITLE+= keygen
|
|
75
|
+endef
|
|
76
|
+
|
|
77
|
+define Package/openssh-keygen/description
|
|
78
|
+OpenSSH keygen.
|
|
79
|
+endef
|
|
80
|
+
|
|
81
|
+define Package/openssh-server
|
|
82
|
+ $(call Package/openssh/Default)
|
|
83
|
+ DEPENDS+= +openssh-keygen
|
|
84
|
+ TITLE+= server
|
|
85
|
+endef
|
|
86
|
+
|
|
87
|
+define Package/openssh-server/description
|
|
88
|
+OpenSSH server.
|
|
89
|
+endef
|
|
90
|
+
|
|
91
|
+define Package/openssh-server/conffiles
|
|
92
|
+/etc/ssh/sshd_config
|
|
93
|
+endef
|
|
94
|
+
|
|
95
|
+define Package/openssh-server-pam
|
|
96
|
+ $(call Package/openssh/Default)
|
|
97
|
+ DEPENDS+= +libpthread +openssh-keygen +libpam
|
|
98
|
+ TITLE+= server (with PAM support)
|
|
99
|
+ VARIANT:=with-pam
|
|
100
|
+endef
|
|
101
|
+
|
|
102
|
+define Package/openssh-server-pam/description
|
|
103
|
+OpenSSH server (with PAM support).
|
|
104
|
+endef
|
|
105
|
+
|
|
106
|
+define Package/openssh-server-pam/conffiles
|
|
107
|
+/etc/pam.d/sshd
|
|
108
|
+/etc/security/access-sshd-local.conf
|
|
109
|
+/etc/ssh/sshd_config
|
|
110
|
+endef
|
|
111
|
+
|
|
112
|
+define Package/openssh-sftp-client
|
|
113
|
+ $(call Package/openssh/Default)
|
|
114
|
+ TITLE+= SFTP client
|
|
115
|
+endef
|
|
116
|
+
|
|
117
|
+define Package/openssh-sftp-client/description
|
|
118
|
+OpenSSH SFTP client.
|
|
119
|
+endef
|
|
120
|
+
|
|
121
|
+define Package/openssh-sftp-server
|
|
122
|
+ $(call Package/openssh/Default)
|
|
123
|
+ TITLE+= SFTP server
|
|
124
|
+endef
|
|
125
|
+
|
|
126
|
+define Package/openssh-sftp-server/description
|
|
127
|
+OpenSSH SFTP server.
|
|
128
|
+endef
|
|
129
|
+
|
|
130
|
+CONFIGURE_ARGS+= \
|
|
131
|
+ $(DISABLE_NLS) \
|
|
132
|
+ --sysconfdir=/etc/ssh \
|
|
133
|
+ --with-privsep-user=sshd \
|
|
134
|
+ --with-privsep-path=/var/empty \
|
|
135
|
+ --enable-shared \
|
|
136
|
+ --disable-static \
|
|
137
|
+ --disable-debug \
|
|
138
|
+ --disable-strip \
|
|
139
|
+ --disable-etc-default-login \
|
|
140
|
+ --disable-lastlog \
|
|
141
|
+ --disable-utmp \
|
|
142
|
+ --disable-utmpx \
|
|
143
|
+ --disable-wtmp \
|
|
144
|
+ --disable-wtmpx \
|
|
145
|
+ --without-bsd-auth \
|
|
146
|
+ --without-kerberos5 \
|
|
147
|
+ --without-x
|
|
148
|
+
|
|
149
|
+ifeq ($(BUILD_VARIANT),with-pam)
|
|
150
|
+CONFIGURE_ARGS += \
|
|
151
|
+ --with-pam
|
|
152
|
+else
|
|
153
|
+CONFIGURE_ARGS += \
|
|
154
|
+ --without-pam
|
|
155
|
+endif
|
|
156
|
+
|
|
157
|
+ifeq ($(CONFIG_OPENSSL_ENGINE),y)
|
|
158
|
+CONFIGURE_ARGS+= \
|
|
159
|
+ --with-ssl-engine
|
|
160
|
+endif
|
|
161
|
+
|
|
162
|
+ifneq ($(CONFIG_SSP_SUPPORT),y)
|
|
163
|
+CONFIGURE_ARGS += \
|
|
164
|
+ --without-stackprotect
|
|
165
|
+endif
|
|
166
|
+
|
|
167
|
+CONFIGURE_VARS += LD="$(TARGET_CC)"
|
|
168
|
+
|
|
169
|
+ifeq ($(BUILD_VARIANT),with-pam)
|
|
170
|
+TARGET_LDFLAGS += -lpthread
|
|
171
|
+endif
|
|
172
|
+
|
|
173
|
+define Build/Compile
|
|
174
|
+ $(MAKE) -C $(PKG_BUILD_DIR) \
|
|
175
|
+ DESTDIR="$(PKG_INSTALL_DIR)" \
|
|
176
|
+ LIBS="" \
|
|
177
|
+ sftp-server
|
|
178
|
+ $(MAKE) -C $(PKG_BUILD_DIR) \
|
|
179
|
+ DESTDIR="$(PKG_INSTALL_DIR)" \
|
|
180
|
+ STRIP_OPT="" \
|
|
181
|
+ all install
|
|
182
|
+endef
|
|
183
|
+
|
|
184
|
+define Package/openssh-client/preinst
|
|
185
|
+#!/bin/sh
|
|
186
|
+if [ -L $${IPKG_INSTROOT}/usr/bin/ssh ] && [ -L $${IPKG_INSTROOT}/usr/bin/scp ]; then
|
|
187
|
+ rm -f $${IPKG_INSTROOT}/usr/bin/ssh $${IPKG_INSTROOT}/usr/bin/scp;
|
|
188
|
+fi
|
|
189
|
+exit 0
|
|
190
|
+endef
|
|
191
|
+
|
|
192
|
+define Package/openssh-client/postrm
|
|
193
|
+#!/bin/sh
|
|
194
|
+rm -f $${IPKG_INSTROOT}/usr/bin/ssh $${IPKG_INSTROOT}/usr/bin/scp;
|
|
195
|
+if [ -x $${IPKG_INSTROOT}/usr/sbin/dropbear ] ; then
|
|
196
|
+ ln -s /usr/sbin/dropbear $${IPKG_INSTROOT}/usr/bin/ssh;
|
|
197
|
+ ln -s /usr/sbin/dropbear $${IPKG_INSTROOT}/usr/bin/scp;
|
|
198
|
+fi
|
|
199
|
+exit 0
|
|
200
|
+endef
|
|
201
|
+
|
|
202
|
+define Package/openssh-moduli/install
|
|
203
|
+ $(INSTALL_DIR) $(1)/etc/ssh
|
|
204
|
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/
|
|
205
|
+endef
|
|
206
|
+
|
|
207
|
+define Package/openssh-client/install
|
|
208
|
+ $(INSTALL_DIR) $(1)/etc/ssh
|
|
209
|
+ chmod 0700 $(1)/etc/ssh
|
|
210
|
+ $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
|
|
211
|
+ $(INSTALL_DIR) $(1)/usr/bin
|
|
212
|
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/
|
|
213
|
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/
|
|
214
|
+endef
|
|
215
|
+
|
|
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/
|
|
219
|
+endef
|
|
220
|
+
|
|
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/
|
|
224
|
+endef
|
|
225
|
+
|
|
226
|
+define Package/openssh-server/install
|
|
227
|
+ $(INSTALL_DIR) $(1)/etc/ssh
|
|
228
|
+ chmod 0700 $(1)/etc/ssh
|
|
229
|
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
|
|
230
|
+ $(INSTALL_DIR) $(1)/etc/init.d
|
|
231
|
+ $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
|
|
232
|
+ $(INSTALL_DIR) $(1)/usr/sbin
|
|
233
|
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
|
|
234
|
+endef
|
|
235
|
+
|
|
236
|
+define Package/openssh-server-pam/install
|
|
237
|
+ $(call Package/openssh-server/install,$(1))
|
|
238
|
+ sed -i 's,#PasswordAuthentication yes,PasswordAuthentication no,g' $(1)/etc/ssh/sshd_config
|
|
239
|
+ sed -i 's,#UsePAM no,UsePAM yes,g' $(1)/etc/ssh/sshd_config
|
|
240
|
+ $(INSTALL_DIR) $(1)/etc/pam.d
|
|
241
|
+ $(INSTALL_DATA) ./files/sshd.pam $(1)/etc/pam.d/sshd
|
|
242
|
+ $(INSTALL_DIR) $(1)/etc/security
|
|
243
|
+ $(INSTALL_DATA) ./files/sshd.pam-access $(1)/etc/security/access-sshd-local.conf
|
|
244
|
+endef
|
|
245
|
+
|
|
246
|
+define Package/openssh-sftp-client/install
|
|
247
|
+ $(INSTALL_DIR) $(1)/usr/bin
|
|
248
|
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
|
|
249
|
+endef
|
|
250
|
+
|
|
251
|
+define Package/openssh-sftp-server/install
|
|
252
|
+ $(INSTALL_DIR) $(1)/usr/lib
|
|
253
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
|
|
254
|
+ $(INSTALL_DIR) $(1)/usr/libexec
|
|
255
|
+ ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
|
|
256
|
+endef
|
|
257
|
+
|
|
258
|
+$(eval $(call BuildPackage,openssh-client))
|
|
259
|
+$(eval $(call BuildPackage,openssh-moduli))
|
|
260
|
+$(eval $(call BuildPackage,openssh-client-utils))
|
|
261
|
+$(eval $(call BuildPackage,openssh-keygen))
|
|
262
|
+$(eval $(call BuildPackage,openssh-server))
|
|
263
|
+$(eval $(call BuildPackage,openssh-server-pam))
|
|
264
|
+$(eval $(call BuildPackage,openssh-sftp-client))
|
|
265
|
+$(eval $(call BuildPackage,openssh-sftp-server))
|