| 1 |
# $FreeWRT$ |
| 2 |
#- |
| 3 |
# This file is part of the FreeWRT project. FreeWRT is copyrighted |
| 4 |
# material, please see the LICENCE file in the top-level directory |
| 5 |
# or at http://www.freewrt.org/licence for details. |
| 6 |
|
| 7 |
include $(TOPDIR)/rules.mk |
| 8 |
|
| 9 |
PKG_NAME:= dropbear |
| 10 |
PKG_VERSION:= 0.52 |
| 11 |
PKG_RELEASE:= 1 |
| 12 |
PKG_MD5SUM:= 1c69ec674481d7745452f68f2ea5597e |
| 13 |
PKG_INIT:= 50 |
| 14 |
PKG_SOURCE_URL:= http://matt.ucc.asn.au/dropbear/releases/ |
| 15 |
|
| 16 |
include $(TOPDIR)/mk/package.mk |
| 17 |
|
| 18 |
$(eval $(call PKG_template,DROPBEAR,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) |
| 19 |
$(eval $(call PKG_template,DBCONVERT,dropbearconvert,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) |
| 20 |
|
| 21 |
$(WRKBUILD)/.configured: |
| 22 |
$(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(WRKBUILD)/options.h |
| 23 |
$(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(WRKBUILD)/options.h |
| 24 |
(cd $(WRKBUILD); rm -rf config.cache; \ |
| 25 |
autoconf; \ |
| 26 |
$(TARGET_CONFIGURE_OPTS) \ |
| 27 |
CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ |
| 28 |
LDFLAGS="-L$(STAGING_DIR)/usr/lib" \ |
| 29 |
./configure \ |
| 30 |
--target=$(GNU_TARGET_NAME) \ |
| 31 |
--host=$(GNU_TARGET_NAME) \ |
| 32 |
--build=$(GNU_HOST_NAME) \ |
| 33 |
--program-prefix="" \ |
| 34 |
--program-suffix="" \ |
| 35 |
--prefix=/usr \ |
| 36 |
--exec-prefix=/usr \ |
| 37 |
--bindir=/usr/bin \ |
| 38 |
--datadir=/usr/share \ |
| 39 |
--includedir=/usr/include \ |
| 40 |
--infodir=/usr/share/info \ |
| 41 |
--libdir=/usr/lib \ |
| 42 |
--libexecdir=/usr/lib \ |
| 43 |
--localstatedir=/var \ |
| 44 |
--mandir=/usr/share/man \ |
| 45 |
--sbindir=/usr/sbin \ |
| 46 |
--sysconfdir=/etc \ |
| 47 |
--disable-nls \ |
| 48 |
--with-shared \ |
| 49 |
--disable-pam \ |
| 50 |
--enable-openpty \ |
| 51 |
--enable-syslog \ |
| 52 |
--disable-shadow \ |
| 53 |
--disable-lastlog \ |
| 54 |
--disable-utmp \ |
| 55 |
--disable-utmpx \ |
| 56 |
--disable-wtmp \ |
| 57 |
--disable-wtmpx \ |
| 58 |
--disable-loginfunc \ |
| 59 |
--disable-pututline \ |
| 60 |
--disable-pututxline \ |
| 61 |
--disable-zlib \ |
| 62 |
); |
| 63 |
touch $@ |
| 64 |
|
| 65 |
$(WRKBUILD)/.built: |
| 66 |
$(MAKE) -C $(WRKBUILD) \ |
| 67 |
LD="$(TARGET_CC)" \ |
| 68 |
PROGRAMS="dropbear dbclient dropbearkey scp" \ |
| 69 |
MULTI=1 SCPPROGRESS=1 |
| 70 |
$(MAKE) -C $(WRKBUILD) \ |
| 71 |
LD="$(TARGET_CC)" \ |
| 72 |
PROGRAMS="dropbearconvert" |
| 73 |
touch $@ |
| 74 |
|
| 75 |
$(IPKG_DBCONVERT): |
| 76 |
$(INSTALL_DIR) $(IDIR_DBCONVERT)/usr/bin |
| 77 |
$(INSTALL_BIN) $(WRKBUILD)/dropbearconvert \ |
| 78 |
$(IDIR_DBCONVERT)/usr/bin/dropbearconvert |
| 79 |
$(RSTRIP) $(IDIR_DBCONVERT) |
| 80 |
$(IPKG_BUILD) $(IDIR_DBCONVERT) $(PACKAGE_DIR) |
| 81 |
|
| 82 |
# evaluate startup options according to menuconfig selection |
| 83 |
DROPBEAR-OPTS-y = -g |
| 84 |
DROPBEAR-OPTS-$(FWRT_RUNTIME_SSH_DISABLE_NOTHING) = |
| 85 |
DROPBEAR-OPTS-$(FWRT_RUNTIME_SSH_DISABLE_PASSWORD_FOR_ROOT) = -g |
| 86 |
DROPBEAR-OPTS-$(FWRT_RUNTIME_SSH_DISABLE_PASSWORD) = -s |
| 87 |
DROPBEAR-OPTS-$(FWRT_RUNTIME_SSH_DISABLE_ROOT) = -w |
| 88 |
DROPBEAR-OPTS-$(FWRT_RUNTIME_SSH_DISABLE_ROOT_AND_PASSWORD) = -w -s |
| 89 |
|
| 90 |
$(IPKG_DROPBEAR): |
| 91 |
$(INSTALL_DIR) $(IDIR_DROPBEAR)/etc/init.d |
| 92 |
$(INSTALL_DIR) $(IDIR_DROPBEAR)/usr/bin |
| 93 |
$(INSTALL_DIR) $(IDIR_DROPBEAR)/usr/sbin |
| 94 |
$(INSTALL_BIN) $(WRKBUILD)/dropbearmulti \ |
| 95 |
$(IDIR_DROPBEAR)/usr/sbin/dropbear |
| 96 |
ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/scp |
| 97 |
ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/ssh |
| 98 |
ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/dbclient |
| 99 |
ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/dropbearkey |
| 100 |
$(INSTALL_BIN) ./files/dropbear.init \ |
| 101 |
$(IDIR_DROPBEAR)/etc/init.d/S$(PKG_INIT)dropbear |
| 102 |
$(SED) "s/@OPTIONS@/$(DROPBEAR-OPTS-y)/" $(IDIR_DROPBEAR)/CONTROL/postinst |
| 103 |
$(RSTRIP) $(IDIR_DROPBEAR) |
| 104 |
$(IPKG_BUILD) $(IDIR_DROPBEAR) $(PACKAGE_DIR) |