summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh/openssh_6.4p1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh_6.4p1.bb')
-rw-r--r--meta/recipes-connectivity/openssh/openssh_6.4p1.bb136
1 files changed, 136 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh_6.4p1.bb b/meta/recipes-connectivity/openssh/openssh_6.4p1.bb
new file mode 100644
index 0000000000..859fdd615e
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh_6.4p1.bb
@@ -0,0 +1,136 @@
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
10
11DEPENDS = "zlib openssl"
12DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
13
14RPROVIDES_${PN}-ssh = "ssh"
15RPROVIDES_${PN}-sshd = "sshd"
16
17RCONFLICTS_${PN} = "dropbear"
18RCONFLICTS_${PN}-sshd = "dropbear"
19RCONFLICTS_${PN}-keygen = "ssh-keygen"
20
21SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
22 file://nostrip.patch \
23 file://sshd_config \
24 file://ssh_config \
25 file://init \
26 file://openssh-CVE-2011-4327.patch \
27 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
28 file://sshd.socket \
29 file://sshd@.service \
30 file://sshdgenkeys.service \
31 file://volatiles.99_sshd "
32
33PAM_SRC_URI = "file://sshd"
34
35SRC_URI[md5sum] = "a62b88b884df0b09b8a8c5789ac9e51b"
36SRC_URI[sha256sum] = "5530f616513b14aea3662c4c373bafd6a97a269938674c006377e381f68975d2"
37
38inherit useradd update-rc.d update-alternatives systemd
39
40USERADD_PACKAGES = "${PN}-sshd"
41USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
42INITSCRIPT_PACKAGES = "${PN}-sshd"
43INITSCRIPT_NAME_${PN}-sshd = "sshd"
44INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
45
46SYSTEMD_PACKAGES = "${PN}-sshd"
47SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket sshd@.service sshdgenkeys.service"
48
49PACKAGECONFIG ??= "tcp-wrappers"
50PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers"
51
52inherit autotools
53
54# LFS support:
55CFLAGS += "-D__FILE_OFFSET_BITS=64"
56export LD = "${CC}"
57
58EXTRA_OECONF = "--with-rand-helper=no \
59 ${@base_contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
60 --without-zlib-version-check \
61 --with-privsep-path=/var/run/sshd \
62 --sysconfdir=${sysconfdir}/ssh \
63 --with-xauth=/usr/bin/xauth"
64
65# This is a workaround for uclibc because including stdio.h
66# pulls in pthreads.h and causes conflicts in function prototypes.
67# This results in compilation failure, so unless this is fixed,
68# disable pam for uclibc.
69EXTRA_OECONF_append_libc-uclibc=" --without-pam"
70
71do_configure_prepend () {
72 if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
73 cp aclocal.m4 acinclude.m4
74 fi
75}
76
77do_compile_append () {
78 install -m 0644 ${WORKDIR}/sshd_config ${S}/
79 install -m 0644 ${WORKDIR}/ssh_config ${S}/
80}
81
82do_install_append () {
83 for i in ${DISTRO_FEATURES};
84 do
85 if [ ${i} = "pam" ]; then
86 install -d ${D}${sysconfdir}/pam.d
87 install -m 0755 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd
88 fi
89 done
90 install -d ${D}${sysconfdir}/init.d
91 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
92 rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
93 rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
94 install -d ${D}/${sysconfdir}/default/volatiles
95 install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
96
97 # Create config files for read-only rootfs
98 install -d ${D}${sysconfdir}/ssh
99 install -m 644 ${WORKDIR}/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
100 sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
101 echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
102 echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
103 echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
104
105 install -d ${D}${systemd_unitdir}/system
106 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
107 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
108 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
109 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
110 -e 's,@SBINDIR@,${sbindir},g' \
111 -e 's,@BINDIR@,${bindir},g' \
112 ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
113}
114
115ALLOW_EMPTY_${PN} = "1"
116
117PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
118FILES_${PN}-scp = "${bindir}/scp.${BPN}"
119FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
120FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
121FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd"
122FILES_${PN}-sftp = "${bindir}/sftp"
123FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
124FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
125FILES_${PN}-keygen = "${bindir}/ssh-keygen"
126
127RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
128RDEPENDS_${PN}-sshd += "${PN}-keygen"
129
130CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
131CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
132
133ALTERNATIVE_PRIORITY = "90"
134ALTERNATIVE_${PN}-scp = "scp"
135ALTERNATIVE_${PN}-ssh = "ssh"
136