source: branches/packages_10.03.1/net/openssh/Makefile @ 28265

Last change on this file since 28265 was 28265, checked in by jow, 5 years ago

[packages_10.03.1] merge r28264

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 4.8 KB
Line 
1#
2# Copyright (C) 2006,2008-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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=openssh
11PKG_VERSION:=5.8p2
12PKG_RELEASE:=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_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/
19PKG_MD5SUM:=0541579adf9d55abb15ef927048d372e
20
21PKG_BUILD_DEPENDS:=libopenssl
22
23include $(INCLUDE_DIR)/package.mk
24
25define Package/openssh/Default
26  SECTION:=net
27  CATEGORY:=Network
28  DEPENDS:=+libopenssl +zlib +libgcc
29  TITLE:=OpenSSH
30  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
31  URL:=http://www.openssh.com/
32  SUBMENU:=SSH
33endef
34
35define Package/openssh-client
36  $(call Package/openssh/Default)
37  TITLE+= client
38endef
39
40define Package/openssh-client/description
41OpenSSH client.
42endef
43
44define Package/openssh-client/conffiles
45/etc/ssh/ssh_config
46endef
47
48define Package/openssh-client-utils
49  $(call Package/openssh/Default)
50  DEPENDS+= +openssh-client +openssh-keygen
51  TITLE+= client utilities
52endef
53
54define Package/openssh-client-utils/description
55OpenSSH client utilities.
56endef
57
58define Package/openssh-keygen
59  $(call Package/openssh/Default)
60  TITLE+= keygen
61endef
62
63define Package/openssh-keygen/description
64OpenSSH keygen.
65endef
66
67define Package/openssh-server
68  $(call Package/openssh/Default)
69  DEPENDS+= +openssh-keygen
70  TITLE+= server
71endef
72
73define Package/openssh-server/description
74OpenSSH server.
75endef
76
77define Package/openssh-server/conffiles
78/etc/ssh/sshd_config
79endef
80
81define Package/openssh-sftp-client
82  $(call Package/openssh/Default)
83  TITLE+= SFTP client
84endef
85
86define Package/openssh-sftp-client/description
87OpenSSH SFTP client.
88endef
89
90define Package/openssh-sftp-server
91  $(call Package/openssh/Default)
92  DEPENDS:=+libgcc
93  TITLE+= SFTP server
94endef
95
96define Package/openssh-sftp-server/description
97OpenSSH SFTP server.
98endef
99
100CONFIGURE_ARGS+= \
101        $(DISABLE_NLS) \
102        --sysconfdir=/etc/ssh \
103        --enable-shared \
104        --disable-static \
105        --disable-debug \
106        --disable-strip \
107        --disable-etc-default-login \
108        --disable-lastlog \
109        --disable-utmp \
110        --disable-utmpx \
111        --disable-wtmp \
112        --disable-wtmpx \
113        --without-bsd-auth \
114        --without-kerberos5 \
115        --without-pam \
116        --without-x
117
118ifneq ($(CONFIG_SSP_SUPPORT),y)
119CONFIGURE_ARGS += \
120        --without-stackprotect
121endif
122
123CONFIGURE_VARS += LD="$(TARGET_CC)"
124
125define Build/Compile
126        $(MAKE) -C $(PKG_BUILD_DIR) \
127                DESTDIR="$(PKG_INSTALL_DIR)" \
128                LIBS="" \
129                sftp-server
130        $(MAKE) -C $(PKG_BUILD_DIR) \
131                DESTDIR="$(PKG_INSTALL_DIR)" \
132                STRIP_OPT="" \
133                all install
134endef
135
136define Package/openssh-client/install
137        $(INSTALL_DIR) $(1)/etc/ssh
138        chmod 0700 $(1)/etc/ssh
139        $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
140        $(INSTALL_DIR) $(1)/usr/bin
141        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/
142        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/
143endef
144
145define Package/openssh-client-utils/install
146        $(INSTALL_DIR) $(1)/usr/bin
147        $(INSTALL_BIN) $(foreach bin,add agent keyscan keysign,$(PKG_BUILD_DIR)/ssh-$(bin)) $(1)/usr/bin/
148endef
149
150define Package/openssh-keygen/install
151        $(INSTALL_DIR) $(1)/usr/bin
152        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
153endef
154
155
156define Package/openssh-server/install
157        $(INSTALL_DIR) $(1)/etc/ssh
158        chmod 0700 $(1)/etc/ssh
159        $(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
160        $(CP) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/
161        $(INSTALL_DIR) $(1)/etc/init.d
162        $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
163        $(INSTALL_DIR) $(1)/usr/sbin
164        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
165endef
166
167define Package/openssh-server/postinst
168#!/bin/sh
169
170name=sshd
171id=22
172
173if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
174        echo "adding group $$name to /etc/group"
175        echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
176fi
177
178if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
179        echo "adding user $$name to /etc/passwd"
180        echo "$${name}:x:$${id}:$${id}:$${name}:/var/empty/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
181fi
182endef
183
184define Package/openssh-sftp-client/install
185        $(INSTALL_DIR) $(1)/usr/bin
186        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
187endef
188
189define Package/openssh-sftp-server/install
190        $(INSTALL_DIR) $(1)/usr/lib
191        $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
192        $(INSTALL_DIR) $(1)/usr/libexec
193        ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
194endef
195
196$(eval $(call BuildPackage,openssh-client))
197$(eval $(call BuildPackage,openssh-client-utils))
198$(eval $(call BuildPackage,openssh-keygen))
199$(eval $(call BuildPackage,openssh-server))
200$(eval $(call BuildPackage,openssh-sftp-client))
201$(eval $(call BuildPackage,openssh-sftp-server))
Note: See TracBrowser for help on using the repository browser.