From 892f470f3217693f714f1934df7c2bfdd18d5c7e Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 26 Nov 2024 16:17:45 +0100 Subject: [PATCH] fuzzel + check what's installed among all managed machines --- wayland/fuzzel/SlackBuild | 80 ++++++++++++++++++++++++++++++++++ what-s_installed-everywhere.sh | 45 +++++++++++++++++++ what-s_installed.sh | 6 +-- 3 files changed, 128 insertions(+), 3 deletions(-) create mode 100755 wayland/fuzzel/SlackBuild create mode 100755 what-s_installed-everywhere.sh diff --git a/wayland/fuzzel/SlackBuild b/wayland/fuzzel/SlackBuild new file mode 100755 index 00000000..93ec0f57 --- /dev/null +++ b/wayland/fuzzel/SlackBuild @@ -0,0 +1,80 @@ +#!/bin/bash +# variables +VERSION=${VERSION:-latest} +BUILD=2 + +TAG=gwh +OUTPUT=/tmp +TMP=/tmp/$TAG +CWD=$(pwd) + +PRGNAM=$(basename $CWD) +PKG=$TMP/pkg-$PRGNAM + +ARCH=$(uname -m) + +REPOSITORY=/var/cache/SlackBuilds.gwh/$PRGNAM +PREFIX=/usr + +# nettoyage préalable +rm -fr $PKG $TMP/$PRGNAM + +mkdir -p $PKG + +# mise en place +[ ! -e $REPOSITORY ] && git clone https://codeberg.org/dnkl/fuzzel.git $REPOSITORY +cd $REPOSITORY +git pull --all + +cp -R $REPOSITORY $TMP/ +cd $TMP/$PRGNAM/ + +[ "x$VERSION" == "xlatest" ] && VERSION=$(git tag --sort=-version:refname | head -n1) +[ "x$VERSION" == "x" ] && VERSION=trunk +[ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION + +meson setup \ + --prefix /usr \ + --mandir /usr/man/ \ + build/ +ninja -C build/ +cd build/ +meson install --destdir=$PKG +cd ../ + +mkdir -p $PKG$PREFIX/doc/ +mv $PKG$PREFIX/share/doc/$PRGNAM/ $PKG$PREFIX/doc/ +rm -fr $PKG$PREFIX/share/doc + +# correction +cd $PKG +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 kanshis 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 +# kanshi exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + |-----handy-ruler------------------------------------------------------| +$PRGNAM: $PRGNAM (App launcher and fuzzy finder for Wayland) +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: https://codeberg.org/dnkl/fuzzel +EOF + +# empaquetage +rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la +/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz diff --git a/what-s_installed-everywhere.sh b/what-s_installed-everywhere.sh new file mode 100755 index 00000000..69d5ef03 --- /dev/null +++ b/what-s_installed-everywhere.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +cd $(dirname $0) || exit 1 + +PKGs_local=$(ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') + +SHORT_HOSTNAME=$(hostname -s) + +if [ "$SHORT_HOSTNAME" == "tibou" ]; then + PKGs_tibou=$PKGs_local +else + PKGs_tibou=$(ssh tibou ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') +fi +if [ "$SHORT_HOSTNAME" == "titplume" ]; then + PKGs_titplume=$PKGs_local +else + PKGs_titplume=$(ssh titplume ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') +fi +if [ "$SHORT_HOSTNAME" == "tibonom" ]; then + PKGs_tibonom=$PKGs_local +else + PKGs_tibonom=$(ssh tibonom ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') +fi +if [ "$SHORT_HOSTNAME" == "gwenhael" ]; then + PKGs_gwenhael=$PKGs_local +else + PKGs_gwenhael=$(ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') +fi + +echo "| tibou | titplume | tibonom | gwenhael |" +echo "|----------+----------+----------+----------+-------" +PKG_OK="| x " +PKG_KO="| " +for cat in a ap d l lua n wayland xap y; do + cd $cat + for p in $(ls -1); do + echo -n $PKGs_tibou | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" + echo -n $PKGs_titplume | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" + echo -n $PKGs_tibonom | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" + echo -n $PKGs_gwenhael | grep -q " $(echo $p | tr -d /) " && echo -n "$PKG_OK" || echo -n "$PKG_KO" + + echo "| $cat/$p" + done | sort + cd .. +done diff --git a/what-s_installed.sh b/what-s_installed.sh index 0574a0be..cf0ce3d7 100755 --- a/what-s_installed.sh +++ b/what-s_installed.sh @@ -2,13 +2,13 @@ cd $(dirname $0) || exit 1 -PKGs=$(ls /var/adm/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') +PKGs=$(ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|') for cat in a ap d l lua n wayland xap y; do cd $cat for p in $(ls -1); do - echo $PKGs | grep -q " $(echo $p | tr -d /) " && echo -n "✓: " || echo -n "❌: " - echo "$cat/$p" + echo $PKGs | grep -q " $(echo $p | tr -d /) " && echo -n "✓: " || echo -n "❌: " + echo "$cat/$p" done | sort cd .. done