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