Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / openssh / openssh_4.3p2.bb
1 DEPENDS = "zlib openssl"
2
3 RCONFLICTS_openssh = "dropbear"
4 RCONFLICTS_openssh-sshd = "dropbear"
5
6 SECTION = "console/network"
7 DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
8 Ssh (Secure Shell) is a program for logging into a remote machine \
9 and for executing commands on a remote machine. \
10 It provides secure encrypted communications between two untrusted \
11 hosts over an insecure network.  X11 connections and arbitrary TCP/IP \
12 ports can also be forwarded over the secure channel. \
13 It is intended as a replacement for rlogin, rsh and rcp, and can be \
14 used to provide applications with a secure communication channel."
15 HOMEPAGE = "http://www.openssh.org/"
16 LICENSE = "BSD"
17 FILE_PR = "r1"
18
19 SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
20            file://sshd_config \
21            file://ssh_config \
22            file://init"
23
24 inherit autotools
25
26 export ASKPASS_PROGRAM = "${bindir}/ssh-askpass"
27 export LD = "${CC}"
28 CFLAGS_prepend = "-I${S} "
29 CFLAGS_append = " -D__FILE_OFFSET_BITS=64"
30 LDFLAGS_prepend = "-L${S} -L${S}/openbsd-compat "
31 EXTRA_OECONF = "--disable-suid-ssh --with-ssl=${STAGING_LIBDIR}/ssl \
32                 --with-rand-helper=no --without-pam \
33                 --without-zlib-version-check \
34                 --with-privsep-path=/var/run/sshd \
35                 --sysconfdir=${sysconfdir}/ssh \
36                 --with-xauth=/usr/bin/xauth"
37
38 EXTRA_OEMAKE = "'STRIP_OPT='"
39
40 do_configure_prepend () {
41         if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
42                 cp aclocal.m4 acinclude.m4
43         fi
44 }
45
46 do_compile_append () {
47         install -m 0644 ${WORKDIR}/sshd_config ${S}/
48         install -m 0644 ${WORKDIR}/ssh_config ${S}/
49 }
50
51 do_install_append() {
52         install -d ${D}${sysconfdir}/init.d
53         install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
54         mv ${D}${bindir}/scp ${D}${bindir}/scp.openssh
55         mv ${D}${bindir}/ssh ${D}${bindir}/ssh.openssh
56 }
57
58 PACKAGES =+ " openssh-scp openssh-ssh openssh-sshd openssh-sftp openssh-misc"
59 FILES_openssh-dbg +=${bindir}/.debug ${libdir}exec/.debug"
60 FILES_openssh-scp = "${bindir}/scp.${PN}"
61 FILES_openssh-ssh = "${bindir}/ssh.${PN} ${bindir}/slogin /${sysconfdir}/ssh/ssh_config"
62 FILES_openssh-sshd = "${sbindir}/sshd /${sysconfdir}/init.d/sshd ${bindir}/ssh-keygen"
63 FILES_openssh-sshd += " /${sysconfdir}/ssh/moduli /${sysconfdir}/ssh/sshd_config /var/run/sshd"
64 FILES_openssh-sftp = "${bindir}/sftp ${libdir}exec/sftp-server"
65 FILES_openssh-misc = "${bindir}/ssh* ${libdir}exec/ssh*"
66
67 RDEPENDS_openssh += " openssh-scp openssh-ssh openssh-sshd"
68 DEPENDS_openssh-sshd += " update-rc.d"
69 RDEPENDS_openssh-sshd += " update-rc.d"
70
71 pkg_postinst_openssh-sshd() {
72 if test "x$D" != "x"; then
73         exit 1
74 else
75         addgroup sshd
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
78 fi
79 }
80
81 pkg_postinst_openssh-scp() {
82         update-alternatives --install ${bindir}/scp scp scp.${PN} 90
83 }
84
85 pkg_postinst_openssh-ssh() {
86         update-alternatives --install ${bindir}/ssh ssh ssh.${PN} 90
87 }
88
89 pkg_postrm_openssh-ssh() {
90         update-alternatives --remove ${bindir}/ssh ssh.${PN}
91 }
92
93 pkg_postrm_openssh-scp() {
94         update-alternatives --remove ${bindir}/scp scp.${PN}
95 }
96
97 pkg_postrm_openssh-sshd() {
98 if test "x$D" != "x"; then
99         exit 1
100 else
101         ${sysconfdir}/init.d/sshd stop
102         deluser sshd
103         delgroup sshd
104         update-rc.d -f sshd remove
105 fi
106 }
107
108 CONFFILES_openssh-sshd = "${sysconfdir}/ssh/sshd_config"
109 CONFFILES_openssh-ssh = "${sysconfdir}/ssh/ssh_config"