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