SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "zsh"

# SliTaz package receipt.

PACKAGE="zsh"
VERSION="5.8.1"
CATEGORY="system-tools"
TAGS="shell"
SHORT_DESC="Zsh shell incorporates many features of bash, ksh, and tcsh."
MAINTAINER="sandys@gmail.com"
LICENSE="other"
WEB_SITE="https://www.zsh.org/"

TARBALL="$PACKAGE-$VERSION.tar.xz"
WGET_URL="${WEB_SITE}pub/old/$TARBALL"

DEPENDS="gdbm ncurses ncursesw zlib"
BUILD_DEPENDS="ncurses-dev zlib-dev"

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

# Rules to configure and make the package.
compile_rules()
{
    ./configure                        \
        --bindir=/bin                    \
        --disable-dynamic                \
        --enable-multibyte                \
        --enable-fndir=/usr/share/zsh/functions        \
        --enable-scriptdir=/usr/share/zsh/scripts    \
        --with-tcsetpgrp                \
        $CONFIGURE_ARGS &&
    make -j 1 &&
    make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir $fs/etc
    mkdir -p $fs/usr/share/zsh
    mkdir -p $fs/usr/share/zsh/scripts

    cp -a $install/bin    $fs

    # Configuration files.
    cp $stuff/example.zshrc $fs/etc/zshrc

    #no way around this... gen_package will not automatically copy these
    cp -r $install/usr/share/zsh/functions \
                $fs/usr/share/zsh
}

# Post install commands for Tazpkg.
# Check /bin/sh stat.
#
post_install()
{
    sh=$(readlink "$1/bin/sh")
    if [ "$sh" != '/bin/zsh' ]
      then
        echo ''
        echo "**** Actual SH link : $sh"
        echo ''
        echo -n 'Do you want Zsh for /bin/sh (y/N) ? : '
        read -t 30 answer < /dev/tty
        if [ "$answer" = 'y' ]
          then
            echo ''
            action 'Removing sh link to make a new one pointing on /bin/zsh...'
            rm "$1/bin/sh" && ln -s /bin/zsh "$1/bin/sh"
            status
          else
            echo ''
            echo "Leaving /bin/sh to : $sh"
        fi
    fi
}

# Restore a valid sh link if needed.
pre_remove()
{
    sh=$(readlink "$1/bin/sh")
    [ "$sh" != 'busybox' ] &&
    ln -sf /bin/busybox "$1/bin/sh"
}
5935 packages and 845883 files in cooking database (Thu Jun 27 00:01:54 2024)