summaryrefslogtreecommitdiffstats
path: root/rules/dropbear.make
blob: b03f6635bb665d1fa188e5c42242ad1064d94206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Marc Kleine-Budde <kleine-budde@gmx.de> for
#                       Pengutronix e.K. <info@pengutronix.de>, Germany
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_DROPBEAR) += dropbear

#
# Paths and names
#
DROPBEAR_VERSION		= 0.43
DROPBEAR			= dropbear-$(DROPBEAR_VERSION)
DROPBEAR_SUFFIX			= tar.bz2
DROPBEAR_URL			= http://matt.ucc.asn.au/dropbear/releases/$(DROPBEAR).$(DROPBEAR_SUFFIX)
DROPBEAR_SOURCE			= $(SRCDIR)/$(DROPBEAR).$(DROPBEAR_SUFFIX)
DROPBEAR_DIR			= $(BUILDDIR)/$(DROPBEAR)


# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

dropbear_get: $(STATEDIR)/dropbear.get

$(STATEDIR)/dropbear.get: $(dropbear_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(DROPBEAR_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, DROPBEAR)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

dropbear_extract: $(STATEDIR)/dropbear.extract

$(STATEDIR)/dropbear.extract: $(dropbear_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(DROPBEAR_DIR))
	@$(call extract, DROPBEAR)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

dropbear_prepare: $(STATEDIR)/dropbear.prepare

DROPBEAR_PATH	=  PATH=$(CROSS_PATH)
DROPBEAR_ENV 	=  $(CROSS_ENV)

#
# autoconf
#
DROPBEAR_AUTOCONF	=  $(CROSS_AUTOCONF_USR)
DROPBEAR_AUTOCONF	+= --disable-nls

ifdef PTXCONF_DROPBEAR_DIS_ZLIB
DROPBEAR_AUTOCONF	+= --disable-zlib
endif

ifdef PTXCONF_DROPBEAR_DIS_OPENPTY
DROPBEAR_AUTOCONF	+= --disable-openpty
endif

ifdef PTXCONF_DROPBEAR_DIS_SYSLOG
DROPBEAR_AUTOCONF	+= --disable-syslog
endif

ifdef PTXCONF_DROPBEAR_DIS_LASTLOG
DROPBEAR_AUTOCONF	+= --disable-lastlog
endif

ifdef PTXCONF_DROPBEAR_DIS_UTMP
DROPBEAR_AUTOCONF	+= --disable-utmp
endif

ifdef PTXCONF_DROPBEAR_DIS_UTMPX
DROPBEAR_AUTOCONF	+= --disable-utmpx
endif

ifdef PTXCONF_DROPBEAR_DIS_WTMP
DROPBEAR_AUTOCONF	+= --disable-wtmp
endif

ifdef PTXCONF_DROPBEAR_DIS_WTMPX
DROPBEAR_AUTOCONF	+= --disable-wtmpx
endif

ifdef PTXCONF_DROPBEAR_DIS_LIBUTIL
DROPBEAR_AUTOCONF	+= --disable-libutil
endif

ifdef PTXCONF_DROPBEAR_DIS_PUTUTLINE
DROPBEAR_AUTOCONF	+= --disable-pututline
endif

ifdef PTXCONF_DROPBEAR_DIS_PUTUTXLINE
DROPBEAR_AUTOCONF	+= --disable-pututxline
endif

$(STATEDIR)/dropbear.prepare: $(dropbear_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(DROPBEAR_BUILDDIR))
	cd $(DROPBEAR_DIR) && \
		$(DROPBEAR_PATH) $(DROPBEAR_ENV) \
		$(DROPBEAR_DIR)/configure $(DROPBEAR_AUTOCONF)

ifdef PTXCONF_DROPBEAR_DIS_X11
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DISABLE_X11FWD)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DISABLE_X11FWD)
endif

ifdef PTXCONF_DROPBEAR_DIS_TCP
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DISABLE_TCPFWD)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DISABLE_TCPFWD)
endif

ifdef PTXCONF_DROPBEAR_DIS_AGENT
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DISABLE_AGENTFWD)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DISABLE_AGENTFWD)
endif


ifdef PTXCONF_DROPBEAR_AES128
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_AES128_CBC)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_AES128_CBC)
endif

ifdef PTXCONF_DROPBEAR_BLOWFISH
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_BLOWFISH_CBC)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_BLOWFISH_CBC)
endif

ifdef PTXCONF_DROPBEAR_TWOFISH123
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_TWOFISH128_CBC)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_TWOFISH128_CBC)
endif

ifdef PTXCONF_DROPBEAR_3DES
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_3DES_CBC)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_3DES_CBC)
endif


ifdef PTXCONF_DROPBEAR_SHA1
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_SHA1_HMAC)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_SHA1_HMAC)
endif

