diff options
Diffstat (limited to 'meta/packages/dropbear/dropbear.inc')
-rw-r--r-- | meta/packages/dropbear/dropbear.inc | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/meta/packages/dropbear/dropbear.inc b/meta/packages/dropbear/dropbear.inc new file mode 100644 index 0000000000..301ac24cb2 --- /dev/null +++ b/meta/packages/dropbear/dropbear.inc | |||
@@ -0,0 +1,73 @@ | |||
1 | DESCRIPTION = "Dropbear is a lightweight SSH and SCP Implementation" | ||
2 | HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "MIT" | ||
5 | DEPENDS = "zlib" | ||
6 | PROVIDES = "ssh sshd" | ||
7 | RPROVIDES = "ssh sshd" | ||
8 | |||
9 | SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.gz \ | ||
10 | file://urandom-xauth-changes-to-options.h.patch;patch=1 \ | ||
11 | file://configure.patch;patch=1 \ | ||
12 | file://fix-2kb-keys.patch;patch=1 \ | ||
13 | file://allow-nopw.patch \ | ||
14 | file://init" | ||
15 | |||
16 | inherit autotools update-rc.d | ||
17 | |||
18 | INITSCRIPT_NAME = "dropbear" | ||
19 | INITSCRIPT_PARAMS = "defaults 10" | ||
20 | |||
21 | CFLAGS_prepend = " -I. " | ||
22 | LD = "${CC}" | ||
23 | |||
24 | SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" | ||
25 | BINCOMMANDS = "dbclient ssh scp" | ||
26 | EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' | ||
27 | |||
28 | do_configure_prepend() { | ||
29 | if [ "x${DISTRO}" != "xfamiliar" -a "${DISTRO_TYPE}" == "debug" ]; then | ||
30 | oenote "WARNING: applying allow-nopw.patch which allows password-less logins!" | ||
31 | patch -p1 < ${WORKDIR}/allow-nopw.patch | ||
32 | fi | ||
33 | } | ||
34 | |||
35 | do_install() { | ||
36 | install -d ${D}${sysconfdir} \ | ||
37 | ${D}${sysconfdir}/init.d \ | ||
38 | ${D}${sysconfdir}/default \ | ||
39 | ${D}${sysconfdir}/dropbear \ | ||
40 | ${D}${bindir} \ | ||
41 | ${D}${sbindir} \ | ||
42 | ${D}${localstatedir} | ||
43 | |||
44 | install -m 0755 dropbearmulti ${D}${sbindir}/ | ||
45 | ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient | ||
46 | |||
47 | for i in ${SBINCOMMANDS} | ||
48 | do | ||
49 | ln -s ./dropbearmulti ${D}${sbindir}/$i | ||
50 | done | ||
51 | cat ${WORKDIR}/init | sed -e 's,/etc,${sysconfdir},g' \ | ||
52 | -e 's,/usr/sbin,${sbindir},g' \ | ||
53 | -e 's,/var,${localstatedir},g' \ | ||
54 | -e 's,/usr/bin,${bindir},g' \ | ||
55 | -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/dropbear | ||
56 | chmod 755 ${D}${sysconfdir}/init.d/dropbear | ||
57 | } | ||
58 | |||
59 | pkg_postinst () { | ||
60 | update-alternatives --install ${bindir}/scp scp ${sbindir}/dropbearmulti 20 | ||
61 | update-alternatives --install ${bindir}/ssh ssh ${sbindir}/dropbearmulti 20 | ||
62 | } | ||
63 | |||
64 | pkg_postrm_append () { | ||
65 | if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then | ||
66 | rm ${sysconfdir}/dropbear/dropbear_rsa_host_key | ||
67 | fi | ||
68 | if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then | ||
69 | rm ${sysconfdir}/dropbear/dropbear_dss_host_key | ||
70 | fi | ||
71 | update-alternatives --remove ssh ${bindir}/dropbearmulti | ||
72 | update-alternatives --remove scp ${bindir}/dropbearmulti | ||
73 | } | ||