]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/openssh/openssh.mk
f9167e504d77f63ed0aee9059cc0136189379b3b
[coffee/buildroot.git] / package / openssh / openssh.mk
1 ################################################################################
2 #
3 # openssh
4 #
5 ################################################################################
6
7 OPENSSH_VERSION = 7.5p1
8 OPENSSH_SITE = http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable
9 OPENSSH_LICENSE = BSD-3c, BSD-2c, Public Domain
10 OPENSSH_LICENSE_FILES = LICENCE
11 # Autoreconf needed due to the following patches modifying configure.ac:
12 # 0001-configure-ac-detect-mips-abi.patch
13 # 0002-configure-ac-properly-set-seccomp-audit-arch-for-mips64.patch
14 OPENSSH_AUTORECONF = YES
15 OPENSSH_CONF_ENV = LD="$(TARGET_CC)" LDFLAGS="$(TARGET_CFLAGS)"
16 OPENSSH_CONF_OPTS = \
17         --sysconfdir=/etc/ssh \
18         --disable-lastlog \
19         --disable-utmp \
20         --disable-utmpx \
21         --disable-wtmp \
22         --disable-wtmpx \
23         --disable-strip
24
25 define OPENSSH_USERS
26         sshd -1 sshd -1 * - - - SSH drop priv user
27 endef
28
29 ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
30 OPENSSH_CONF_OPTS += --without-pie
31 endif
32
33 OPENSSH_DEPENDENCIES = zlib openssl
34
35 ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
36 define OPENSSH_INSTALL_PAM_CONF
37         $(INSTALL) -D -m 644 $(@D)/contrib/sshd.pam.generic $(TARGET_DIR)/etc/pam.d/sshd
38         $(SED) '\%password   required     /lib/security/pam_cracklib.so%d' $(TARGET_DIR)/etc/pam.d/sshd
39         $(SED) 's/\#UsePAM no/UsePAM yes/' $(TARGET_DIR)/etc/ssh/sshd_config
40 endef
41
42 OPENSSH_DEPENDENCIES += linux-pam
43 OPENSSH_CONF_OPTS += --with-pam
44 OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_PAM_CONF
45 else
46 OPENSSH_CONF_OPTS += --without-pam
47 endif
48
49 ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
50 OPENSSH_DEPENDENCIES += libselinux
51 OPENSSH_CONF_OPTS += --with-selinux
52 else
53 OPENSSH_CONF_OPTS += --without-selinux
54 endif
55
56 define OPENSSH_INSTALL_INIT_SYSTEMD
57         $(INSTALL) -D -m 644 package/openssh/sshd.service \
58                 $(TARGET_DIR)/usr/lib/systemd/system/sshd.service
59         mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
60         ln -fs ../../../../usr/lib/systemd/system/sshd.service \
61                 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshd.service
62 endef
63
64 define OPENSSH_INSTALL_INIT_SYSV
65         $(INSTALL) -D -m 755 package/openssh/S50sshd \
66                 $(TARGET_DIR)/etc/init.d/S50sshd
67 endef
68
69 $(eval $(autotools-package))