diff options
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh_7.0p1.bb')
| -rw-r--r-- | meta/recipes-connectivity/openssh/openssh_7.0p1.bb | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh_7.0p1.bb b/meta/recipes-connectivity/openssh/openssh_7.0p1.bb new file mode 100644 index 0000000000..105875a60d --- /dev/null +++ b/meta/recipes-connectivity/openssh/openssh_7.0p1.bb | |||
| @@ -0,0 +1,148 @@ | |||
| 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] = "831883f251ac34f0ab9c812acc24ee69" | ||
| 28 | SRC_URI[sha256sum] = "fd5932493a19f4c81153d812ee4e042b49bbd3b759ab3d9344abecc2bc1485e5" | ||
| 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_install_append () { | ||
| 83 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then | ||
| 84 | install -D -m 0755 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd | ||
| 85 | sed -i -e 's:#UsePAM no:UsePAM yes:' ${WORKDIR}/sshd_config ${D}${sysconfdir}/ssh/sshd_config | ||
| 86 | fi | ||
| 87 | |||
| 88 | install -d ${D}${sysconfdir}/init.d | ||
| 89 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd | ||
| 90 | rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin | ||
| 91 | rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir} | ||
| 92 | install -d ${D}/${sysconfdir}/default/volatiles | ||
| 93 | install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd | ||
| 94 | install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir} | ||
| 95 | |||
| 96 | # Create config files for read-only rootfs | ||
| 97 | install -d ${D}${sysconfdir}/ssh | ||
| 98 | install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly | ||
| 99 | sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly | ||
| 100 | echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | ||
| 101 | echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | ||
| 102 | echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | ||
| 103 | |||
| 104 | install -d ${D}${systemd_unitdir}/system | ||
| 105 | install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system | ||
| 106 | install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system | ||
| 107 | install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system | ||
| 108 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
| 109 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
| 110 | -e 's,@BINDIR@,${bindir},g' \ | ||
| 111 | ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service | ||
| 112 | } | ||
| 113 | |||
| 114 | do_install_ptest () { | ||
| 115 | sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libdir}/${PN}/sftp-server|" regress/test-exec.sh | ||
| 116 | cp -r regress ${D}${PTEST_PATH} | ||
| 117 | } | ||
| 118 | |||
| 119 | ALLOW_EMPTY_${PN} = "1" | ||
| 120 | |||
| 121 | PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server" | ||
| 122 | FILES_${PN}-scp = "${bindir}/scp.${BPN}" | ||
| 123 | FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config" | ||
| 124 | FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system" | ||
| 125 | FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd" | ||
| 126 | FILES_${PN}-sftp = "${bindir}/sftp" | ||
| 127 | FILES_${PN}-sftp-server = "${libexecdir}/sftp-server" | ||
| 128 | FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*" | ||
| 129 | FILES_${PN}-keygen = "${bindir}/ssh-keygen" | ||
| 130 | |||
| 131 | RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen" | ||
| 132 | RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}" | ||
| 133 | RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make" | ||
| 134 | |||
| 135 | RPROVIDES_${PN}-ssh = "ssh" | ||
| 136 | RPROVIDES_${PN}-sshd = "sshd" | ||
| 137 | |||
| 138 | RCONFLICTS_${PN} = "dropbear" | ||
| 139 | RCONFLICTS_${PN}-sshd = "dropbear" | ||
| 140 | RCONFLICTS_${PN}-keygen = "ssh-keygen" | ||
| 141 | |||
| 142 | CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config" | ||
| 143 | CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config" | ||
| 144 | |||
| 145 | ALTERNATIVE_PRIORITY = "90" | ||
| 146 | ALTERNATIVE_${PN}-scp = "scp" | ||
| 147 | ALTERNATIVE_${PN}-ssh = "ssh" | ||
| 148 | |||
