# HG changeset patch # User Pascal Bellard # Date 1234172668 0 # Node ID ebf2041fbd1faa48f2e135689a752ded21fa8e73 # Parent 74b05c130986edd979b6b004441e2baf25d1d237 Add dropbear-pam diff -r 74b05c130986 -r ebf2041fbd1f dropbear-pam/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dropbear-pam/receipt Mon Feb 09 09:44:28 2009 +0000 @@ -0,0 +1,63 @@ +# SliTaz package receipt. + +PACKAGE="dropbear-pam" +VERSION="0.51" +CATEGORY="security" +SHORT_DESC="Light SSH client and server using PAM." +MAINTAINER="pascal.bellard@slitaz.org" +SOURCE="dropbear" +TARBALL="$SOURCE-$VERSION.tar.gz" +DEPENDS="zlib pam" +BUILD_DEPENDS="zlib zlib-dev pam pam-dev" +WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html" +WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL" +CONFIG_FILES="/etc/dropbear" +PROVIDE="dropbear:pam" + +# Rules to configure and make the package. +compile_rules() +{ + local i + local DROPBEARS + DROPBEARS="dropbearkey dropbearconvert dbclient scp" + cd $src + [ -f done.dropbear-xauth.u ] || patch -p1 < ../stuff/dropbear-xauth.u + touch done.dropbear-xauth.u + ./configure --prefix=/usr --enable-pam $CONFIGURE_ARGS && + make PROGRAMS="dropbear $DROPBEARS" MULTI=1 && + install -d -m 755 $PWD/_pkg/usr/sbin && + install -m 755 dropbearmulti $PWD/_pkg/usr/sbin/dropbear && + chown root $PWD/_pkg/usr/sbin/dropbear && + chgrp 0 $PWD/_pkg/usr/sbin/dropbear && + install -d -m 755 $PWD/_pkg/usr/bin && + for i in $DROPBEARS ssh; do + ln -s ../sbin/dropbear $PWD/_pkg/usr/bin/$i + done +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr + cp -a $_pkg/usr/bin $fs/usr + cp -a $_pkg/usr/sbin $fs/usr + strip -s $fs/usr/bin/* + strip -s $fs/usr/sbin/* + # Config file and init script. + mkdir -p $fs/etc + cp -a stuff/dropbear $fs/etc + cp -a stuff/init.d $fs/etc + touch $fs/etc/dropbear/dropbear_dss_host_key \ + $fs/etc/dropbear/dropbear_rsa_host_key + + # Fix dropbear initscript perms + chown -R root.root $fs +} + +# Post message when installing. +post_install() +{ + echo -e "\nTo starts $PACKAGE server you can run :\n" + echo "/etc/init.d/$PACKAGE start" + echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n" +} diff -r 74b05c130986 -r ebf2041fbd1f dropbear-pam/stuff/dropbear-xauth.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dropbear-pam/stuff/dropbear-xauth.u Mon Feb 09 09:44:28 2009 +0000 @@ -0,0 +1,7 @@ +--- dropbear-0.50/options.h ++++ dropbear-0.50/options.h +@@ -199,3 +199,3 @@ + #ifndef XAUTH_COMMAND +-#define XAUTH_COMMAND "/usr/X11R6/bin/xauth -q" ++#define XAUTH_COMMAND "/usr/bin/xauth -q" + #endif diff -r 74b05c130986 -r ebf2041fbd1f dropbear-pam/stuff/dropbear/banner --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dropbear-pam/stuff/dropbear/banner Mon Feb 09 09:44:28 2009 +0000 @@ -0,0 +1,2 @@ + +Secure login on SliTaz GNU/Linux powered by Dropbear SSH server. diff -r 74b05c130986 -r ebf2041fbd1f dropbear-pam/stuff/init.d/dropbear --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dropbear-pam/stuff/init.d/dropbear Mon Feb 09 09:44:28 2009 +0000 @@ -0,0 +1,70 @@ +#!/bin/sh +# /etc/init.d/dropbear : Start, stop and restart SSH server on SliTaz, at +# boot time or with the command line. +# +# To start SSH server at boot time, just put dropbear in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=Dropbear +DESC="SSH server" +DAEMON=/usr/sbin/dropbear +OPTIONS=$DROPBEAR_OPTIONS +PIDFILE=/var/run/dropbear.pid + +case "$1" in + start) + # We need rsa and dss host key file to start dropbear. + if [ ! -s /etc/dropbear/dropbear_rsa_host_key ] ; then + echo -n "Generating $NAME rsa key... " + # Need to delete key before creating it. + rm -f /etc/dropbear/dropbear_rsa_host_key + dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key > /dev/null 2>&1 + status + fi + if [ ! -s /etc/dropbear/dropbear_dss_host_key ] ; then + echo -n "Generating $NAME dss key... " + # Need to delete key before creating it. + rm -f /etc/dropbear/dropbear_dss_host_key + dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key > /dev/null 2>&1 + status + fi + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS + status + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r 74b05c130986 -r ebf2041fbd1f dropbear/receipt --- a/dropbear/receipt Mon Feb 09 09:39:53 2009 +0000 +++ b/dropbear/receipt Mon Feb 09 09:44:28 2009 +0000 @@ -6,6 +6,7 @@ SHORT_DESC="Light SSH client and server." MAINTAINER="pascal.bellard@slitaz.org" TARBALL="$PACKAGE-$VERSION.tar.gz" +DEPENDS="zlib" BUILD_DEPENDS="zlib-dev" WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html" WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL" @@ -20,7 +21,7 @@ cd $src [ -f done.dropbear-xauth.u ] || patch -p1 < ../stuff/dropbear-xauth.u touch done.dropbear-xauth.u - ./configure --prefix=/usr $CONFIGURE_ARGS && + ./configure --prefix=/usr --without-pam $CONFIGURE_ARGS && make PROGRAMS="dropbear $DROPBEARS" MULTI=1 && install -d -m 755 $PWD/_pkg/usr/sbin && install -m 755 dropbearmulti $PWD/_pkg/usr/sbin/dropbear &&