1 #############################################################
5 #############################################################
7 OPENSSH_SITE
:=ftp
://ftp.tux.org
/bsd
/openbsd
/OpenSSH
/portable
/
8 OPENSSH_DIR
:=$(BUILD_DIR
)/openssh-3.8p1
9 OPENSSH_SOURCE
:=openssh-3.8p1.
tar.gz
10 OPENSSH_PATCH
:=$(SOURCE_DIR
)/openssh.patch
12 OPENSSH_IPK_DIR
:=$(BUILD_DIR
)/openssh-3.8p1-ipk
13 OPENSSH_SERVER_IPK
:=$(BUILD_DIR
)/openssh-server_3.8p1-1_mipsel.ipk
14 OPENSSH_CLIENT_IPK
:=$(BUILD_DIR
)/openssh-client_3.8p1-1_mipsel.ipk
15 OPENSSH_SFTP_SERVER_IPK
:=$(BUILD_DIR
)/openssh-sftp-server_3.8p1-1_mipsel.ipk
16 OPENSSH_SFTP_CLIENT_IPK
:=$(BUILD_DIR
)/openssh-sftp-client_3.8p1-1_mipsel.ipk
17 OPENSSH_CLIENT_EX_IPK
:=$(BUILD_DIR
)/openssh-client-extras_3.8p1-1_mipsel.ipk
19 $(DL_DIR
)/$(OPENSSH_SOURCE
):
20 $(WGET
) -P
$(DL_DIR
) $(OPENSSH_SITE
)/$(OPENSSH_SOURCE
)
22 $(OPENSSH_DIR
)/.unpacked
: $(DL_DIR
)/$(OPENSSH_SOURCE
) $(OPENSSH_PATCH
)
23 zcat
$(DL_DIR
)/$(OPENSSH_SOURCE
) |
tar -C
$(BUILD_DIR
) -xvf
-
24 cat
$(OPENSSH_PATCH
) | patch
-p1
-d
$(OPENSSH_DIR
)
25 touch
$(OPENSSH_DIR
)/.unpacked
27 $(OPENSSH_DIR
)/.configured
: $(OPENSSH_DIR
)/.unpacked
28 (cd
$(OPENSSH_DIR
); rm -rf config.cache
; autoconf
; \
29 $(TARGET_CONFIGURE_OPTS
) \
30 LD
=$(TARGET_CROSS
)gcc \
31 CFLAGS
="$(TARGET_CFLAGS)" \
33 --target
=$(GNU_TARGET_NAME
) \
34 --host
=$(GNU_TARGET_NAME
) \
35 --build
=$(GNU_HOST_NAME
) \
40 --libexecdir
=/usr
/sbin \
42 --datadir=/usr
/share \
43 --localstatedir
=/var \
46 --includedir=$(STAGING_DIR
)/include \
47 --disable-lastlog
--disable-utmp \
48 --disable-utmpx
--disable-wtmp
--disable-wtmpx \
51 $(DISABLE_LARGEFILE
) \
53 touch
$(OPENSSH_DIR
)/.configured
55 $(OPENSSH_DIR
)/ssh
: $(OPENSSH_DIR
)/.configured
56 $(MAKE
) CC
=$(TARGET_CC
) -C
$(OPENSSH_DIR
)
57 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/scp
58 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/sftp
59 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/sftp-server
60 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/ssh
61 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/ssh-add
62 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/ssh-agent
63 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/ssh-keygen
64 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/ssh-keyscan
65 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/ssh-keysign
66 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/ssh-rand-helper
67 -$(STRIP
) --strip-unneeded
$(OPENSSH_DIR
)/sshd
69 $(TARGET_DIR
)/usr
/bin
/ssh
: $(OPENSSH_DIR
)/ssh
70 $(MAKE
) CC
=$(TARGET_CC
) DESTDIR
=$(TARGET_DIR
) -C
$(OPENSSH_DIR
) install
71 mkdir
-p
$(TARGET_DIR
)/etc
/init.d
/
72 cp
$(OPENSSH_DIR
)/S50sshd
$(TARGET_DIR
)/etc
/init.d
/
73 chmod a
+x
$(TARGET_DIR
)/etc
/init.d
/S50sshd
74 rm -rf
$(TARGET_DIR
)/usr
/info $(TARGET_DIR
)/usr
/man
$(TARGET_DIR
)/usr
/share
/doc
75 # since this is the embedded build, keep things to minimum
76 rm $(TARGET_DIR
)/etc
/moduli
77 rm $(TARGET_DIR
)/usr
/bin
/sftp
78 rm $(TARGET_DIR
)/usr
/bin
/ssh-add
79 rm $(TARGET_DIR
)/usr
/bin
/ssh-agent
80 rm $(TARGET_DIR
)/usr
/bin
/ssh-keyscan
81 rm $(TARGET_DIR
)/usr
/sbin
/sftp-server
82 rm $(TARGET_DIR
)/usr
/sbin
/ssh-keysign
84 openssh
: $(TARGET_DIR
)/usr
/bin
/ssh
86 $(OPENSSH_IPK_DIR
)/usr
/bin
/ssh
: $(OPENSSH_DIR
)/ssh
87 $(MAKE
) CC
=$(TARGET_CC
) DESTDIR
=$(OPENSSH_IPK_DIR
) -C
$(OPENSSH_DIR
) install
88 mkdir
-p
$(OPENSSH_IPK_DIR
)/etc
/init.d
/
89 cp
$(OPENSSH_DIR
)/S50sshd
$(OPENSSH_IPK_DIR
)/etc
/init.d
/
90 chmod a
+x
$(OPENSSH_IPK_DIR
)/etc
/init.d
/S50sshd
91 rm -rf
$(OPENSSH_IPK_DIR
)/usr
/info $(OPENSSH_IPK_DIR
)/usr
/man
$(OPENSSH_IPK_DIR
)/usr
/share
/doc
93 $(OPENSSH_SERVER_IPK
): $(OPENSSH_IPK_DIR
)/usr
/bin
/ssh
94 rm -rf
$(OPENSSH_IPK_DIR
)/build
95 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/CONTROL
96 cp
$(SOURCE_DIR
)/openssh.server.control
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/control
97 cp
$(SOURCE_DIR
)/openssh.server.conffiles
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/conffiles
98 cp
$(SOURCE_DIR
)/openssh.server.preinst
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/preinst
99 chmod a
+x
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/preinst
100 cp
$(SOURCE_DIR
)/openssh.server.postinst
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/postinst
101 chmod a
+x
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/postinst
102 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/etc
/init.d
103 cp
$(SOURCE_DIR
)/openssh.server.sshd_config
$(OPENSSH_IPK_DIR
)/build
/etc
/sshd_config
104 cp
$(SOURCE_DIR
)/openssh.server.S50sshd-ipk
$(OPENSSH_IPK_DIR
)/build
/etc
/init.d
/S50sshd
105 chmod a
+x
$(OPENSSH_IPK_DIR
)/build
/etc
/init.d
/S50sshd
106 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/usr
/sbin
107 cp
$(OPENSSH_IPK_DIR
)/usr
/sbin
/sshd
$(OPENSSH_IPK_DIR
)/build
/usr
/sbin
108 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
109 cp
$(OPENSSH_IPK_DIR
)/usr
/bin
/ssh-keygen
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
110 cd
$(BUILD_DIR
); $(STAGING_DIR
)/bin
/ipkg-build
-c
-o root
-g root
$(OPENSSH_IPK_DIR
)/build
111 rm -rf
$(OPENSSH_IPK_DIR
)/build
113 $(OPENSSH_CLIENT_IPK
): $(OPENSSH_IPK_DIR
)/usr
/bin
/ssh
114 rm -rf
$(OPENSSH_IPK_DIR
)/build
115 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/CONTROL
116 cp
$(SOURCE_DIR
)/openssh.client.control
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/control
117 cp
$(SOURCE_DIR
)/openssh.client.conffiles
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/conffiles
118 cp
$(SOURCE_DIR
)/openssh.client.preinst
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/preinst
119 chmod a
+x
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/preinst
120 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/etc
121 cp
$(SOURCE_DIR
)/openssh.client.ssh_config
$(OPENSSH_IPK_DIR
)/build
/etc
/ssh_config
122 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
123 cp
$(OPENSSH_IPK_DIR
)/usr
/bin
/ssh
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
124 cp
$(OPENSSH_IPK_DIR
)/usr
/bin
/scp
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
125 cd
$(BUILD_DIR
); $(STAGING_DIR
)/bin
/ipkg-build
-c
-o root
-g root
$(OPENSSH_IPK_DIR
)/build
126 rm -rf
$(OPENSSH_IPK_DIR
)/build
128 $(OPENSSH_SFTP_SERVER_IPK
): $(OPENSSH_IPK_DIR
)/usr
/bin
/ssh
129 rm -rf
$(OPENSSH_IPK_DIR
)/build
130 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/CONTROL
131 cp
$(SOURCE_DIR
)/openssh.sftp-server.control
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/control
132 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/usr
/sbin
133 cp
$(OPENSSH_IPK_DIR
)/usr
/sbin
/sftp-server
$(OPENSSH_IPK_DIR
)/build
/usr
/sbin
134 cd
$(BUILD_DIR
); $(STAGING_DIR
)/bin
/ipkg-build
-c
-o root
-g root
$(OPENSSH_IPK_DIR
)/build
135 rm -rf
$(OPENSSH_IPK_DIR
)/build
137 $(OPENSSH_SFTP_CLIENT_IPK
): $(OPENSSH_IPK_DIR
)/usr
/bin
/ssh
138 rm -rf
$(OPENSSH_IPK_DIR
)/build
139 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/CONTROL
140 cp
$(SOURCE_DIR
)/openssh.sftp-client.control
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/control
141 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
142 cp
$(OPENSSH_IPK_DIR
)/usr
/bin
/sftp
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
143 cd
$(BUILD_DIR
); $(STAGING_DIR
)/bin
/ipkg-build
-c
-o root
-g root
$(OPENSSH_IPK_DIR
)/build
144 rm -rf
$(OPENSSH_IPK_DIR
)/build
146 $(OPENSSH_CLIENT_EX_IPK
): $(OPENSSH_IPK_DIR
)/usr
/bin
/ssh
147 rm -rf
$(OPENSSH_IPK_DIR
)/build
148 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/CONTROL
149 cp
$(SOURCE_DIR
)/openssh.client.ex.control
$(OPENSSH_IPK_DIR
)/build
/CONTROL
/control
150 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
151 cp
$(OPENSSH_IPK_DIR
)/usr
/bin
/ssh-add
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
152 cp
$(OPENSSH_IPK_DIR
)/usr
/bin
/ssh-agent
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
153 cp
$(OPENSSH_IPK_DIR
)/usr
/bin
/ssh-keyscan
$(OPENSSH_IPK_DIR
)/build
/usr
/bin
154 mkdir
-p
$(OPENSSH_IPK_DIR
)/build
/usr
/sbin
155 cp
$(OPENSSH_IPK_DIR
)/usr
/sbin
/ssh-keysign
$(OPENSSH_IPK_DIR
)/build
/usr
/sbin
156 cd
$(BUILD_DIR
); $(STAGING_DIR
)/bin
/ipkg-build
-c
-o root
-g root
$(OPENSSH_IPK_DIR
)/build
157 rm -rf
$(OPENSSH_IPK_DIR
)/build
159 openssh-ipk
: $(OPENSSH_SERVER_IPK
) $(OPENSSH_CLIENT_IPK
) \
160 $(OPENSSH_SFTP_SERVER_IPK
) $(OPENSSH_SFTP_CLIENT_IPK
) \
161 $(OPENSSH_CLIENT_EX_IPK
)
163 openssh-source
: $(DL_DIR
)/$(OPENSSH_SOURCE
)
166 $(MAKE
) -C
$(OPENSSH_DIR
) clean
169 rm -rf
$(OPENSSH_DIR
)