package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / dropbear / dropbear.mk
blobe7633ae8bd92ce1bdb18d0e22d1f8a3a5915bd3d
1 ################################################################################
3 # dropbear
5 ################################################################################
7 DROPBEAR_VERSION = 2015.71
8 DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
9 DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
10 DROPBEAR_LICENSE = MIT, BSD-2c-like, BSD-2c
11 DROPBEAR_LICENSE_FILES = LICENSE
12 DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert scp
13 DROPBEAR_PROGRAMS = dropbear $(DROPBEAR_TARGET_BINS)
15 ifeq ($(BR2_PACKAGE_DROPBEAR_CLIENT),y)
16 # Build dbclient, and create a convenience symlink named ssh
17 DROPBEAR_PROGRAMS += dbclient
18 DROPBEAR_TARGET_BINS += dbclient ssh
19 endif
21 DROPBEAR_MAKE = \
22 $(MAKE) MULTI=1 SCPPROGRESS=1 \
23 PROGRAMS="$(DROPBEAR_PROGRAMS)"
25 ifeq ($(BR2_STATIC_LIBS),y)
26 DROPBEAR_MAKE += STATIC=1
27 endif
29 define DROPBEAR_FIX_XAUTH
30 $(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(@D)/options.h
31 endef
33 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_FIX_XAUTH
35 define DROPBEAR_ENABLE_REVERSE_DNS
36 $(SED) 's:.*\(#define DO_HOST_LOOKUP\).*:\1:' $(@D)/options.h
37 endef
39 define DROPBEAR_BUILD_SMALL
40 $(SED) 's:.*\(#define NO_FAST_EXPTMOD\).*:\1:' $(@D)/options.h
41 endef
43 define DROPBEAR_BUILD_FEATURED
44 $(SED) 's:^#define DROPBEAR_SMALL_CODE::' $(@D)/options.h
45 $(SED) 's:.*\(#define DROPBEAR_BLOWFISH\).*:\1:' $(@D)/options.h
46 $(SED) 's:.*\(#define DROPBEAR_TWOFISH128\).*:\1:' $(@D)/options.h
47 $(SED) 's:.*\(#define DROPBEAR_TWOFISH256\).*:\1:' $(@D)/options.h
48 endef
50 define DROPBEAR_DISABLE_STANDALONE
51 $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
52 endef
54 define DROPBEAR_INSTALL_INIT_SYSTEMD
55 $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
56 $(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
57 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
58 ln -fs ../../../../usr/lib/systemd/system/dropbear.service \
59 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dropbear.service
60 endef
62 ifeq ($(BR2_USE_MMU),y)
63 define DROPBEAR_INSTALL_INIT_SYSV
64 $(INSTALL) -D -m 755 package/dropbear/S50dropbear \
65 $(TARGET_DIR)/etc/init.d/S50dropbear
66 endef
67 else
68 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_STANDALONE
69 endif
71 ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),)
72 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ENABLE_REVERSE_DNS
73 endif
75 ifeq ($(BR2_PACKAGE_DROPBEAR_SMALL),y)
76 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_BUILD_SMALL
77 DROPBEAR_CONF_OPTS += --disable-zlib
78 else
79 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_BUILD_FEATURED
80 DROPBEAR_DEPENDENCIES += zlib
81 endif
83 ifneq ($(BR2_PACKAGE_DROPBEAR_WTMP),y)
84 DROPBEAR_CONF_OPTS += --disable-wtmp
85 endif
87 ifneq ($(BR2_PACKAGE_DROPBEAR_LASTLOG),y)
88 DROPBEAR_CONF_OPTS += --disable-lastlog
89 endif
91 define DROPBEAR_INSTALL_TARGET_CMDS
92 $(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear
93 for f in $(DROPBEAR_TARGET_BINS); do \
94 ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
95 done
96 ln -snf /var/run/dropbear $(TARGET_DIR)/etc/dropbear
97 endef
99 $(eval $(autotools-package))