Merge oe-devel@oe-devel.bkbits.net:packages
[openembedded.git] / openssh / openssh_3.8p1.oe
1 DEPENDS = "zlib openssl"
2 SECTION = "console/network"
3 DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
4 Ssh (Secure Shell) is a program for logging into a remote machine \
5 and for executing commands on a remote machine. \
6 It provides secure encrypted communications between two untrusted \
7 hosts over an insecure network.  X11 connections and arbitrary TCP/IP \
8 ports can also be forwarded over the secure channel. \
9 It is intended as a replacement for rlogin, rsh and rcp, and can be \
10 used to provide applications with a secure communication channel."
11 HOMEPAGE = "http://www.openssh.org/"
12 LICENSE = "BSD"
13 MAINTAINER = "Bruno Randolf <bruno.randolf@4g-systems.biz>"
14
15 SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
16            file://configure.patch;patch=1 \
17            file://scp-nossl.patch;patch=1 \
18            file://sshd_config \
19            file://init"
20
21 inherit autotools
22
23 export ASKPASS_PROGRAM = "${bindir}/ssh-askpass"
24 export LD = "${CC}"
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                 
34 EXTRA_OEMAKE = "'STRIP_OPT='"
35
36 do_configure_prepend () {
37         if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
38                 cp aclocal.m4 acinclude.m4
39         fi
40 }
41
42 do_compile_append () {
43         install -m 0644 ${WORKDIR}/sshd_config ${S}/
44 }
45
46 do_install_append() {
47         install -d ${D}/${sysconfdir}/init.d
48         install -m 0755 ${WORKDIR}/init ${D}/etc/init.d/sshd
49 }
50
51 PACKAGES =+ " openssh-scp openssh-ssh openssh-sshd openssh-sftp openssh-misc"
52 FILES_openssh-scp = "/usr/bin/scp"
53 FILES_openssh-ssh = "/usr/bin/ssh /usr/bin/slogin /${sysconfdir}/ssh/ssh_config"
54 FILES_openssh-sshd = "/usr/sbin/sshd /${sysconfdir}/init.d/sshd /usr/bin/ssh-keygen"
55 FILES_openssh-sshd += " /${sysconfdir}/ssh/moduli /${sysconfdir}/ssh/sshd_config /var/run/sshd"
56 FILES_openssh-sftp = "/usr/bin/sftp /usr/libexec/sftp-server"
57 FILES_openssh-misc = "/usr/bin /usr/libexec/"
58 RDEPENDS_openssh += " openssh-scp openssh-ssh openssh-sshd"
59 DEPENDS_openssh-sshd += " update-rc.d"
60 RDEPENDS_openssh-sshd += " update-rc.d"
61
62 pkg_postinst_openssh-sshd() {
63 if test "x$D" != "x"; then
64         exit 1
65 else
66         addgroup sshd
67         adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
68         update-rc.d sshd defaults
69 fi
70 }
71
72 pkg_postrm_openssh-sshd() {
73 if test "x$D" != "x"; then
74         exit 1
75 else
76         ${sysconfdir}init.d/sshd stop
77         deluser sshd
78         delgroup sshd
79         update-rc.d -f sshd remove
80 fi
81 }
82
83 CONFFILES_openssh-sshd_nylon = "${sysconfdir}/ssh/sshd_config"
84 CONFFILES_openssh-ssh_nylon = "${sysconfdir}/ssh/ssh_config"