Initial dropbear exheres.

for/master
Daniel Mierswa 2009-12-29 01:24:26 +01:00
parent 78f30f908a
commit 134d215ae1
3 changed files with 117 additions and 0 deletions

View File

@ -0,0 +1,75 @@
SUMMARY="A small SSH 2 server and client."
HOMEPAGE="http://matt.ucc.asn.au/dropbear/dropbear.html"
DOWNLOADS="http://matt.ucc.asn.au/dropbear/${PNV}.tar.bz2"
LICENCES=""
SLOT="0"
PLATFORMS="~amd64 ~x86"
MYOPTIONS="multi pam scp static
multi [[ description = [ Use one binary for all programs. ] ]]
pam [[ description = [ Enable authentication via PAM. ] ]]
scp [[ description = [ Build the dropbear secure copy binary. ] ]]
"
DEPENDENCIES="
build+run:
pam? ( sys-libs/pam )
scp? ( !net-misc/openssh ) [[ note = [ scp is also provided by OpenSSH ] ]]
"
DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( pam )
DEFAULT_SRC_INSTALL_EXTRA_DOCS=( MULTI )
src_prepare() {
default
option pam && edo sed -i \
-e "s:^/\*#define ENABLE_SVR_PAM_AUTH\*/:#define ENABLE_SVR_PAM_AUTH:" \
-e "s:^#define ENABLE_SVR_PASSWORD_AUTH::" \
options.h
}
dbmake() {
local makeopts programs
option static && makeopts+=" STATIC=1"
option multi && makeopts+=" MULTI=1"
option scp && programs+=" scp"
emake \
PROGRAMS="dropbear dbclient dropbearkey dropbearconvert ${programs}" \
${makeopts} \
"${@}"
}
src_compile() {
dbmake
}
src_install() {
local binprogs
dbmake DESTDIR="${IMAGE}" install
emagicdocs
newinitd "${FILES}"/dropbear.init dropbear
newconfd "${FILES}"/dropbear.conf dropbear
if option multi ; then
binprogs="dbclient dropbearkey dropbearconvert"
option scp && binprogs+=" scp"
for prog in ${binprogs} ; do
edo ln -s dropbearmulti "${IMAGE}"/usr/bin/"${prog}"
done
dodir /usr/sbin
edo ln -s ../bin/dropbearmulti "${IMAGE}"/usr/sbin/dropbear
fi
doman dropbear{,key}.8
}

View File

@ -0,0 +1,6 @@
# /etc/conf.d/dropbear: config file for /etc/init.d/dropbear
# see `dropbear -h` for more information
# -w disables root logins
# -p # changes the port number to listen on
DROPBEAR_OPTS=""

View File

@ -0,0 +1,36 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-misc/dropbear/files/dropbear.init.d,v 1.2 2004/07/14 23:57:35 agriffis Exp $
depend() {
use logger dns
need net
}
check_config() {
if [ ! -e /etc/dropbear/ ] ; then
mkdir /etc/dropbear/
fi
if [ ! -e /etc/dropbear/dropbear_dss_host_key ] ; then
einfo "Generating DSS-Hostkey..."
/usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
fi
if [ ! -e /etc/dropbear/dropbear_rsa_host_key ] ; then
einfo "Generating RSA-Hostkey..."
/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
fi
}
start() {
check_config || return 1
ebegin "Starting dropbear"
/usr/sbin/dropbear ${DROPBEAR_OPTS}
eend $?
}
stop() {
ebegin "Stopping dropbear"
start-stop-daemon --stop --pidfile /var/run/dropbear.pid
eend $?
}