ifdef PTXCONF_DROPBEAR_MD5
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_MD5_HMAC)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_MD5_HMAC)
endif


ifdef PTXCONF_DROPBEAR_RSA
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_RSA)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_RSA)
endif

ifdef PTXCONF_DROPBEAR_DSS
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_DSS)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_DSS)
endif

ifdef PTXCONF_DROPBEAR_PASSWD
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_PASSWORD_AUTH)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_PASSWORD_AUTH)
endif

ifdef PTXCONF_DROPBEAR_PUBKEY
	@$(call enable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_PUBKEY_AUTH)
else
	@$(call disable_c, $(DROPBEAR_DIR)/options.h,DROPBEAR_PUBKEY_AUTH)
endif

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

dropbear_compile: $(STATEDIR)/dropbear.compile

$(STATEDIR)/dropbear.compile: $(dropbear_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(DROPBEAR_DIR) && $(DROPBEAR_ENV) $(DROPBEAR_PATH) make dropbear

ifdef PTXCONF_DROPBEAR_DROPBEAR_KEY
	cd $(DROPBEAR_DIR) && $(DROPBEAR_ENV) $(DROPBEAR_PATH) make dropbearkey
endif

ifdef PTXCONF_DROPBEAR_DROPBEAR_CONVERT
	cd $(DROPBEAR_DIR) && $(DROPBEAR_ENV) $(DROPBEAR_PATH) make dropbearconvert
endif

ifdef PTXCONF_DROPBEAR_SCP
	cd $(DROPBEAR_DIR) && $(DROPBEAR_ENV) $(DROPBEAR_PATH) make scp
endif
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

dropbear_install: $(STATEDIR)/dropbear.install

$(STATEDIR)/dropbear.install: $(dropbear_install_deps_default)
	@$(call targetinfo, $@)
	# FIXME
	# @$(call install, DROPBEAR)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

dropbear_targetinstall: $(STATEDIR)/dropbear.targetinstall

$(STATEDIR)/dropbear.targetinstall: $(dropbear_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init, dropbear)
	@$(call install_fixup, dropbear,PACKAGE,dropbear)
	@$(call install_fixup, dropbear,PRIORITY,optional)
	@$(call install_fixup, dropbear,VERSION,$(DROPBEAR_VERSION))
	@$(call install_fixup, dropbear,SECTION,base)
	@$(call install_fixup, dropbear,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, dropbear,DEPENDS,)
	@$(call install_fixup, dropbear,DESCRIPTION,missing)

ifdef PTXCONF_DROPBEAR_DROPBEAR
	@$(call install_copy, dropbear, 0, 0, 0755, \
		$(DROPBEAR_DIR)/dropbear, /usr/sbin/dropbear)
endif

ifdef PTXCONF_DROPBEAR_DROPBEAR_KEY
	@$(call install_copy, dropbear, 0, 0, 0755, \
		$(DROPBEAR_DIR)/dropbearkey, /usr/sbin/dropbearkey)
endif

ifdef PTXCONF_DROPBEAR_DROPBEAR_CONVERT
	@$(call install_copy, dropbear, 0, 0, 0755, \
		$(DROPBEAR_DIR)/dropbearconvert, /usr/sbin/dropbearconvert)
endif

ifdef PTXCONF_DROPBEAR_SCP
	@$(call install_copy, dropbear, 0, 0, 0755, \
		$(DROPBEAR_DIR)/scp, /usr/bin/scp)
endif

ifdef PTXCONF_ROOTFS_ETC_INITD_DROPBEAR
ifdef PTXCONF_ROOTFS_ETC_INITD_DROPBEAR_DEFAULT
# install generic one
	@$(call install_copy, dropbear, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/etc/init.d/dropbear, \
		/etc/init.d/dropbear, n)
endif
ifdef PTXCONF_ROOTFS_ETC_INITD_DROPBEAR_USER
# install users one
	@$(call install_copy, dropbear, 0, 0, 0755, \
		${PTXDIST_WORKSPACE}/projectroot/etc/init.d/dropbear, \
		/etc/init.d/dropbear, n)
endif
#
# FIXME: Is this packet the right location for the link?
#
ifneq ($(PTXCONF_ROOTFS_ETC_INITD_DROPBEAR_LINK),"")
	@$(call install_link, dropbear, ../init.d/dropbear, \
		/etc/rc.d/$(PTXCONF_ROOTFS_ETC_INITD_DROPBEAR_LINK))
endif
endif

	@$(call install_copy, dropbear, 0, 0, 0755, /etc/dropbear)

	@$(call install_finish, dropbear)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

dropbear_clean:
	rm -rf $(STATEDIR)/dropbear.*
	rm -rf $(IMAGEDIR)/dropbear_*
	rm -rf $(DROPBEAR_DIR)

# vim: syntax=make