summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh_7.3p1.bb')
-rw-r--r--meta/recipes-connectivity/openssh/openssh_7.3p1.bb163
1 files changed, 163 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh_7.3p1.bb b/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
new file mode 100644
index 0000000000..b31972649d
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
@@ -0,0 +1,163 @@
1SUMMARY = "A suite of security-related network utilities based on \
2the SSH protocol including the ssh client and sshd server"
3DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
4Ssh (Secure Shell) is a program for logging into a remote machine \
5and for executing commands on a remote machine."
6HOMEPAGE = "http://www.openssh.com/"
7SECTION = "console/network"
8LICENSE = "BSD"
9LIC_FILES_CHKSUM = "file://LICENCE;md5=e326045657e842541d3f35aada442507"
10
11DEPENDS = "zlib openssl"
12DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
13
14SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
15 file://sshd_config \
16 file://ssh_config \
17 file://init \
18 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
19 file://sshd.socket \
20 file://sshd@.service \
21 file://sshdgenkeys.service \
22 file://volatiles.99_sshd \
23 file://add-test-support-for-busybox.patch \
24 file://run-ptest \
25 file://openssh-7.1p1-conditional-compile-des-in-cipher.patch \
26 file://openssh-7.1p1-conditional-compile-des-in-pkcs11.patch \
27 "
28
29PAM_SRC_URI = "file://sshd"
30
31SRC_URI[md5sum] = "dfadd9f035d38ce5d58a3bf130b86d08"
32SRC_URI[sha256sum] = "3ffb989a6dcaa69594c3b550d4855a5a2e1718ccdde7f5e36387b424220fbecc"
33
34inherit useradd update-rc.d update-alternatives systemd
35
36USERADD_PACKAGES = "${PN}-sshd"
37USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
38INITSCRIPT_PACKAGES = "${PN}-sshd"
39INITSCRIPT_NAME_${PN}-sshd = "sshd"
40INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
41
42SYSTEMD_PACKAGES = "${PN}-sshd"
43SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
44
45inherit autotools-brokensep ptest
46
47# LFS support:
48CFLAGS += "-D__FILE_OFFSET_BITS=64"
49
50# login path is hardcoded in sshd
51EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \
52 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
53 --without-zlib-version-check \
54 --with-privsep-path=/var/run/sshd \
55 --sysconfdir=${sysconfdir}/ssh \
56 --with-xauth=/usr/bin/xauth \
57 --disable-strip \
58 "
59
60# Since we do not depend on libbsd, we do not want configure to use it
61# just because it finds libutil.h. But, specifying --disable-libutil
62# causes compile errors, so...
63CACHED_CONFIGUREVARS += "ac_cv_header_bsd_libutil_h=no ac_cv_header_libutil_h=no"
64
65# passwd path is hardcoded in sshd
66CACHED_CONFIGUREVARS += "ac_cv_path_PATH_PASSWD_PROG=${bindir}/passwd"
67
68# We don't want to depend on libblockfile
69CACHED_CONFIGUREVARS += "ac_cv_header_maillock_h=no"
70
71# This is a workaround for uclibc because including stdio.h
72# pulls in pthreads.h and causes conflicts in function prototypes.
73# This results in compilation failure, so unless this is fixed,
74# disable pam for uclibc.
75EXTRA_OECONF_append_libc-uclibc=" --without-pam"
76
77do_configure_prepend () {
78 export LD="${CC}"
79 install -m 0644 ${WORKDIR}/sshd_config ${B}/
80 install -m 0644 ${WORKDIR}/ssh_config ${B}/
81 if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
82 cp aclocal.m4 acinclude.m4
83 fi
84}
85
86do_compile_ptest() {
87 # skip regress/unittests/ binaries: this will silently skip
88 # unittests in run-ptests which is good because they are so slow.
89 oe_runmake regress/modpipe regress/setuid-allowed regress/netcat
90}
91
92do_install_append () {
93 if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
94 install -D -m 0644 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd
95 sed -i -e 's:#UsePAM no:UsePAM yes:' ${D}${sysconfdir}/ssh/sshd_config
96 fi
97
98 if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "x11" ]; then
99 sed -i -e 's:#X11Forwarding no:X11Forwarding yes:' ${D}${sysconfdir}/ssh/sshd_config
100 fi
101
102 install -d ${D}${sysconfdir}/init.d
103 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
104 rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
105 rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
106 install -d ${D}/${sysconfdir}/default/volatiles
107 install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
108 install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir}
109
110 # Create config files for read-only rootfs
111 install -d ${D}${sysconfdir}/ssh
112 install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
113 sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
114 echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
115 echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
116 echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
117 echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
118
119 install -d ${D}${systemd_unitdir}/system
120 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
121 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
122 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
123 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
124 -e 's,@SBINDIR@,${sbindir},g' \
125 -e 's,@BINDIR@,${bindir},g' \
126 ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
127}
128
129do_install_ptest () {
130 sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libexecdir}/sftp-server|" regress/test-exec.sh
131 cp -r regress ${D}${PTEST_PATH}
132}
133
134ALLOW_EMPTY_${PN} = "1"
135
136PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
137FILES_${PN}-scp = "${bindir}/scp.${BPN}"
138FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
139FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
140FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd"
141FILES_${PN}-sftp = "${bindir}/sftp"
142FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
143FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
144FILES_${PN}-keygen = "${bindir}/ssh-keygen"
145
146RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
147RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
148RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
149
150RPROVIDES_${PN}-ssh = "ssh"
151RPROVIDES_${PN}-sshd = "sshd"
152
153RCONFLICTS_${PN} = "dropbear"
154RCONFLICTS_${PN}-sshd = "dropbear"
155RCONFLICTS_${PN}-keygen = "ssh-keygen"
156
157CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
158CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
159
160ALTERNATIVE_PRIORITY = "90"
161ALTERNATIVE_${PN}-scp = "scp"
162ALTERNATIVE_${PN}-ssh = "ssh"
163