1 DEPENDS = "zlib openssl"
3 RCONFLICTS_${PN} = "dropbear"
4 RCONFLICTS_${PN}-sshd = "dropbear"
5 RCONFLICTS_${PN}-keygen = "ssh-keygen"
7 SECTION = "console/network"
8 DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
9 Ssh (Secure Shell) is a program for logging into a remote machine \
10 and for executing commands on a remote machine. \
11 It provides secure encrypted communications between two untrusted \
12 hosts over an insecure network. X11 connections and arbitrary TCP/IP \
13 ports can also be forwarded over the secure channel. \
14 It is intended as a replacement for rlogin, rsh and rcp, and can be \
15 used to provide applications with a secure communication channel."
16 HOMEPAGE = "http://www.openssh.org/"
23 export ASKPASS_PROGRAM = "${bindir}/ssh-askpass"
25 CFLAGS_prepend = "-I${S} "
26 CFLAGS_append = " -D__FILE_OFFSET_BITS=64"
27 LDFLAGS_prepend = "-L${S} -L${S}/openbsd-compat "
28 EXTRA_OECONF = "--disable-suid-ssh --with-ssl=${STAGING_LIBDIR}/ssl \
29 --with-rand-helper=no --without-pam \
30 --without-zlib-version-check \
31 --with-privsep-path=/var/run/sshd \
32 --sysconfdir=${sysconfdir}/ssh \
33 --with-xauth=/usr/bin/xauth"
35 EXTRA_OEMAKE = "'STRIP_OPT='"
37 do_configure_prepend () {
38 if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
39 cp aclocal.m4 acinclude.m4
43 do_compile_append () {
44 install -m 0644 ${WORKDIR}/sshd_config ${S}/
45 install -m 0644 ${WORKDIR}/ssh_config ${S}/
49 install -d ${D}${sysconfdir}/init.d
50 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
51 mv ${D}${bindir}/scp ${D}${bindir}/scp.${PN}
52 mv ${D}${bindir}/ssh ${D}${bindir}/ssh.${PN}
53 rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
54 rmdir ${D}/var/run/sshd ${D}/var/run ${D}/var
57 PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
58 FILES_${PN}-scp = "${bindir}/scp.${PN}"
59 FILES_${PN}-ssh = "${bindir}/ssh.${PN} ${sysconfdir}/ssh/ssh_config"
60 FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
61 FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config"
62 FILES_${PN}-sftp = "${bindir}/sftp"
63 FILES_${PN}-sftp-server = "${libdir}exec/sftp-server"
64 FILES_${PN}-misc = "${bindir}/ssh* ${libdir}exec/ssh*"
65 FILES_${PN}-keygen = "${bindir}/ssh-keygen"
67 RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
68 DEPENDS_${PN}-sshd += "update-rc.d"
69 RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen"
71 pkg_postinst_${PN}-sshd() {
72 if test "x$D" != "x"; then
76 adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
77 update-rc.d sshd defaults 9
81 pkg_postinst_${PN}-scp() {
82 update-alternatives --install ${bindir}/scp scp scp.${PN} 90
85 pkg_postinst_${PN}-ssh() {
86 update-alternatives --install ${bindir}/ssh ssh ssh.${PN} 90
89 pkg_postrm_${PN}-ssh() {
90 update-alternatives --remove ${bindir}/ssh ssh.${PN}
93 pkg_postrm_${PN}-scp() {
94 update-alternatives --remove ${bindir}/scp scp.${PN}
97 pkg_postrm_${PN}-sshd() {
98 if test "x$D" != "x"; then
101 ${sysconfdir}/init.d/sshd stop
104 update-rc.d -f sshd remove
108 ALLOW_EMPTY_${PN} = "1"
109 CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
110 CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"