From 2061e55f615a0156f3ca2ffbb06b8bea860329e7 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Thu, 8 Dec 2022 09:40:41 +0100 Subject: [PATCH] [ap/ncdu] add ncdu2 --- ap/ncdu/SlackBuild | 80 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 ap/ncdu/SlackBuild diff --git a/ap/ncdu/SlackBuild b/ap/ncdu/SlackBuild new file mode 100755 index 00000000..c50acdd3 --- /dev/null +++ b/ap/ncdu/SlackBuild @@ -0,0 +1,80 @@ +#!/bin/bash + +# variables +VERSION=${VERSION:-latest} + +BUILD=1 + +TAG=gwh +OUTPUT=/tmp +TMP=/tmp/$TAG +CWD=$(pwd) + +PRGNAM=$(basename "$CWD") +PKG=$TMP/pkg-$PRGNAM + +ARCH=$(uname -m) + +REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM +PREFIX=/usr + +# nettoyage préalable +rm -fr "$PKG" "${TMP:?}/$PRGNAM" + +mkdir -p "$PKG" + +# mise en place +[ ! -e "$REPOSITORY" ] && git clone https://code.blicky.net/yorhel/ncdu.git --recursive "$REPOSITORY" +cd "$REPOSITORY" || exit 1 +git pull --all +git submodule update + +cp -R "$REPOSITORY" $TMP/ +cd "$TMP/$PRGNAM/" || exit 1 + +git checkout zig-0.10 + +[ "$VERSION" == "latest" ] && VERSION=$(git describe --tags --abbrev=0) +[ "$VERSION" == "" ] && VERSION=trunk +[ "$VERSION" == "trunk" ] && VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)" || git checkout "$VERSION" + +#zig build -Drelease-safe --prefix "$PKG$PREFIX" install +make +make install PREFIX="$PKG$PREFIX" MANDIR="$PKG$PREFIX"/man/man1 + +mkdir -p "$PKG$PREFIX/doc/$PRGNAM" +cp -a LICENSES/ ChangeLog ./*.md "$PKG$PREFIX/doc/$PRGNAM/" + +# correction +cd "$PKG" || exit 1 +chown -R root:root ./* +[ -d "$PKG$PREFIX/man" ] && find "$PKG$PREFIX/man" -name "*.?" -type f -exec gzip -9 {} \; + +# embaumement +mkdir -p "$PKG/install" + +cat < "$PKG/install/slack-desc" +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +$PRGNAM: $PRGNAM (NCurses Disk Usage) +$PRGNAM: +$PRGNAM: Ncdu is a disk usage analyzer with an ncurses interface. It is +$PRGNAM: designed to find space hogs on a remote server where you don’t have +$PRGNAM: an entire graphical setup available, but it is a useful tool even on +$PRGNAM: regular desktop systems. Ncdu aims to be fast, simple and easy to +$PRGNAM: use, and should be able to run in any minimal POSIX-like environment +$PRGNAM: with ncurses installed. +$PRGNAM: +$PRGNAM: +$PRGNAM: https://dev.yorhel.nl/ncdu +EOF + +# empaquetage +rm -f "$PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la" +/sbin/makepkg -l y -c n "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz"