openssh dependency fix
[openwrt/svn-archive/archive.git] / net / openssh / Makefile
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.0p1
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:=3c9347aa67862881c5da3f3b1c08da7b
20
21 PKG_BUILD_DEPENDS:=libopenssl
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/openssh/Default
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+libopenssl +zlib +SSP_SUPPORT:libssp
29 TITLE:=OpenSSH
30 MAINTAINER:=Peter Wagner <tripolar@gmx.at>
31 URL:=http://www.openssh.com/
32 SUBMENU:=SSH
33 endef
34
35 define Package/openssh-moduli
36 $(call Package/openssh/Default)
37 DEPENDS+= +openssh-server
38 TITLE+= moduli file
39 endef
40
41 define Package/openssh-moduli/description
42 OpenSSH server moduli file.
43 endef
44
45
46 define Package/openssh-client
47 $(call Package/openssh/Default)
48 TITLE+= client
49 endef
50
51 define Package/openssh-client/description
52 OpenSSH client.
53 endef
54
55 define Package/openssh-client/conffiles
56 /etc/ssh/ssh_config
57 endef
58
59 define Package/openssh-client-utils
60 $(call Package/openssh/Default)
61 DEPENDS+= +openssh-client +openssh-keygen
62 TITLE+= client utilities
63 endef
64
65 define Package/openssh-client-utils/description
66 OpenSSH client utilities.
67 endef
68
69 define Package/openssh-keygen
70 $(call Package/openssh/Default)
71 TITLE+= keygen
72 endef
73
74 define Package/openssh-keygen/description
75 OpenSSH keygen.
76 endef
77
78 define Package/openssh-server
79 $(call Package/openssh/Default)
80 DEPENDS+= +openssh-keygen
81 TITLE+= server
82 endef
83
84 define Package/openssh-server/description
85 OpenSSH server.
86 endef
87
88 define Package/openssh-server/conffiles
89 /etc/ssh/sshd_config
90 endef
91
92 define Package/openssh-sftp-client
93 $(call Package/openssh/Default)
94 TITLE+= SFTP client
95 endef
96
97 define Package/openssh-sftp-client/description
98 OpenSSH SFTP client.
99 endef
100
101 define Package/openssh-sftp-server
102 $(call Package/openssh/Default)
103 TITLE+= SFTP server
104 endef
105
106 define Package/openssh-sftp-server/description
107 OpenSSH SFTP server.
108 endef
109
110 CONFIGURE_ARGS+= \
111 $(DISABLE_NLS) \
112 --sysconfdir=/etc/ssh \
113 --with-privsep-user=sshd \
114 --with-privsep-path=/var/empty \
115 --enable-shared \
116 --disable-static \
117 --disable-debug \
118 --disable-strip \
119 --disable-etc-default-login \
120 --disable-lastlog \
121 --disable-utmp \
122 --disable-utmpx \
123 --disable-wtmp \
124 --disable-wtmpx \
125 --without-bsd-auth \
126 --without-kerberos5 \
127 --without-pam \
128 --without-x
129
130 ifeq ($(CONFIG_OPENSSL_ENGINE),y)
131 CONFIGURE_ARGS+= \
132 --with-ssl-engine
133 endif
134
135 ifneq ($(CONFIG_SSP_SUPPORT),y)
136 CONFIGURE_ARGS += \
137 --without-stackprotect
138 endif
139
140 CONFIGURE_VARS += LD="$(TARGET_CC)"
141
142 define Build/Compile
143 $(MAKE) -C $(PKG_BUILD_DIR) \
144 DESTDIR="$(PKG_INSTALL_DIR)" \
145 LIBS="" \
146 sftp-server
147 $(MAKE) -C $(PKG_BUILD_DIR) \
148 DESTDIR="$(PKG_INSTALL_DIR)" \
149 STRIP_OPT="" \
150 all install
151 endef
152
153 define Package/openssh-moduli/install
154 $(INSTALL_DIR) $(1)/etc/ssh
155 $(CP) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/
156 endef
157
158 define Package/openssh-client/install
159 $(INSTALL_DIR) $(1)/etc/ssh
160 chmod 0700 $(1)/etc/ssh
161 $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
162 $(INSTALL_DIR) $(1)/usr/bin
163 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/
164 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/
165 endef
166
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
172 define Package/openssh-keygen/install
173 $(INSTALL_DIR) $(1)/usr/bin
174 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
175 endef
176
177
178 define Package/openssh-server/install
179 $(INSTALL_DIR) $(1)/etc/ssh
180 chmod 0700 $(1)/etc/ssh
181 $(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
182 $(INSTALL_DIR) $(1)/etc/init.d
183 $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
184 $(INSTALL_DIR) $(1)/usr/sbin
185 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
186 endef
187
188 define Package/openssh-sftp-client/install
189 $(INSTALL_DIR) $(1)/usr/bin
190 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
191 endef
192
193 define Package/openssh-sftp-server/install
194 $(INSTALL_DIR) $(1)/usr/lib
195 $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
196 $(INSTALL_DIR) $(1)/usr/libexec
197 ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
198 endef
199
200 $(eval $(call BuildPackage,openssh-client))
201 $(eval $(call BuildPackage,openssh-moduli))
202 $(eval $(call BuildPackage,openssh-client-utils))
203 $(eval $(call BuildPackage,openssh-keygen))
204 $(eval $(call BuildPackage,openssh-server))
205 $(eval $(call BuildPackage,openssh-sftp-client))
206 $(eval $(call BuildPackage,openssh-sftp-server))