SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "rsh"

# SliTaz package receipt.

PACKAGE="rsh"
VERSION="0.17"
CATEGORY="network"
SHORT_DESC="Remote connection tools"
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="BSD"
TARBALL="netkit-$PACKAGE-$VERSION.tar.gz"
WEB_SITE="https://web.archive.org/web/20201216144539/http://ftp.linux.org.uk/pub/linux/Networking/netkit/"
WGET_URL="http://ibiblio.org/pub/linux/system/network/netkit/$TARBALL"
PROVIDE="rshd netkit-rsh"

DEPENDS=""
BUILD_DEPENDS="ncurses-dev"

# What is the latest version available today?
current_version()
{
    wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
    sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    sed -i 's|/man|/share&|' configure
    mkdir -p $DESTDIR/usr/bin $DESTDIR/usr/sbin \
         $DESTDIR/usr/share/man/man1 $DESTDIR/usr/share/man/man8
    sed -i 's|.*param.h.*|#include <linux/limits.h>\n&|' \
        rexecd/rexecd.c rshd/rshd.c
    sed -i 's|.*rlogind.*|#include <stdio.h>\n&|' rlogind/rlogind.h
    ./configure --prefix=/usr --without-pam --installroot=$DESTDIR &&
    make && make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr $fs/etc/skel
    cp -a $install/usr/bin $fs/usr
    cp -a $install/usr/sbin $fs/usr
    touch $fs/etc/skel/.rhosts
    chmod 600 $fs/etc/skel/.rhosts
}

# Pre and post install commands for Tazpkg.
post_install()
{
    if ! grep -qs rlogind $1/etc/inetd.conf; then
        cat >> $1/etc/inetd.conf <<EOT
exec    stream  tcp     nowait  root    /usr/sbin/in.execd    execd
login    stream  tcp     nowait  root    /usr/sbin/in.rlogind    rlogind -hl
shell    stream  tcp     nowait  root    /usr/sbin/in.rshd    rshd -hl
EOT
        [ -n "$1" ] || killall -HUP inetd
    fi
}

# Pre and post install commands for Tazpkg.
pre_remove()
{
    sed -i '/rlogind/d;/rshd/d;/rexec/d' $1/etc/inetd.conf
    [ -n "$1" ] || killall -HUP inetd
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)