From 4a17aa877cc39fb1fb4678a74dc55d8dc6e603ec Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sun, 3 Mar 2024 09:40:34 +0100 Subject: [PATCH] [ap/xdg-ninja] Added --- ap/xdg-ninja/SlackBuild | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 ap/xdg-ninja/SlackBuild diff --git a/ap/xdg-ninja/SlackBuild b/ap/xdg-ninja/SlackBuild new file mode 100755 index 00000000..6743d21c --- /dev/null +++ b/ap/xdg-ninja/SlackBuild @@ -0,0 +1,63 @@ +#!/bin/bash + +# variables +CWD=$(pwd) + +PRGNAM=$(basename "$CWD") +GITHUB_REPO=b3nj5m1n/xdg-ninja +VERSION=${VERSION:-trunk} +ARCH=${ARCH:-noarch} +BUILD=2 + +TAG=gwh +TMP=/tmp/$TAG +PKG=$TMP/pkg-$PRGNAM +OUTPUT=/tmp + +REPOSITORY=/home/installs/SlackBuilds/_repositories/$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" + +cp -R "$REPOSITORY" "$TMP/$PRGNAM" +cd "$TMP/$PRGNAM" || exit 1 +[ "$VERSION" == "latest" ] && VERSION=$(git tag --sort=-taggerdate | head -n1) +[ "$VERSION" == "" ] && VERSION=trunk +[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout "$VERSION" + +# installation +make install DESTDIR="$PKG" PREFIX=$PREFIX +mv "$PKG$PREFIX"/share/man/ "$PKG$PREFIX/" +mv "$PKG$PREFIX"/share/doc/ "$PKG$PREFIX/" + +# 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 (checks your $HOME for unwanted files and directories.) +$PRGNAM: +$PRGNAM: A shell script which checks your $HOME for unwanted files and directories. +$PRGNAM: When it encounters a file it knows about, it will tell you whether it's +$PRGNAM: possible to move this file to an appropriate location, and how to do it. +$PRGNAM: The configurations are from the arch wiki page on XDG_BASE_DIR, antidot +$PRGNAM: (thanks to Scr0nch for writing a conversion tool), and contributed by +$PRGNAM: other users. +$PRGNAM: +$PRGNAM: https://github.com/${GITHUB_REPO} +EOF + +# empaquetage +/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION//-/}-$ARCH-$BUILD$TAG.txz"