2008-07-24 07:24:52 +02:00
|
|
|
#
|
2016-01-15 12:24:09 +01:00
|
|
|
# Copyright (C) 2006-2016 OpenWrt.org
|
2006-06-27 02:35:46 +02:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-21 09:12:49 +01:00
|
|
|
|
2005-03-06 04:53:29 +01:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2005-04-14 09:08:14 +02:00
|
|
|
PKG_NAME:=dropbear
|
2016-01-15 12:24:09 +01:00
|
|
|
PKG_VERSION:=2015.71
|
2016-02-08 15:28:57 +01:00
|
|
|
PKG_RELEASE:=2
|
2005-03-21 09:12:49 +01:00
|
|
|
|
2011-11-25 01:53:19 +01:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
2008-07-24 07:24:52 +02:00
|
|
|
PKG_SOURCE_URL:= \
|
2013-10-15 15:10:32 +02:00
|
|
|
http://matt.ucc.asn.au/dropbear/releases/ \
|
|
|
|
https://dropbear.nl/mirror/releases/
|
2016-01-15 12:24:09 +01:00
|
|
|
PKG_MD5SUM:=2ccc0a2f3e37ca221db12c5af6a88137
|
2005-03-06 04:53:29 +01:00
|
|
|
|
2012-10-19 17:34:28 +02:00
|
|
|
PKG_LICENSE:=MIT
|
|
|
|
PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE
|
|
|
|
|
2010-09-07 12:00:34 +02:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
2014-08-21 13:29:04 +02:00
|
|
|
PKG_USE_MIPS16:=0
|
2010-09-07 12:00:34 +02:00
|
|
|
|
2016-02-08 15:28:57 +01:00
|
|
|
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_CURVE25519
|
2014-03-29 17:59:26 +01:00
|
|
|
|
2006-06-21 04:32:39 +02:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2005-03-06 04:53:29 +01:00
|
|
|
|
2016-02-08 15:28:57 +01:00
|
|
|
ifneq ($(DUMP),1)
|
|
|
|
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) echo $(CONFIG_TARGET_INIT_PATH) | md5s)
|
|
|
|
endif
|
|
|
|
|
2006-09-23 19:41:58 +02:00
|
|
|
define Package/dropbear/Default
|
|
|
|
URL:=http://matt.ucc.asn.au/dropbear/
|
|
|
|
endef
|
|
|
|
|
2014-03-29 17:59:26 +01:00
|
|
|
define Package/dropbear/config
|
|
|
|
source "$(SOURCE)/Config.in"
|
|
|
|
endef
|
|
|
|
|
2006-05-10 21:06:22 +02:00
|
|
|
define Package/dropbear
|
2006-09-23 19:41:58 +02:00
|
|
|
$(call Package/dropbear/Default)
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Base system
|
|
|
|
TITLE:=Small SSH2 client/server
|
2007-09-07 10:34:51 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/dropbear/description
|
|
|
|
A small SSH2 server/client designed for small memory environments.
|
2006-05-10 21:06:22 +02:00
|
|
|
endef
|
2005-04-14 09:08:14 +02:00
|
|
|
|
2009-02-03 23:28:16 +01:00
|
|
|
define Package/dropbear/conffiles
|
|
|
|
/etc/dropbear/dropbear_rsa_host_key
|
|
|
|
/etc/config/dropbear
|
|
|
|
endef
|
|
|
|
|
2006-05-10 21:06:22 +02:00
|
|
|
define Package/dropbearconvert
|
2006-09-23 19:41:58 +02:00
|
|
|
$(call Package/dropbear/Default)
|
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Utilities
|
|
|
|
TITLE:=Utility for converting SSH keys
|
2006-05-10 21:06:22 +02:00
|
|
|
endef
|
|
|
|
|
2007-02-26 00:34:57 +01:00
|
|
|
CONFIGURE_ARGS += \
|
|
|
|
--disable-pam \
|
|
|
|
--enable-openpty \
|
|
|
|
--enable-syslog \
|
2008-09-30 02:56:55 +02:00
|
|
|
$(if $(CONFIG_SHADOW_PASSWORDS),,--disable-shadow) \
|
2007-02-26 00:34:57 +01:00
|
|
|
--disable-lastlog \
|
2016-04-27 11:13:58 +02:00
|
|
|
$(if $(CONFIG_DROPBEAR_UTMP),,--disable-utmp) \
|
2007-02-26 00:34:57 +01:00
|
|
|
--disable-wtmp \
|
|
|
|
--disable-wtmpx \
|
|
|
|
--disable-loginfunc \
|
2016-04-27 11:13:58 +02:00
|
|
|
$(if $(CONFIG_DROPBEAR_PUTUTLINE),,--disable-pututline) \
|
2007-02-26 00:34:57 +01:00
|
|
|
--disable-pututxline \
|
2011-03-02 15:20:51 +01:00
|
|
|
--disable-zlib \
|
|
|
|
--enable-bundled-libtom
|
2007-02-26 00:34:57 +01:00
|
|
|
|
2016-02-08 15:28:57 +01:00
|
|
|
TARGET_CFLAGS += -DDEFAULT_PATH=\\\"$(TARGET_INIT_PATH)\\\" -DARGTYPE=3 -ffunction-sections -fdata-sections
|
2011-03-02 13:47:52 +01:00
|
|
|
TARGET_LDFLAGS += -Wl,--gc-sections
|
2011-02-13 17:54:44 +01:00
|
|
|
|
2014-03-29 18:10:52 +01:00
|
|
|
define Build/Configure
|
|
|
|
$(Build/Configure/Default)
|
|
|
|
|
2016-02-08 15:28:57 +01:00
|
|
|
$(SED) 's,^#define DEFAULT_PATH .*$$$$,#define DEFAULT_PATH "$(TARGET_INIT_PATH)",g' \
|
|
|
|
$(PKG_BUILD_DIR)/options.h
|
|
|
|
|
2016-01-10 23:38:53 +01:00
|
|
|
awk 'BEGIN { rc = 1 } \
|
|
|
|
/'DROPBEAR_CURVE25519'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_CURVE25519),,// )#define 'DROPBEAR_CURVE25519'"; rc = 0 } \
|
|
|
|
{ print } \
|
|
|
|
END { exit(rc) }' $(PKG_BUILD_DIR)/options.h \
|
|
|
|
>$(PKG_BUILD_DIR)/options.h.new && \
|
|
|
|
mv $(PKG_BUILD_DIR)/options.h.new $(PKG_BUILD_DIR)/options.h
|
|
|
|
|
2014-03-29 17:59:26 +01:00
|
|
|
# Enforce that all replacements are made, otherwise options.h has changed
|
|
|
|
# format and this logic is broken.
|
2016-01-10 23:38:53 +01:00
|
|
|
for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH; do \
|
2014-03-29 17:59:26 +01:00
|
|
|
awk 'BEGIN { rc = 1 } \
|
|
|
|
/'$$$$OPTION'/ { $$$$0 = "$(if $(CONFIG_DROPBEAR_ECC),,// )#define '$$$$OPTION'"; rc = 0 } \
|
|
|
|
{ print } \
|
|
|
|
END { exit(rc) }' $(PKG_BUILD_DIR)/options.h \
|
|
|
|
>$(PKG_BUILD_DIR)/options.h.new && \
|
|
|
|
mv $(PKG_BUILD_DIR)/options.h.new $(PKG_BUILD_DIR)/options.h || exit 1; \
|
|
|
|
done
|
2016-02-08 15:28:57 +01:00
|
|
|
|
|
|
|
# Enforce rebuild of svr-chansession.c
|
|
|
|
rm -f $(PKG_BUILD_DIR)/svr-chansession.o
|
2014-03-29 17:59:26 +01:00
|
|
|
endef
|
|
|
|
|
2006-05-11 19:33:51 +02:00
|
|
|
define Build/Compile
|
2012-09-23 11:50:01 +02:00
|
|
|
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
2006-08-04 07:30:27 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2006-01-31 14:33:25 +01:00
|
|
|
PROGRAMS="dropbear dbclient dropbearkey scp" \
|
2005-04-14 09:08:14 +02:00
|
|
|
MULTI=1 SCPPROGRESS=1
|
2012-09-23 11:50:01 +02:00
|
|
|
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
2006-08-04 07:30:27 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2006-01-31 14:33:25 +01:00
|
|
|
PROGRAMS="dropbearconvert"
|
2006-05-10 21:06:22 +02:00
|
|
|
endef
|
2008-07-24 07:24:52 +02:00
|
|
|
|
2006-05-10 21:06:22 +02:00
|
|
|
define Package/dropbear/install
|
2006-11-23 01:29:07 +01:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2007-08-11 23:53:15 +02:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti $(1)/usr/sbin/dropbear
|
2006-11-23 01:29:07 +01:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2014-11-06 20:35:34 +01:00
|
|
|
$(LN) ../sbin/dropbear $(1)/usr/bin/scp
|
|
|
|
$(LN) ../sbin/dropbear $(1)/usr/bin/ssh
|
|
|
|
$(LN) ../sbin/dropbear $(1)/usr/bin/dbclient
|
|
|
|
$(LN) ../sbin/dropbear $(1)/usr/bin/dropbearkey
|
2006-11-23 01:29:07 +01:00
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
2007-01-04 17:51:41 +01:00
|
|
|
$(INSTALL_DATA) ./files/dropbear.config $(1)/etc/config/dropbear
|
2006-11-23 01:29:07 +01:00
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
|
2008-08-16 08:35:14 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/opkg/info
|
2009-02-03 23:28:16 +01:00
|
|
|
$(INSTALL_DIR) $(1)/etc/dropbear
|
|
|
|
touch $(1)/etc/dropbear/dropbear_rsa_host_key
|
2006-05-10 21:06:22 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/dropbearconvert/install
|
2006-11-23 01:29:07 +01:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2007-08-11 23:53:15 +02:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearconvert $(1)/usr/bin/dropbearconvert
|
2006-05-10 21:06:22 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,dropbear))
|
|
|
|
$(eval $(call BuildPackage,dropbearconvert))
|