# HG changeset patch # User Pascal Bellard # Date 1212659886 0 # Node ID 6e606489151e0302fe7e15eb861813ee14a822f5 # Parent ae743024f98b93534f12f9b372102ec80c52fce2 Add openssh diff -r ae743024f98b -r 6e606489151e openssh/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openssh/receipt Thu Jun 05 09:58:06 2008 +0000 @@ -0,0 +1,34 @@ +# SliTaz package receipt. + +PACKAGE="openssh" +VERSION="5.0p1" +CATEGORY="security" +SHORT_DESC="Openbsd Secure Shell." +MAINTAINER="pascal.bellard@slitaz.org" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://www.openssl.org/" +WGET_URL="ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/$TARBALL" +DEPENDS="libcrypto zlib" +BUILD_DEPENDS="libcrypto-dev zlib-dev" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + ./configure --prefix=/usr --sysconfdir=/etc/ssh \ + --with-privsep-user=nobody --with-privsep-path=/var/run/sshd \ + $CONFIGURE_ARGS + make + make DESTDIR=$PWD/_pkg install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share $fs/etc/init.d $fs/etc/ssh $fs/var/run/sshd + cp -a $_pkg/usr/share/Ssh.bin $fs/usr/share + cp -a $_pkg/usr/sbin $_pkg/usr/bin $_pkg/usr/libexec $fs/usr + cp -a $_pkg/etc $fs + cp stuff/openssh $fs/etc/init.d +} + diff -r ae743024f98b -r 6e606489151e openssh/stuff/openssh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openssh/stuff/openssh Thu Jun 05 09:58:06 2008 +0000 @@ -0,0 +1,64 @@ +#!/bin/sh +# /etc/init.d/openssh : Start, stop and restart OpenSSH server on SliTaz, at +# boot time or with the command line. +# +# To start OpenSSH server at boot time, just put openssh 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=OpenSSH +DESC="OpenSSH server" +DAEMON=/usr/sbin/sshd +OPTIONS=$OPENSSH_OPTIONS +PIDFILE=/var/run/sshd.pid + +case "$1" in + start) + # We need rsa and dsa host key file to start dropbear. + if [ ! -f /etc/ssh/ssh_host_rsa_key ] ; then + echo "Generating $NAME rsa key... " + ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -C '' -N '' + fi + if [ ! -f /etc/ssh/ssh_host_dsa_key ] ; then + echo "Generating $NAME dsa key... " + ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -C '' -N '' + 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