From 5a6e0d97601afe7987b7246d25f613107b858764 Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Sat, 9 Feb 2013 12:53:49 -0600 Subject: games/tt: Added (Tetris for Terminals) Signed-off-by: Erik Hanson --- games/tt/README | 1 + games/tt/doinst.sh | 3 + games/tt/slack-desc | 19 ++++++ games/tt/tt.SlackBuild | 104 ++++++++++++++++++++++++++++++++ games/tt/tt.desktop | 11 ++++ games/tt/tt.info | 10 ++++ games/tt/tt.svg | 154 ++++++++++++++++++++++++++++++++++++++++++++++++ games/tt/user_dir.patch | 14 +++++ 8 files changed, 316 insertions(+) create mode 100644 games/tt/README create mode 100644 games/tt/doinst.sh create mode 100644 games/tt/slack-desc create mode 100644 games/tt/tt.SlackBuild create mode 100644 games/tt/tt.desktop create mode 100644 games/tt/tt.info create mode 100644 games/tt/tt.svg create mode 100644 games/tt/user_dir.patch (limited to 'games') diff --git a/games/tt/README b/games/tt/README new file mode 100644 index 000000000000..7002e30890e7 --- /dev/null +++ b/games/tt/README @@ -0,0 +1 @@ +Tetris running in a terminal window. diff --git a/games/tt/doinst.sh b/games/tt/doinst.sh new file mode 100644 index 000000000000..5fb28930db0b --- /dev/null +++ b/games/tt/doinst.sh @@ -0,0 +1,3 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi diff --git a/games/tt/slack-desc b/games/tt/slack-desc new file mode 100644 index 000000000000..830be8d4d682 --- /dev/null +++ b/games/tt/slack-desc @@ -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 ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +tt: tt (Tetris for Terminals) +tt: +tt: Tetris running in a terminal window. +tt: +tt: homepage: http://www.miketaylor.org.uk/tech/tt/ +tt: +tt: +tt: +tt: +tt: +tt: diff --git a/games/tt/tt.SlackBuild b/games/tt/tt.SlackBuild new file mode 100644 index 000000000000..3776024ece17 --- /dev/null +++ b/games/tt/tt.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/sh + +# Slackware build script for tt +# Copyright Matteo Bernardini , 2012 +# 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. + +PRGNAM=tt +VERSION=${VERSION:-15.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -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 + +DOCS="Attrib Meista NEWS Notes Porting README Testimonial Score" + +set -e # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Use $HOME for the lock file and to save high-scores +patch -p1 < $CWD/user_dir.patch + +make OPT="$SLKCFLAGS" +install -m 0755 -D $PRGNAM $PKG/usr/bin/$PRGNAM.real + +cat << EOF > $PKG/usr/bin/$PRGNAM +#!/bin/sh +[ -d ~/.tt ] || mkdir ~/.tt +cd ~/.tt +[ -f ttscores ] || touch ttscores +tt.real "\$@" +EOF +chmod 0755 $PKG/usr/bin/$PRGNAM + +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 + +# Install an icon and a .desktop file +install -m 0755 -D $CWD/$PRGNAM.svg $PKG/usr/share/pixmaps/$PRGNAM.svg +install -m 0755 -D $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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:-tgz} diff --git a/games/tt/tt.desktop b/games/tt/tt.desktop new file mode 100644 index 000000000000..ac6b8270c641 --- /dev/null +++ b/games/tt/tt.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=TT +Type=Application +Comment=Tetris for terminals +Terminal=true +Exec=tt +Icon=tt +Categories=ConsoleOnly;Game; +GenericName=Tetris for terminals +Encoding=UTF-8 diff --git a/games/tt/tt.info b/games/tt/tt.info new file mode 100644 index 000000000000..abf7d98f681d --- /dev/null +++ b/games/tt/tt.info @@ -0,0 +1,10 @@ +PRGNAM="tt" +VERSION="15.1" +HOMEPAGE="http://www.miketaylor.org.uk/tech/tt/" +DOWNLOAD="http://www.miketaylor.org.uk/tech/tt/tt-15.1.tar.gz" +MD5SUM="4631cc0d8c825fa74811d33781867c66" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Matteo Bernardini" +EMAIL="ponce@slackbuilds.org" diff --git a/games/tt/tt.svg b/games/tt/tt.svg new file mode 100644 index 000000000000..664604895f29 --- /dev/null +++ b/games/tt/tt.svg @@ -0,0 +1,154 @@ + + + + + tt icon + + + + + + image/svg+xml + + tt icon + 2013-01-19 + + + Matteo Bernardini + + + + + Creative Commons http://creativecommons.org/licenses/by-sa/3.0/ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/games/tt/user_dir.patch b/games/tt/user_dir.patch new file mode 100644 index 000000000000..24dfa8eb3550 --- /dev/null +++ b/games/tt/user_dir.patch @@ -0,0 +1,14 @@ +diff -Naur tt-15.1.orig/tt.c tt-15.1/tt.c +--- tt-15.1.orig/tt.c 2006-06-01 09:36:53.000000000 +0200 ++++ tt-15.1/tt.c 2013-01-19 16:05:27.358173158 +0100 +@@ -43,8 +43,8 @@ + + /*-------------------------------------------------------------------------*/ + +-char *LOCK_FILE = "/home/mike/lib/ttlock/ttlock"; +-char *SCORE_FILE = "/home/mike/lib/ttscores"; ++char *LOCK_FILE = "ttlock"; ++char *SCORE_FILE = "ttscores"; + + /* These four variables determine which game we're playing */ + struct piece *pieces = pieces4; -- cgit v1.2.3