| 1 | ############################################################# |
|---|
| 2 | # |
|---|
| 3 | # dropbear |
|---|
| 4 | # |
|---|
| 5 | ############################################################# |
|---|
| 6 | |
|---|
| 7 | DROPBEAR_SOURCE_URL=http://matt.ucc.asn.au/dropbear/releases/ |
|---|
| 8 | DROPBEAR_SOURCE=dropbear-0.53.1.tar.gz |
|---|
| 9 | DROPBEAR_DIR=$(BUILD_DIR)/dropbear-0.53.1 |
|---|
| 10 | |
|---|
| 11 | DROPBEAR_PKG_DIR=$(PACKAGES_DIR)/dropbear |
|---|
| 12 | # Available are: dropbear dropbearkey dropbearconvert scp dbclient |
|---|
| 13 | DROPBEAR_PROGRAMS="dropbear dropbearkey dropbearconvert scp dbclient" |
|---|
| 14 | |
|---|
| 15 | $(DL_DIR)/$(DROPBEAR_SOURCE): |
|---|
| 16 | $(WGET) -P $(DL_DIR) $(DROPBEAR_SOURCE_URL)$(DROPBEAR_SOURCE) |
|---|
| 17 | |
|---|
| 18 | dropbear-source: $(DL_DIR)/$(DROPBEAR_SOURCE) |
|---|
| 19 | |
|---|
| 20 | $(DROPBEAR_DIR)/.unpacked: $(DL_DIR)/$(DROPBEAR_SOURCE) |
|---|
| 21 | zcat $(DL_DIR)/$(DROPBEAR_SOURCE) | \ |
|---|
| 22 | tar $(TAR_VERBOSE) -C $(BUILD_DIR) -xf - |
|---|
| 23 | touch $(DROPBEAR_DIR)/.unpacked |
|---|
| 24 | |
|---|
| 25 | $(DROPBEAR_DIR)/.configured: $(DROPBEAR_DIR)/.unpacked |
|---|
| 26 | (cd $(DROPBEAR_DIR); $(RM) -r config.cache; \ |
|---|
| 27 | ./configure --prefix=$(DROPBEAR_PKG_DIR)/usr \ |
|---|
| 28 | CFLAGS="$(TARGET_CFLAGS)" \ |
|---|
| 29 | CC="$(TARGET_CC)" \ |
|---|
| 30 | --disable-lastlog \ |
|---|
| 31 | --disable-utmp \ |
|---|
| 32 | --disable-utmpx \ |
|---|
| 33 | --disable-wtmp \ |
|---|
| 34 | --disable-wtmpx \ |
|---|
| 35 | --disable-pututline \ |
|---|
| 36 | --disable-pututxline \ |
|---|
| 37 | --disable-zlib \ |
|---|
| 38 | --disable-shadow \ |
|---|
| 39 | ); |
|---|
| 40 | $(SED) "s/^#define ENABLE_X11FWD/#define DISABLE_X11FWD/;" $(DROPBEAR_DIR)/options.h |
|---|
| 41 | # $(SED) "s/^#define ENABLE_LOCALTCPFWD/#define DISABLE_LOCALTCPFWD/;" $(DROPBEAR_DIR)/options.h |
|---|
| 42 | $(SED) "s/^#define ENABLE_REMOTETCPFWD/#define DISABLE_REMOTETCPFWD/;" $(DROPBEAR_DIR)/options.h |
|---|
| 43 | $(SED) "s/^#define ENABLE_AGENTFWD/#define DISABLE_AGENTFWD/;" $(DROPBEAR_DIR)/options.h |
|---|
| 44 | $(SED) 's/^#define DROPBEAR_AES128_CBC/\/* #define DROPBEAR_AES128_CBC *\//;' $(DROPBEAR_DIR)/options.h; |
|---|
| 45 | $(SED) "s/^#define DROPBEAR_TWOFISH128_CBC/\/* #define DROPBEAR_TWOFISH128_CBC *\//;" $(DROPBEAR_DIR)/options.h |
|---|
| 46 | $(SED) "s/^#define DROPBEAR_MD5_HMAC/\/* #define DROPBEAR_MD5_HMAC *\//;" $(DROPBEAR_DIR)/options.h |
|---|
| 47 | $(SED) "s/^#define DO_MOTD/\/* #define DO_MOTD *\//;" $(DROPBEAR_DIR)/options.h |
|---|
| 48 | $(SED) 's/^#define SFTPSERVER_PATH(.*)$$/\/* #define SFTPSERVER_PATH$$1*\//;' $(DROPBEAR_DIR)/options.h |
|---|
| 49 | $(SED) "s/^\/\* #define NO_FAST_EXPTMOD \*\//#define NO_FAST_EXPTMOD /;" $(DROPBEAR_DIR)/options.h |
|---|
| 50 | $(SED) "s|^#define INETD_MODE |/* #define INETD_MODE */|;" $(DROPBEAR_DIR)/options.h |
|---|
| 51 | # $(SED) 's|^#define DROPBEAR_RANDOM_DEV "/dev/random"|#define DROPBEAR_RANDOM_DEV "/dev/urandom"|;' $(DROPBEAR_DIR)/options.h |
|---|
| 52 | $(SED) "s/^\/\* #define DROPBEAR_SMALL_CODE/ \*\//#define DROPBEAR_SMALL_CODE/ /;" $(DROPBEAR_DIR)/options.h |
|---|
| 53 | $(SED) "s/^\/\* #define NO_FAST_EXPTMOD/ \*\//#define NO_FAST_EXPTMOD/ /;" $(DROPBEAR_DIR)/options.h |
|---|
| 54 | touch $(DROPBEAR_DIR)/.configured |
|---|
| 55 | |
|---|
| 56 | $(DROPBEAR_DIR)/dropbearmulti: $(DROPBEAR_DIR)/.configured |
|---|
| 57 | $(MAKE) -C $(DROPBEAR_DIR) PROGRAMS=$(DROPBEAR_PROGRAMS) MULTI=1 |
|---|
| 58 | |
|---|
| 59 | $(DROPBEAR_PKG_DIR)/usr/sbin/dropbear: $(DROPBEAR_DIR)/dropbearmulti |
|---|
| 60 | -$(RM) -r $(DROPBEAR_PKG_DIR) |
|---|
| 61 | mkdir -p $(DROPBEAR_PKG_DIR)/etc/dropbear |
|---|
| 62 | mkdir -p $(DROPBEAR_PKG_DIR)/usr/bin |
|---|
| 63 | mkdir -p $(DROPBEAR_PKG_DIR)/usr/sbin |
|---|
| 64 | cp -a $(DROPBEAR_DIR)/dropbearmulti $(DROPBEAR_PKG_DIR)/usr/sbin |
|---|
| 65 | -( cd $(DROPBEAR_PKG_DIR)/usr/sbin; \ |
|---|
| 66 | ln -s dropbearmulti dropbear ; $(SSTRIP) * ) |
|---|
| 67 | -( cd $(DROPBEAR_PKG_DIR)/usr/bin; \ |
|---|
| 68 | ln -s ../sbin/dropbearmulti scp ; \ |
|---|
| 69 | ln -s ../sbin/dropbearmulti dbclient ; \ |
|---|
| 70 | ln -s ../sbin/dropbearmulti dropbearconvert ; \ |
|---|
| 71 | ln -s ../sbin/dropbearmulti dropbearkey ; ) |
|---|
| 72 | cp $(PACKAGES_INI_DIR)/post-dropbear.ini $(DROPBEAR_PKG_DIR)/etc/post-dropbear.ini |
|---|
| 73 | |
|---|
| 74 | $(PACKAGES_DIR)/dropbear.bz2: $(DROPBEAR_PKG_DIR)/usr/sbin/dropbear |
|---|
| 75 | (cd $(PACKAGES_DIR); sh mkpack dropbear) |
|---|
| 76 | |
|---|
| 77 | dropbear: $(PACKAGES_DIR)/dropbear.bz2 |
|---|
| 78 | |
|---|
| 79 | dropbear-clean: |
|---|
| 80 | -$(MAKE) -C $(DROPBEAR_DIR) clean |
|---|
| 81 | -$(RM) -r $(DROPBEAR_PKG_DIR)/* |
|---|
| 82 | |
|---|
| 83 | dropbear-dirclean: |
|---|
| 84 | -$(RM) -r $(DROPBEAR_DIR) |
|---|
| 85 | -$(RM) -r $(DROPBEAR_PKG_DIR) |
|---|