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