3 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
4 # Version 2, December 2004
6 # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
8 # Everyone is permitted to copy and distribute verbatim or modified
9 # copies of this license document, and changing it is allowed as long
10 # as the name is changed.
12 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
13 # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
16 # 0. You just DO WHAT THE FUCK YOU WANT TO.
18 # SlackBuild script for tut
19 # ===========================
20 # By: r1w1s1 (https://fosstodon.org/@r1w1s1)
22 # Descr: Tut is a Mastodon TUI (Terminal User Interface) client
23 # URL: https://github.com/RasmusLindroth/tut
25 # v2.0.1: 10/august/2024 by r1w1s1 - Initial build.
27 cd $
(dirname $0) ; CWD
=$
(pwd)
30 VERSION
=${VERSION:-2.0.1} # Replace with the latest version
33 PKGTYPE
=${PKGTYPE:-tgz}
36 PKG
=$TMP/package-
$PRGNAM
37 OUTPUT
=${OUTPUT:-/tmp}
39 if [ -z "$ARCH" ]; then
40 case "$( uname -m )" in
43 *) ARCH
=$
( uname
-m ) ;;
47 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
48 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
52 if [ "$ARCH" = "i586" ]; then
53 SLKCFLAGS
="-O2 -march=i586 -mtune=i686"
55 elif [ "$ARCH" = "i686" ]; then
56 SLKCFLAGS
="-O2 -march=i686 -mtune=i686"
58 elif [ "$ARCH" = "x86_64" ]; then
69 mkdir
-p $TMP $PKG $OUTPUT
71 rm -rf $PRGNAM-$VERSION
72 tar xvf
$CWD/$PRGNAM-$VERSION.
tar.gz
73 cd ${PRGNAM}-${VERSION}
76 CGO_CFLAGS
="$SLKCFLAGS" \
77 CGO_CXXFLAGS
="$SLKCFLAGS" \
79 install -Dm755 $PRGNAM $PKG/usr
/bin
/$PRGNAM
82 find $PKG -type f
-exec strip
--strip-unneeded {} \
;
84 # Copy the Slackware packaging templates
85 mkdir
-p $PKG/usr
/doc
/$PRGNAM-$VERSION
86 cp -a README.md LICENSE config.example.toml
$PKG/usr
/doc
/$PRGNAM-$VERSION
87 cp -a config
/toot.tmpl
$PKG/usr
/doc
/$PRGNAM-$VERSION
88 cp -a config
/user.tmpl
$PKG/usr
/doc
/$PRGNAM-$VERSION
89 cat $CWD/$PRGNAM.SlackBuild
> $PKG/usr
/doc
/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
92 mkdir
-p $PKG/usr
/doc
/$PRGNAM-$VERSION/themes
93 cp config
/themes
/* $PKG/usr
/doc
/$PRGNAM-$VERSION/themes
95 # Install and compress man pages
98 mkdir
-p $PKG/usr
/man
/man
$i
99 cp -r docs
/man
/tut.
$i $PKG/usr
/man
/man
$i/tut.
$i
101 gzip -9 $PKG/usr
/man
/man
[0-9]/$PRGNAM.
[0-9]
103 find $PKG -print0 |
xargs -0 file |
grep -e "executable" -e "shared object" |
grep ELF \
104 | cut
-f 1 -d : |
xargs strip
--strip-unneeded 2> /dev
/null || true
106 # Create the package description
107 mkdir
-p $PKG/install
108 cp $CWD/slack-desc
$PKG/install
/slack-desc
112 /sbin
/makepkg
-l y
-c n
$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.
$PKGTYPE