#!/bin/bash # Slackware build script for rtcqs # Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # Note: The GUI for this is actually horrible. You're better # off running the textmode rtcqs command. There's a fork called # Millisecond that has a nicer GUI, but it requires a libadwaita newer # than we can possibly package for Slackware 15.0. # 20251216 bkw: # - update for v0.6.7. # - PySimpleGui is gone, new dep freesimplegui. # - have to use python3-setuptools-opt now. # - add 48x48 bitmap icon. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=rtcqs VERSION=${VERSION:-0.6.7} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi 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 # We have 2 possibilities for the filename, depending on whether # or not it was downloaded with content-disposition enabled. Unlike # github, codeberg has no "magic" URL. TARBALL="$CWD/$PRGNAM-v$VERSION.tar.gz" [ -e "$TARBALL" ] || TARBALL="$CWD/v$VERSION.tar.gz" rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM tar xvf $TARBALL cd $PRGNAM chown -R root:root . find . ! -type l -a \ \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \ \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \) # Fix typo. Might as well give the full path to the filename, too. sed -i 's,\<\(imits.conf\),/etc/security/l\1,' src/rtcqs/rtcqs.py # Prevent scary-looking (but harmless) errors in the log, when # python3-setuptools-scm is installed. Thanks to fourtysixandtwo # for this snippet. echo '[tool.setuptools_scm]' >> pyproject.toml export SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION PYVER=$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])') export PYTHONPATH=/opt/python$PYVER/site-packages/ python3 -m build --wheel --no-isolation python3 -m installer --destdir "$PKG" dist/*.whl mkdir -p $PKG/usr/share/{icons/hicolor/{48x48,scalable}/apps,applications,pixmaps} install -m0644 $PRGNAM.desktop $PKG/usr/share/applications/ install -m0644 rtcqs_logo.svg $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg # 20251216 bkw: should have at least one bitmap icon, in case something doesn't # support SVGs. rsvg-convert \ -o $PKG/usr/share/icons/hicolor/48x48/apps/$PRGNAM.png \ -w 48 \ -h 48 \ rtcqs_logo.svg ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cp -a LICENSE* README* $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE