#!/bin/bash # Slackware build script for ufetch # Original author: Brandon Pribula, BC Canada # Now maintained by B. Watson (urchlay@slackware.uk). # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20250129 bkw: BUILD=2. # - improve window manager detection for non-desktop WMs. Received # a report and a patch from Ricardson via email, but I patched # the code myself to cover all the cases Ricardson's patch # covered, plus a couple more (commented-out #exec icewm in .xinitrc, # runlevel 3 with no ~/.xinitrc at all). # 20241205 bkw: update for v0.4. # - This is a *completely meaningless* version update. # The ufetch-slackware script in 0.4 is identical to the one from 0.3. # In fact, the only thing that's changed since 0.3 is ufetch-nixos's # package-counting. I only updated this to shut repology up. # 20230914 bkw: # - take over maintenance. # - relicense as WTFPL, with permission from original author. # - update for v0.3. # - only extract the bits we want from the tarball. # - minor tweaks to README and slack-desc. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=ufetch VERSION=${VERSION:-0.4} COMMIT=${COMMIT:-ff21a96c8d6d7f34b77836eeda2cf4b225e25dee} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} ARCH="noarch" if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 fi TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-v$VERSION-$COMMIT tar xvf $CWD/$PRGNAM-v$VERSION-$COMMIT.tar.gz \ --wildcards '*/LICENSE' '*/README.md' '*/ufetch-slackware' cd $PRGNAM-v$VERSION-$COMMIT chown -R root:root . chmod 644 * patch -p1 < $CWD/wm_detect.diff install -D -m0755 "$PRGNAM-slackware" $PKG/usr/bin/$PRGNAM PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cp -a LICENSE README.md $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE