source: packages/net/openssh/Makefile @ 20989

Last change on this file since 20989 was 20989, checked in by tripolar, 6 years ago

update openssh to 5.5p1 and
use 22 for goup/userid - the default user/groupid on most unices

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 5.5 KB
Line 
1#
2# Copyright (C) 2006,2008 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.5p1
12PKG_RELEASE:=1
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:=88633408f4cb1eb11ec7e2ec58b519eb
20
21PKG_BUILD_DEPENDS:=libopenssl
22
23include $(INCLUDE_DIR)/package.mk
24
25define Package/openssh-client
26  SECTION:=net
27  CATEGORY:=Network
28  DEPENDS:=+libopenssl +zlib
29  TITLE:=OpenSSH client
30  URL:=http://www.openssh.com/
31  SUBMENU:=SSH
32endef
33
34define Package/openssh-client/description
35OpenSSH client.
36endef
37
38define Package/openssh-client/conffiles
39/etc/ssh/ssh_config
40endef
41
42define Package/openssh-client-utils
43  SECTION:=net
44  CATEGORY:=Network
45  DEPENDS:=+openssh-client +openssh-keygen
46  TITLE:=OpenSSH client utilities
47  URL:=http://www.openssh.com/
48  SUBMENU:=SSH
49endef
50
51define Package/openssh-client-utils/description
52OpenSSH client utilities.
53endef
54
55define Package/openssh-keygen
56  SECTION:=net
57  CATEGORY:=Network
58  DEPENDS:=+libopenssl +zlib
59  TITLE:=OpenSSH keygen
60  URL:=http://www.openssh.com/
61  SUBMENU:=SSH
62endef
63
64define Package/openssh-keygen/description
65OpenSSH keygen.
66endef
67
68define Package/openssh-server
69  SECTION:=net
70  CATEGORY:=Network
71  DEPENDS:=+libopenssl +zlib +openssh-keygen
72  TITLE:=OpenSSH server
73  URL:=http://www.openssh.com/
74  SUBMENU:=SSH
75endef
76
77define Package/openssh-server/description
78OpenSSH server.
79endef
80
81define Package/openssh-server/conffiles
82/etc/ssh/sshd_config
83endef
84
85define Package/openssh-sftp-client
86  SECTION:=net
87  CATEGORY:=Network
88  DEPENDS:=+libopenssl +zlib
89  TITLE:=OpenSSH SFTP client
90  URL:=http://www.openssh.com/
91  SUBMENU:=SSH
92endef
93
94define Package/openssh-sftp-client/description
95OpenSSH SFTP client.
96endef
97
98define Package/openssh-sftp-server
99  SECTION:=net
100  CATEGORY:=Network
101  DEPENDS:=
102  TITLE:=OpenSSH SFTP server
103  URL:=http://www.openssh.com/
104  SUBMENU:=SSH
105endef
106
107define Package/openssh-sftp-server/description
108OpenSSH SFTP server.
109endef
110
111CONFIGURE_ARGS+= \
112        $(DISABLE_LARGEFILE) \
113        $(DISABLE_NLS) \
114        --sysconfdir=/etc/ssh \
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
130ifneq ($(CONFIG_SSP_SUPPORT),y)
131CONFIGURE_ARGS += \
132        --without-stackprotect
133endif
134
135CONFIGURE_VARS += LD="$(TARGET_CC)"
136
137define Build/Compile
138        $(MAKE) -C $(PKG_BUILD_DIR) \
139                DESTDIR="$(PKG_INSTALL_DIR)" \
140                LIBS="" \
141                sftp-server
142        $(MAKE) -C $(PKG_BUILD_DIR) \
143                DESTDIR="$(PKG_INSTALL_DIR)" \
144                STRIP_OPT="" \
145                all install
146endef
147
148define Package/openssh-client/install
149        $(INSTALL_DIR) $(1)/etc/ssh
150        chmod 0700 $(1)/etc/ssh
151        $(CP) $(PKG_INSTALL_DIR)/etc/ssh/ssh_config $(1)/etc/ssh/
152        $(INSTALL_DIR) $(1)/usr/bin
153        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh $(1)/usr/bin/
154        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scp $(1)/usr/bin/
155endef
156
157define Package/openssh-client-utils/install
158        $(INSTALL_DIR) $(1)/usr/bin
159        $(INSTALL_BIN) $(foreach bin,add agent keyscan keysign,$(PKG_BUILD_DIR)/ssh-$(bin)) $(1)/usr/bin/
160endef
161
162define Package/openssh-keygen/install
163        $(INSTALL_DIR) $(1)/usr/bin
164        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
165endef
166
167
168define Package/openssh-server/install
169        $(INSTALL_DIR) $(1)/etc/ssh
170        chmod 0700 $(1)/etc/ssh
171        $(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
172        $(INSTALL_DIR) $(1)/etc/init.d
173        $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
174        $(INSTALL_DIR) $(1)/usr/sbin
175        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sshd $(1)/usr/sbin/
176endef
177
178define Package/openssh-server/postinst
179#!/bin/sh
180
181name=sshd
182id=22
183
184# do not change below
185# check if we are on real system
186if [ -z "$${IPKG_INSTROOT}" ]; then
187        # create copies of passwd and group, if we use squashfs
188        rootfs=`mount |awk '/root/ { print $$5 }'`
189        if [ "$$rootfs" = "squashfs" ]; then
190                if [ -h /etc/group ]; then
191                        rm /etc/group
192                        cp /rom/etc/group /etc/group
193                fi
194                if [ -h /etc/passwd ]; then
195                        rm /etc/passwd
196                        cp /rom/etc/passwd /etc/passwd
197                fi
198        fi
199fi
200
201echo ""
202if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
203        echo "adding group $$name to /etc/group"
204        echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
205fi
206
207if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
208        echo "adding user $$name to /etc/passwd"
209        echo "$${name}:x:$${id}:$${id}:$${name}:/var/empty/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
210fi
211
212grep -q '^ssh[[:space:]]*22/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
213if [ $$? -ne 0 ]; then
214echo "ssh           22/tcp" >>$${IPKG_INSTROOT}/etc/services
215fi
216endef
217
218define Package/openssh-sftp-client/install
219        $(INSTALL_DIR) $(1)/usr/bin
220        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sftp $(1)/usr/bin/
221endef
222
223define Package/openssh-sftp-server/install
224        $(INSTALL_DIR) $(1)/usr/lib
225        $(CP) $(PKG_INSTALL_DIR)/usr/lib/sftp-server $(1)/usr/lib/
226        $(INSTALL_DIR) $(1)/usr/libexec
227        ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
228endef
229
230$(eval $(call BuildPackage,openssh-client))
231$(eval $(call BuildPackage,openssh-client-utils))
232$(eval $(call BuildPackage,openssh-keygen))
233$(eval $(call BuildPackage,openssh-server))
234$(eval $(call BuildPackage,openssh-sftp-client))
235$(eval $(call BuildPackage,openssh-sftp-server))
Note: See TracBrowser for help on using the repository browser.