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