slackbuilds/ap/ncdu/SlackBuild

79 lines
2.4 KiB
Text
Raw Normal View History

2022-12-08 09:40:41 +01:00
#!/bin/bash
# variables
VERSION=${VERSION:-latest}
2024-05-21 22:26:59 +02:00
BUILD=2
2022-12-08 09:40:41 +01:00
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
2024-05-27 07:53:51 +02:00
[ "$VERSION" == "latest" ] && VERSION=$(git tag --sort=-version:refname | head -n1)
2022-12-08 09:40:41 +01:00
[ "$VERSION" == "" ] && VERSION=trunk
2023-03-23 09:54:21 +01:00
[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout "$VERSION"
2022-12-08 09:40:41 +01:00
#zig build -Drelease-safe --prefix "$PKG$PREFIX" install
2024-05-21 22:26:59 +02:00
#make ZIG_FLAGS=" --release=safe " #"fast -fno-sanitize=undefined "
make install PREFIX="$PKG$PREFIX" MANDIR="$PKG$PREFIX"/man/man1 ZIG_FLAGS=" --release=safe "
2022-12-08 09:40:41 +01:00
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 <<EOF > "$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 dont 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"
2023-08-16 12:23:26 +02:00
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz"