~r1w1s1/slackbuilds

1a4fbf8c4c7b9ab4eb317cc16f94ca301ab25c4c — r1w1s1 29 days ago 37bea23
add tut mastodon client
5 files changed, 153 insertions(+), 0 deletions(-)

M README.md
A tut/README
A tut/slack-desc
A tut/tut.SlackBuild
A tut/tut.info
M README.md => README.md +1 -0
@@ 14,6 14,7 @@
- N
  - [aerc](aerc/README)
  - [senpai](senpai/README)
  - [tut](tut/README)

- XAP
  - [alacritty](alacritty/README)

A tut/README => tut/README +10 -0
@@ 0,0 1,10 @@
Tut is a TUI for Mastodon with vim inspired keys. The program contains
most of the features from the web client.

Within tut, press "C" (no quotations) to create a new toot and "N" to
focus on notifications.

To enable mouse support you'll have to set mouse-support=true under [general]
in your config.

TUI is an acronym for text-based user interface, so tut runs in your terminal. 

A tut/slack-desc => tut/slack-desc +19 -0
@@ 0,0 1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes 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
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.

   |-----handy-ruler------------------------------------------------------|
tut: tut (TUI Mastodon Client)
tut:
tut: Tut is a Mastodon TUI (Terminal User Interface) client. It allows 
tut: you to interact with your Mastodon account directly from the terminal 
tut: with a simple and straightforward interface. Tut supports viewing 
tut: timelines, posting toots, replying, favoriting, boosting, and more.
tut:
tut:
tut: For more information, visit the project's GitHub page.
tut:
tut:

A tut/tut.SlackBuild => tut/tut.SlackBuild +113 -0
@@ 0,0 1,113 @@
#!/bin/bash
#
#          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#                   Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
#          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
#
# SlackBuild script for tut
# ===========================
# By:          r1w1s1 (https://fosstodon.org/@r1w1s1)
# For:         tut
# Descr:       Tut is a Mastodon TUI (Terminal User Interface) client
# URL:         https://github.com/RasmusLindroth/tut
# Changelog:
# v2.0.1:     10/august/2024 by r1w1s1 - Initial build.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=tut
VERSION=${VERSION:-2.0.1} # Replace with the latest version
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

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

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd ${PRGNAM}-${VERSION}

# Compile and install
CGO_CFLAGS="$SLKCFLAGS" \
CGO_CXXFLAGS="$SLKCFLAGS" \
go build
install -Dm755 $PRGNAM $PKG/usr/bin/$PRGNAM

# Strip the binaries
find $PKG -type f -exec strip --strip-unneeded {} \;

# Copy the Slackware packaging templates
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README.md LICENSE config.example.toml $PKG/usr/doc/$PRGNAM-$VERSION
cp -a config/toot.tmpl $PKG/usr/doc/$PRGNAM-$VERSION
cp -a config/user.tmpl $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Install themes
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/themes
cp config/themes/* $PKG/usr/doc/$PRGNAM-$VERSION/themes

# Install and compress man pages
for i in {1,5,7};
do
  mkdir -p $PKG/usr/man/man$i
  cp -r docs/man/tut.$i $PKG/usr/man/man$i/tut.$i
done
gzip -9 $PKG/usr/man/man[0-9]/$PRGNAM.[0-9]

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# Create the package description
mkdir -p $PKG/install
cp $CWD/slack-desc $PKG/install/slack-desc

# Build the package
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE


A tut/tut.info => tut/tut.info +10 -0
@@ 0,0 1,10 @@
PRGNAM="tut"
VERSION="2.0.1"
HOMEPAGE="https://github.com/RasmusLindroth/tut"
DOWNLOAD="https://github.com/RasmusLindroth/tut/archive/refs/tags/2.0.1/tut-2.0.1.tar.gz"
MD5SUM="7192cf56bfeb294fad290eb98e0a1e64"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="google-go-lang"
MAINTAINER="r1w1s1"
EMAIL="r1w1s1@disroot.org"