]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/openssh/openssh_4.0p1.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / openssh / openssh_4.0p1.bb
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 PR = "r5"
15
16 SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
17            file://configure.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}${sysconfdir}/init.d/sshd
49         mv ${D}${bindir}/scp ${D}${bindir}/scp.openssh
50         mv ${D}${bindir}/ssh ${D}${bindir}/ssh.openssh
51 }
52
53 PACKAGES =+ " openssh-scp openssh-ssh openssh-sshd openssh-sftp openssh-misc"
54 FILES_openssh-scp = "${bindir}/scp.${PN}"
55 FILES_openssh-ssh = "${bindir}/ssh.${PN} ${bindir}/slogin /${sysconfdir}/ssh/ssh_config"
56 FILES_openssh-sshd = "${sbindir}/sshd /${sysconfdir}/init.d/sshd ${bindir}/ssh-keygen"
57 FILES_openssh-sshd += " /${sysconfdir}/ssh/moduli /${sysconfdir}/ssh/sshd_config /var/run/sshd"
58 FILES_openssh-sftp = "${bindir}/sftp ${libdir}exec/sftp-server"
59 FILES_openssh-misc = "${bindir} ${libdir}exec/"
60 RDEPENDS_openssh += " openssh-scp openssh-ssh openssh-sshd"
61 DEPENDS_openssh-sshd += " update-rc.d"
62 RDEPENDS_openssh-sshd += " update-rc.d"
63
64 pkg_postinst_openssh-sshd() {
65 if test "x$D" != "x"; then
66         exit 1
67 else
68         addgroup sshd
69         adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
70         update-rc.d sshd defaults 9
71 fi
72 }
73
74 pkg_postinst_openssh-scp() {
75         update-alternatives --install ${bindir}/scp scp scp.${PN} 90
76 }
77
78 pkg_postinst_openssh-ssh() {
79         update-alternatives --install ${bindir}/ssh ssh ssh.${PN} 90
80 }
81
82 pkg_postrm_openssh-ssh() {
83         update-alternatives --remove ${bindir}/ssh ssh.${PN}
84 }
85
86 pkg_postrm_openssh-scp() {
87         update-alternatives --remove ${bindir}/scp scp.${PN}
88 }
89
90 pkg_postrm_openssh-sshd() {
91 if test "x$D" != "x"; then
92         exit 1
93 else
94         ${sysconfdir}/init.d/sshd stop
95         deluser sshd
96         delgroup sshd
97         update-rc.d -f sshd remove
98 fi
99 }
100
101 CONFFILES_openssh-sshd_nylon = "${sysconfdir}/ssh/sshd_config"
102 CONFFILES_openssh-ssh_nylon = "${sysconfdir}/ssh/ssh_config"