Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

games/bsd-tetris: Added (Tetris game). #8991

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions games/bsd-tetris/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bsd-tetris (falling block game that runs in a terminal)

bsd-tetris is a clone of Tetris for terminals. It uses vi keystokes
for movement.

This game was in the y/tetris package in Slackware versions up to 3.2.
It was removed before the 3.3 release (on July 7, 1997).
113 changes: 113 additions & 0 deletions games/bsd-tetris/bsd-tetris.SlackBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/bin/bash

# Slackware build script for bsd-tetris

# Written by B. Watson ([email protected])

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

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

PRGNAM=bsd-tetris
VERSION=${VERSION:-2.17}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

SRCNAM=bsd-games

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}

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

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.lz --strip-components=2 --wildcards '*/tetris'
chown -R root:root .
chmod 644 *

# The Makefile.bsd is b0rked, can't build with either pmake or bmake.
# So simple that there's no need for a Makefile anyway.

SCOREDIR=/var/games/bsd-tetris
SCOREFILE=$SCOREDIR/tetris.scores
EXE=$PKG/usr/games/tetris
MAN6=$PKG/usr/man/man6
APPS=$PKG/usr/share/applications

mkdir -p $PKG/usr/games $MAN6 $APPS

echo "#define _PATH_SCOREFILE \"$SCOREFILE\"" > pathnames.h

set -x
${CC:-gcc} -o $EXE $SLKCFLAGS -Wl,-s -DINFTIM=-1 -Dlint -DOXTABS=XTABS *.c -ltermcap
set +x

sed "s,@tetris_scorefile@,$SCOREFILE," < tetris.6.in | gzip -9c > $MAN6/tetris.6.gz

# Package is called bsd-tetris, so make sure it can be called that way.
ln -s tetris $PKG/usr/games/$PRGNAM
ln -s tetris.6.gz $MAN6/$PRGNAM.6.gz

# The game runs setgid games, so it can write to the high score file.
mkdir -p $PKG/$SCOREDIR
touch $PKG/$SCOREFILE.new
chown root:games $PKG/$SCOREDIR $PKG/$SCOREFILE.new $EXE
chmod 775 $PKG/$SCOREDIR
chmod 664 $PKG/$SCOREFILE.new
chmod 2751 $EXE

# .desktop file written for this SlackBuild.
cat $CWD/$PRGNAM.desktop > $APPS/$PRGNAM.desktop

# Icon created for this SlackBuild.
for i in 32 48 64 128; do
sz=${i}x${i}
dir=$PKG/usr/share/icons/hicolor/$sz/apps
mkdir -p $dir
convert -resize $sz $CWD/icon.png $dir/$PRGNAM.png
done

mkdir -p $PKG/usr/share/pixmaps
ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps

PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cat $CWD/README > $PKGDOC/README
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
9 changes: 9 additions & 0 deletions games/bsd-tetris/bsd-tetris.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=BSD Tetris
GenericName=Puzzle Game
Exec=/usr/games/bsd-tetris
Icon=bsd-tetris
Terminal=true
Type=Application
Categories=Game;ArcadeGame;
Keywords=game;arcade;
10 changes: 10 additions & 0 deletions games/bsd-tetris/bsd-tetris.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PRGNAM="bsd-tetris"
VERSION="2.17"
HOMEPAGE="http://ftp.slackware.com/pub/slackware/slackware-15.0/source/y/bsd-games/"
DOWNLOAD="http://ftp.slackware.com/pub/slackware/slackware-15.0/source/y/bsd-games/bsd-games-2.17.tar.lz"
MD5SUM="8d719fc11841310d0c5a0267729609ef"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
EMAIL="[email protected]"
23 changes: 23 additions & 0 deletions games/bsd-tetris/doinst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
rm $NEW
fi
}

config var/games/bsd-tetris/tetris.scores.new
chown root:games var/games/bsd-tetris/tetris.scores
chmod 664 var/games/bsd-tetris/tetris.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
Binary file added games/bsd-tetris/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions games/bsd-tetris/slack-desc
Original file line number Diff line number Diff line change
@@ -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------------------------------------------------------|
bsd-tetris: bsd-tetris (falling block game that runs in a terminal)
bsd-tetris:
bsd-tetris: bsd-tetris is a clone of Tetris for terminals. It uses vi keystokes
bsd-tetris: for movement.
bsd-tetris:
bsd-tetris: This game was in the y/tetris package in Slackware versions up to 3.2.
bsd-tetris: It was removed before the 3.3 release (on July 7, 1997).
bsd-tetris:
bsd-tetris:
bsd-tetris:
bsd-tetris: