diff options
-rw-r--r-- | games/tint/README | 11 | ||||
-rw-r--r-- | games/tint/doinst.sh | 12 | ||||
-rw-r--r-- | games/tint/key_up_rotate.diff | 54 | ||||
-rw-r--r-- | games/tint/tint.6 | 91 | ||||
-rw-r--r-- | games/tint/tint.SlackBuild | 85 |
5 files changed, 214 insertions, 39 deletions
diff --git a/games/tint/README b/games/tint/README index d903ad2b326b..ea19ae7c9246 100644 --- a/games/tint/README +++ b/games/tint/README @@ -1,3 +1,5 @@ +tint (tetris clone for the terminal) + TINT Is Not Tetris As the title suggests, this is a clone of the original tetris game. @@ -5,3 +7,12 @@ As the title suggests, this is a clone of the original tetris game. The game is as close to the original as possible, but there are a few differences. Nevertheless, it's probably the closest to the original that you'll ever find in the UNIX world. + +The game runs in a terminal, and is controlled by the keyboard. + +This build patches the code: +- up arrow rotates the piece instead of speeding up the game. +- capital (shifted) letters are accepted for S/D/A/P/Q. + +If you *really* don't like the idea of patching the code, set +PRISTINE=yes in the script's environment to build without patching. diff --git a/games/tint/doinst.sh b/games/tint/doinst.sh index 7023b6066524..445071dc2c20 100644 --- a/games/tint/doinst.sh +++ b/games/tint/doinst.sh @@ -1,7 +1,13 @@ -touch /var/games/tint.scores -chown root:games /var/games/tint.scores -chmod 0664 /var/games/tint.scores +touch var/games/tint.scores +chown root:games var/games/tint.scores +chmod 0664 var/games/tint.scores if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/games/tint/key_up_rotate.diff b/games/tint/key_up_rotate.diff new file mode 100644 index 000000000000..26e8f59c47aa --- /dev/null +++ b/games/tint/key_up_rotate.diff @@ -0,0 +1,54 @@ +diff -Naur tint-0.07/tint.c tint-0.07.patched/tint.c +--- tint-0.07/tint.c 2022-02-06 11:57:02.000000000 -0500 ++++ tint-0.07.patched/tint.c 2024-10-08 21:48:52.809771728 -0400 +@@ -607,14 +607,18 @@ + switch (ch) + { + case 'j': ++ case 'J': + case KEY_LEFT: + engine_move (&engine,ACTION_LEFT); + break; + case 'k': ++ case 'K': + case '\n': ++ case KEY_UP: + engine_move (&engine,ACTION_ROTATE); + break; + case 'l': ++ case 'L': + case KEY_RIGHT: + engine_move (&engine,ACTION_RIGHT); + break; +@@ -624,15 +628,17 @@ + break; + /* show next piece */ + case 's': ++ case 'S': + shownext = TRUE; + break; + /* toggle dotted lines */ + case 'd': ++ case 'D': + dottedlines = !dottedlines; + break; + /* next level */ + case 'a': +- case KEY_UP: ++ case 'A': + if (level < MAXLEVEL) + { + level++; +@@ -642,10 +648,12 @@ + break; + /* quit */ + case 'q': ++ case 'Q': + finished = TRUE; + break; + /* pause */ + case 'p': ++ case 'P': + out_setcolor (COLOR_WHITE,COLOR_BLACK); + out_gotoxy ((out_width () - 34) / 2,out_height () - 2); + out_printf ("Paused - Press any key to continue"); diff --git a/games/tint/tint.6 b/games/tint/tint.6 new file mode 100644 index 000000000000..901ba2cd5a1e --- /dev/null +++ b/games/tint/tint.6 @@ -0,0 +1,91 @@ +.TH TINT 6 "October 8, 2024" "@VERSION@" "SlackBuilds.org" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp <n> insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +tint \- clone of the original Tetris +.SH SYNOPSIS +.B tint +.RI [ -h ] +.RI [ -l\ level ] +.RI [ -n ] +.RI [ -d ] +.RI [ -b\ char ] +.SH DESCRIPTION +This manual page documents the game +.B tint +(a tetris clone). As with all games (and especially with tint), you have to play it, +not read about it. +.P +A summary of options and keyboard controls is included below. +For a complete description, see the NOTES file in /usr/doc/tint-@VERSION@. +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-l <level> +Specify the starting level (1-9). The higher the level you're starting from, +the faster you'll earn points. +.TP +.B \-n +Draw next shape. When the next shape is drawn, you might find the game to be +easier, but it will be slower to earn points. +.TP +.B \-d +Draw dotted lines. +.TP +.B \-b <char> +Use the specified character (instead of spaces) to draw blocks. +.SH KEYBOARD +.TP +.B Left Arrow, j +Move piece left. +.TP +.B Right Arrow, l +Move piece right. +.TP +.B Up Arrow, Enter +Rotate piece. +.TP +.B Down Arrow, Space +Drop piece. +.TP +.B s +Show next piece (same as \-n option). +.TP +.B d +Show dotted lines (toggle \-d option). +.TP +.B a +Speed up game (next value of \-n option, up to 9). +.TP +.B p +Pause game. +.TP +.B q +Quit game and exit \fBtint\fR. +.SH FILES +.TP +.B /var/games/tint.scores +High scores are stored here. The file is group-owned by the \fBgames\fR +group, and the game runs setgid so that all users' high scores can be +written to the file. +.PP +To reset the high scores, you can truncate the file to zero bytes, but +don't delete it or change its permissions/ownership. One way to do this: +.PP +root@darkstar# truncate -s0 /var/games/tint.scores +.SH AUTHOR +This manual page was written by Abraham van der Merwe <abz@debian.org>, +for the Debian GNU/Linux system (but may be used by others). It has been +modified for use by the SlackBuilds.org project by B. Watson <urchlay@slackware.uk>. diff --git a/games/tint/tint.SlackBuild b/games/tint/tint.SlackBuild index cd824dc76842..bc3fc809f6b5 100644 --- a/games/tint/tint.SlackBuild +++ b/games/tint/tint.SlackBuild @@ -2,31 +2,28 @@ # Slackware build script for tint -# Copyright 2022 Alexander Verbovetsky Moscow Russia -# All rights reserved. -# -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: -# -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Original author: Alexander Verbovetsky, Moscow, Russia. +# Modified and now maintained by B. Watson <urchlay@slackware.uk>. +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20241008 bkw: v0.07, BUILD=2: +# - take over maintenance. +# - relicense as WTFPL. +# - fix .desktop file. +# - binary in /usr/games. +# - use a modified man page (include keystrokes, for one thing). +# - new-style icons. +# - fix score file handling in doinst.sh (relative path, not abs). +# - add CREDITS and copyright to doc dir. +# - patch the game to make the controls not suck. yes, this breaks +# the Slackware philosophy; no, you're not going to change my mind. +# build with PRISTINE=yes if it bothers you. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=tint VERSION=${VERSION:-0.07} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -49,16 +46,12 @@ OUTPUT=${OUTPUT:-/tmp} 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 @@ -70,26 +63,46 @@ rm -rf $PRGNAM-$VERSION tar xvf $CWD/${PRGNAM}_$VERSION.tar.xz cd $PRGNAM-$VERSION chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +# 20241008 bkw: I find this game utterly unplayable without this patch. +# I keep hitting the up-arrow, expecting it to rotate the piece like +# in all the other tetris clones I've played. Instead, it speeds up +# the game... and there's no "slow down" option, in case I hit it by +# accident. +# With the patch, up is rotate, and speed-up is still available +# with the A key. The patch also allows uppercase keystrokes, in case +# the user's dumb enough to have caps lock enabled. +[ "${PRISTINE:-no}" = "yes" ] || patch -p1 < $CWD/key_up_rotate.diff CFLAGS="$SLKCFLAGS" \ make -install -D -o root -g games -m 2755 -s tint $PKG/usr/bin/tint -sed -i 's|/usr/share/doc/tint|/usr/doc/tint-*|' tint.6 -install -D -m 644 tint.6 $PKG/usr/man/man6/tint.6 -gzip -9 $PKG/usr/man/man6/tint.6 -install -D -m 644 debian/tint.png $PKG/usr/share/pixmaps/tint.png -install -D -m 644 debian/tint.desktop $PKG/usr/share/applications/tint.desktop +mkdir -p $PKG/usr/games $PKG/usr/man/man6 $PKG/usr/share/applications + +install -o root -g games -m 2755 -s tint $PKG/usr/games/tint + +# 20241008 bkw: man page based on upstream's, but expanded. +sed "s,@VERSION@,$VERSION," < $CWD/tint.6 | gzip -9c > $PKG/usr/man/man6/tint.6.gz + +sed '/^Exec=/s,=\(.*\),="\1",' \ + < debian/tint.desktop \ + > $PKG/usr/share/applications/tint.desktop + +for px in 22 32 48 64 128; do + sz=${px}x${px} + dir=$PKG/usr/share/icons/hicolor/$sz/apps + mkdir -p $dir + convert -resize $sz debian/tint.png $dir/tint.png +done +mkdir -p $PKG/usr/share/pixmaps/ +ln -s ../icons/hicolor/48x48/apps/tint.png $PKG/usr/share/pixmaps/tint.png mkdir -p $PKG/var/games mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a NOTES debian/changelog $PKG/usr/doc/$PRGNAM-$VERSION +cp -a CREDITS NOTES debian/{changelog,copyright} $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install |