SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "tmux-mem-cpu-load"

# SliTaz package receipt.

PACKAGE="tmux-mem-cpu-load"
VERSION="3.6.0"
CATEGORY="utilities"
SHORT_DESC="CPU, RAM, and load monitor for use with tmux."
MAINTAINER="paul@slitaz.org"
LICENSE="Apache"
WEB_SITE="https://github.com/tmux/tmux/wiki"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="https://github.com/thewtex/$PACKAGE/archive/v$VERSION.tar.gz"

DEPENDS="tmux"
BUILD_DEPENDS="cmake python"

current_version()
{
    wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
    mkdir    _build &&
    cd    _build &&
    cmake    ..                \
        -D CMAKE_INSTALL_PREFIX=/usr &&
    make &&
    make install
}

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

    cp -a $install/usr/bin    $fs/usr
    cat >> $fs/etc/skel/.tmux.conf << EOT
# tmux-mem-cpu-load
set -g status-interval 2
set -g status-right "#[fg=black,bg=green]#(tmux-mem-cpu-load 2)#[default]"
EOT
}

post_install()
{
    for i in $(ls "$1/home" 2> /dev/null)
      do
        grep -qs "tmux-mem-cpu-load"    "$1/home/$i/.tmux.conf" &&
        continue
        echo -n "Checking for .tmux.conf for $i ..."
        cp -a "$1/etc/skel/.tmux.conf"    "$1/home/$i/"
        chroot "$1/" chown $(stat -c "%u.%g" "$1/home/$i") "/home/$i/.tmux.conf"
        status
      done
}
6047 packages and 209931 files in current database (Wed Jun 26 15:35:30 2024)