From d884fa6c2e5bbdda2ddb51fc1f1d03d5dcce6601 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Sun, 9 Dec 2012 11:00:38 -0500 Subject: games/njam: Added (The most addictive free pacman-like game) Signed-off-by: dsomero --- games/njam/README | 16 ++++ games/njam/doinst.sh | 3 + games/njam/njam.SlackBuild | 110 ++++++++++++++++++++++++++ games/njam/njam.desktop | 7 ++ games/njam/njam.info | 10 +++ games/njam/njam.png | Bin 0 -> 2988 bytes games/njam/patches/changed_hiscore_name.patch | 68 ++++++++++++++++ games/njam/patches/drop_gda.patch | 103 ++++++++++++++++++++++++ games/njam/patches/gcc_46.patch | 28 +++++++ games/njam/slack-desc | 19 +++++ 10 files changed, 364 insertions(+) create mode 100644 games/njam/README create mode 100644 games/njam/doinst.sh create mode 100644 games/njam/njam.SlackBuild create mode 100644 games/njam/njam.desktop create mode 100644 games/njam/njam.info create mode 100644 games/njam/njam.png create mode 100644 games/njam/patches/changed_hiscore_name.patch create mode 100644 games/njam/patches/drop_gda.patch create mode 100644 games/njam/patches/gcc_46.patch create mode 100644 games/njam/slack-desc (limited to 'games/njam') diff --git a/games/njam/README b/games/njam/README new file mode 100644 index 0000000000..3a78f789eb --- /dev/null +++ b/games/njam/README @@ -0,0 +1,16 @@ +NjAM is a full-featured cross-platform pacman like game. +Features: + +- Single and multiplayer mode (local or via network) +- Duel mode (players compete against each other to get more points. + Similar to bingo games where the other players help add to the + jackpot winnings) +- Cooperative mode (players try to finish as many levels as they can) +- Great music and sound effects +- As addictive as Bingo online and other games like blackjack, poker, + or roulette - but free! +- Ported to many operating systems including Windows and Linux +- Customizable level skins +- Many different levels +- Integrated level editor to add your own levels +- Open Source (GPL Licence) diff --git a/games/njam/doinst.sh b/games/njam/doinst.sh new file mode 100644 index 0000000000..5fb28930db --- /dev/null +++ b/games/njam/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/njam/njam.SlackBuild b/games/njam/njam.SlackBuild new file mode 100644 index 0000000000..94ea4754b5 --- /dev/null +++ b/games/njam/njam.SlackBuild @@ -0,0 +1,110 @@ +#!/bin/sh + +# Slackware build script for njam + +# Copyright 2012 Petar Petrov, ppetrov@paju.oulu.fi +# 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=njam +VERSION=${VERSION:-1.25} +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 + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION-src +tar xvf $CWD/${PRGNAM}_${VERSION}.orig.tar.gz +cd $PRGNAM-$VERSION-src +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 {} \; + +# Thanks to Debian for the patches (and the source tarball!) +patch -p1 < $CWD/patches/changed_hiscore_name.patch +patch -p1 < $CWD/patches/drop_gda.patch +patch -p1 < $CWD/patches/gcc_46.patch + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + ChangeLog COPYING INSTALL PREINSTALL README TODO html \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/usr/share/{applications,pixmaps} +cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications +cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps + +# Clean up +rm -rf $PKG/usr/share/$PRGNAM/{html,README} + +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/njam/njam.desktop b/games/njam/njam.desktop new file mode 100644 index 0000000000..b70093d9ed --- /dev/null +++ b/games/njam/njam.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=NjAM +Exec=njam -w +Icon=njam.png +Categories=Game; +Terminal=false diff --git a/games/njam/njam.info b/games/njam/njam.info new file mode 100644 index 0000000000..b1ac23885a --- /dev/null +++ b/games/njam/njam.info @@ -0,0 +1,10 @@ +PRGNAM="njam" +VERSION="1.25" +HOMEPAGE="http://njam.sourceforge.net/" +DOWNLOAD="http://ftp.de.debian.org/debian/pool/main/n/njam/njam_1.25.orig.tar.gz" +MD5SUM="231fda022d309e1ef4a0d993ca693462" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Petar Petrov" +EMAIL="ppetrov@paju.oulu.fi" diff --git a/games/njam/njam.png b/games/njam/njam.png new file mode 100644 index 0000000000..df78618006 Binary files /dev/null and b/games/njam/njam.png differ diff --git a/games/njam/patches/changed_hiscore_name.patch b/games/njam/patches/changed_hiscore_name.patch new file mode 100644 index 0000000000..d6cd8b2313 --- /dev/null +++ b/games/njam/patches/changed_hiscore_name.patch @@ -0,0 +1,68 @@ +#! /bin/sh -e +## changed_hiscore_name.dpatch by Anibal Avelar +## +## DP: apply patch to change the hiscore name + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +diff -bBdNrw -U5 njam-1.25/src/njam.cpp njam-1.25.modif/src/njam.cpp +--- njam-1.25/src/njam.cpp 2005-12-13 05:56:43.000000000 -0600 ++++ njam-1.25.modif/src/njam.cpp 2008-05-12 11:59:46.694847801 -0500 +@@ -235,11 +235,11 @@ + fprintf(fp, "I=%s\n", m_GameOptions.ServerIP); + fclose(fp); + } + + // format: NAME#POINTS#LEVEL# +- fp = fopen("hiscore.dat", "w+"); ++ fp = fopen("njam-hiscore.dat", "w+"); + if (fp) + { + for (int i=0; i<10; i++) + fprintf(fp, "%s#%d#%d#\n", TopTenScores[i].name, TopTenScores[i].points, TopTenScores[i].level); + fclose(fp); +@@ -647,11 +647,11 @@ + } + else + LogFile("Failed to open conf file.\n"); + + // create default hiscore +- LogFile("Creating default hiscore.\n"); ++ LogFile("Creating default njam-hiscore.\n"); + char DefaultNames[10][10] = { + "MILAN", "TANJA", + "DULIO", "DJORDJE", + "CLAUS", "ENZO", + "JOLAN", "JAAP", +@@ -663,14 +663,14 @@ + sprintf(TopTenScores[i].name, "%s\0", DefaultNames[i]); + } + + // load hiscore from file (if any) + // format: NAME#POINTS#LEVEL# +- fp = fopen("hiscore.dat", "r"); ++ fp = fopen("njam-hiscore.dat", "r"); + if (fp) + { +- LogFile("Reading hiscore.dat\n"); ++ LogFile("Reading njam-hiscore.dat\n"); + char buff[40]; + int number = 0; + while (!feof(fp) && number < 10) + { + fgets(buff, 40, fp); diff --git a/games/njam/patches/drop_gda.patch b/games/njam/patches/drop_gda.patch new file mode 100644 index 0000000000..5973420b25 --- /dev/null +++ b/games/njam/patches/drop_gda.patch @@ -0,0 +1,103 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +Description: drop DGA support, fixing SDL_VIDEODRIVER parsing issues +Author: Hans de Goede +Last-Update: 2011-12-13 + +Index: njam-1.25/src/njam.cpp +=================================================================== +--- njam-1.25.orig/src/njam.cpp 2012-07-04 16:46:32.000000000 +0000 ++++ njam-1.25/src/njam.cpp 2012-07-04 16:49:29.000000000 +0000 +@@ -52,7 +52,6 @@ + { + bool Fullscreen = true; + bool SWSurface = true; +- bool UseDGA = false; + if (argc > 1) + { + for (int i=1; i +Last-Update: 2011-07-15 + +=== modified file 'src/njamedit.cpp' +--- a/src/njamedit.cpp 2006-07-27 23:15:50 +0000 ++++ b/src/njamedit.cpp 2011-07-15 20:01:54 +0000 +@@ -114,7 +114,7 @@ + key = SDLK_a; + else if (CheckForSave()) + { +- LogFile::LogFile("Saving maps"); ++ LogFile("Saving maps"); + m_Maps.Save(filename); + level_type_was = level_type; + changed = false; +@@ -131,7 +131,7 @@ + char types[2][5] = { "COOP", "DUEL" }; + sprintf(buf, "levels/%s.%s\0", filename, types[level_type]); + sprintf(filename, "%s\0", buf); +- LogFile::LogFile("Saving maps"); ++ LogFile("Saving maps"); + m_Maps.Save(filename); + level_type_was = level_type; + changed = false; + diff --git a/games/njam/slack-desc b/games/njam/slack-desc new file mode 100644 index 0000000000..7ab8c2e04d --- /dev/null +++ b/games/njam/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------------------------------------------------------| +njam: njam (The most addictive free pacman-like game) +njam: +njam: Njam is a full-featured cross-platform pac-man like game. +njam: +njam: +njam: +njam: +njam: +njam: +njam: +njam: -- cgit v1.2.3