From d88a4317e6ba242b1b251d7dab5897313f391b87 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Fri, 27 Dec 2024 16:49:13 +0100 Subject: [PATCH] duf and dust --- ap/duf/SlackBuild | 73 ++++++++++++++++++++++++ {_unmaintained/ap => ap}/dust/SlackBuild | 0 2 files changed, 73 insertions(+) create mode 100755 ap/duf/SlackBuild rename {_unmaintained/ap => ap}/dust/SlackBuild (100%) diff --git a/ap/duf/SlackBuild b/ap/duf/SlackBuild new file mode 100755 index 00000000..2cc8e11d --- /dev/null +++ b/ap/duf/SlackBuild @@ -0,0 +1,73 @@ +#!/bin/bash + +# variables +CWD=$(pwd) + +PRGNAM=$(basename "$CWD") +GITHUB_REPO=muesli/duf +VERSION=${VERSION:-latest} +ARCH=${ARCH:-noarch} +BUILD=1 + +TAG=gwh +TMP=/tmp/$TAG +PKG=$TMP/pkg-$PRGNAM +OUTPUT=/tmp + +REPOSITORY=/var/cache/SlackBuilds.gwh/$PRGNAM + +PREFIX=/usr + +# nettoyage préalable +rm -fr "$PKG" "${TMP:?}/$PRGNAM" + +mkdir -p "$PKG" + +# mise en place +cd $TMP || exit 1 +[ ! -e "$REPOSITORY" ] && git clone https://github.com/${GITHUB_REPO}.git "$REPOSITORY" +cd $REPOSITORY +git pull --all + +cp -R "$REPOSITORY" "$TMP/$PRGNAM" +cd "$TMP/$PRGNAM" || exit 1 +[ "$VERSION" == "latest" ] && VERSION=$(git tag --sort=-version:refname | head -n1) +[ "$VERSION" == "" ] && VERSION=trunk +[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout "$VERSION" + +go build + +# installation +mkdir -p "$PKG$PREFIX"/bin/ +cp duf "$PKG$PREFIX"/bin/ + +mkdir -p "$PKG$PREFIX"/man/man1/ +cp duf.1 "$PKG$PREFIX"/man/man1/ +gzip -9 "$PKG$PREFIX"/man/man1/duf.1 + +mkdir -p "$PKG$PREFIX/doc/$PRGNAM" +cp -a LICENSE README.md duf.png "$PKG$PREFIX/doc/$PRGNAM" + +# correction +cd "$PKG" || exit 1 +chown -R root:root ./* + +[ -d "$PKG"/usr/man ] && find "$PKG"/usr/man -type f -name "*.?" -exec gzip -9f {} \; + +# embaumement +mkdir -p "$PKG/install" +cat < "$PKG"/install/slack-desc +$PRGNAM: $PRGNAM (a better df) +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: https://github.com/${GITHUB_REPO} +EOF + +# empaquetage +/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION//-/}-$ARCH-$BUILD$TAG.txz" diff --git a/_unmaintained/ap/dust/SlackBuild b/ap/dust/SlackBuild similarity index 100% rename from _unmaintained/ap/dust/SlackBuild rename to ap/dust/SlackBuild