wok-current rev 860

Add openssh
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 05 09:58:06 2008 +0000 (2008-06-05)
parents ae743024f98b
children 22476fcc0861
files openssh/receipt openssh/stuff/openssh
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/openssh/receipt	Thu Jun 05 09:58:06 2008 +0000
     1.3 @@ -0,0 +1,34 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="openssh"
     1.7 +VERSION="5.0p1"
     1.8 +CATEGORY="security"
     1.9 +SHORT_DESC="Openbsd Secure Shell."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.12 +WEB_SITE="http://www.openssl.org/"
    1.13 +WGET_URL="ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/$TARBALL"
    1.14 +DEPENDS="libcrypto zlib"
    1.15 +BUILD_DEPENDS="libcrypto-dev zlib-dev"
    1.16 +
    1.17 +# Rules to configure and make the package.
    1.18 +compile_rules()
    1.19 +{
    1.20 +	cd $src
    1.21 +	./configure --prefix=/usr --sysconfdir=/etc/ssh \
    1.22 +		--with-privsep-user=nobody --with-privsep-path=/var/run/sshd \
    1.23 +		$CONFIGURE_ARGS
    1.24 +	make
    1.25 +	make DESTDIR=$PWD/_pkg install
    1.26 +}
    1.27 +
    1.28 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.29 +genpkg_rules()
    1.30 +{
    1.31 +	mkdir -p $fs/usr/share $fs/etc/init.d $fs/etc/ssh $fs/var/run/sshd
    1.32 +	cp -a $_pkg/usr/share/Ssh.bin $fs/usr/share
    1.33 +	cp -a $_pkg/usr/sbin $_pkg/usr/bin $_pkg/usr/libexec $fs/usr
    1.34 +	cp -a $_pkg/etc $fs
    1.35 +	cp stuff/openssh $fs/etc/init.d
    1.36 +}
    1.37 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/openssh/stuff/openssh	Thu Jun 05 09:58:06 2008 +0000
     2.3 @@ -0,0 +1,64 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/openssh : Start, stop and restart OpenSSH server on SliTaz, at 
     2.6 +# boot time or with the command line.
     2.7 +#
     2.8 +# To start OpenSSH server at boot time, just put openssh in the $RUN_DAEMONS
     2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    2.10 +#
    2.11 +. /etc/init.d/rc.functions
    2.12 +. /etc/daemons.conf
    2.13 +
    2.14 +NAME=OpenSSH
    2.15 +DESC="OpenSSH server"
    2.16 +DAEMON=/usr/sbin/sshd
    2.17 +OPTIONS=$OPENSSH_OPTIONS
    2.18 +PIDFILE=/var/run/sshd.pid
    2.19 +
    2.20 +case "$1" in
    2.21 +  start)
    2.22 +    # We need rsa and dsa host key file to start dropbear.
    2.23 +    if [ ! -f /etc/ssh/ssh_host_rsa_key ] ; then
    2.24 +      echo "Generating $NAME rsa key... "
    2.25 +      ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -C '' -N ''
    2.26 +    fi
    2.27 +    if [ ! -f /etc/ssh/ssh_host_dsa_key ] ; then
    2.28 +      echo "Generating $NAME dsa key... "
    2.29 +      ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -C '' -N ''
    2.30 +    fi
    2.31 +    if [ -f $PIDFILE ] ; then
    2.32 +      echo "$NAME already running."
    2.33 +      exit 1
    2.34 +    fi
    2.35 +    echo -n "Starting $DESC: $NAME... "
    2.36 +    $DAEMON $OPTIONS
    2.37 +    status
    2.38 +    ;;
    2.39 +  stop)
    2.40 +    if [ ! -f $PIDFILE ] ; then
    2.41 +      echo "$NAME is not running."
    2.42 +      exit 1
    2.43 +    fi
    2.44 +    echo -n "Stopping $DESC: $NAME... "
    2.45 +    kill `cat $PIDFILE`
    2.46 +    status
    2.47 +    ;;
    2.48 +  restart)
    2.49 +    if [ ! -f $PIDFILE ] ; then
    2.50 +      echo "$NAME is not running."
    2.51 +      exit 1
    2.52 +    fi
    2.53 +    echo -n "Restarting $DESC: $NAME... "
    2.54 +    kill `cat $PIDFILE`
    2.55 +    sleep 2
    2.56 +    $DAEMON $OPTIONS
    2.57 +    status
    2.58 +    ;;
    2.59 +  *)
    2.60 +    echo ""
    2.61 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.62 +    echo ""
    2.63 +    exit 1
    2.64 +    ;;
    2.65 +esac
    2.66 +
    2.67 +exit 0