summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh_6.2p2.bb')
-rw-r--r--meta/recipes-connectivity/openssh/openssh_6.2p2.bb146
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 @@
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
10PR = "r0"
11
12DEPENDS = "zlib openssl"
13DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
14
15RPROVIDES_${PN}-ssh = "ssh"
16RPROVIDES_${PN}-sshd = "sshd"
17
18RCONFLICTS_${PN} = "dropbear"
19RCONFLICTS_${PN}-sshd = "dropbear"
20RCONFLICTS_${PN}-keygen = "ssh-keygen"
21
22SRC_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
37PAM_SRC_URI = "file://sshd"
38
39SRC_URI[md5sum] = "be46174dcbb77ebb4ea88ef140685de1"
40SRC_URI[sha256sum] = "7f29b9d2ad672ae0f9e1dcbff871fc5c2e60a194e90c766432e32161b842313b"
41
42inherit useradd update-rc.d update-alternatives systemd ptest
43
44USERADD_PACKAGES = "${PN}-sshd"
45USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
46INITSCRIPT_PACKAGES = "${PN}-sshd"
47INITSCRIPT_NAME_${PN}-sshd = "sshd"
48INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
49
50SYSTEMD_PACKAGES = "${PN}-sshd"
51SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket sshd@.service sshdgenkeys.service"
52
53PACKAGECONFIG ??= "tcp-wrappers"
54PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers"
55
56inherit autotools
57
58# LFS support:
59CFLAGS += "-D__FILE_OFFSET_BITS=64"
60export LD = "${CC}"
61
62EXTRA_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.
73EXTRA_OECONF_append_libc-uclibc=" --without-pam"
74
75do_configure_prepend () {
76 if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
77 cp aclocal.m4 acinclude.m4
78 fi
79}
80
81do_compile_append () {
82 install -m 0644 ${WORKDIR}/sshd_config ${S}/
83 install -m 0644 ${WORKDIR}/ssh_config ${S}/
84}
85
86do_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
119do_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
124ALLOW_EMPTY_${PN} = "1"
125
126PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
127FILES_${PN}-scp = "${bindir}/scp.${BPN}"
128FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
129FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
130FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd"
131FILES_${PN}-sftp = "${bindir}/sftp"
132FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
133FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
134FILES_${PN}-keygen = "${bindir}/ssh-keygen"
135
136RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
137RDEPENDS_${PN}-sshd += "${PN}-keygen"
138RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
139
140CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
141CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
142
143ALTERNATIVE_PRIORITY = "90"
144ALTERNATIVE_${PN}-scp = "scp"
145ALTERNATIVE_${PN}-ssh = "ssh"
146