games/njam: New maintainer, various tweaks.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2024-08-18 03:36:15 -04:00 committed by Willy Sudiarto Raharjo
parent be7a270ab9
commit 23d3220f04
No known key found for this signature in database
GPG key ID: 3F617144D7238786
7 changed files with 73 additions and 42 deletions

View file

@ -1,3 +1,5 @@
njam (The most addictive free pacman-like game)
NjAM is a full-featured cross-platform pacman like game.
Features:

View file

@ -1,3 +1,9 @@
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

19
games/njam/njam.6 Normal file
View file

@ -0,0 +1,19 @@
.TH "NJAM" "6"
.SH "NAME"
njam - Pacman-like game with multiplayer support
.SH "SYNOPSIS"
.PP
\fBnjam\fR [\-w] [\-h]
.SH "DESCRIPTION"
.PP
This manual page documents briefly the
\fBnjam\fR command.
.PP
\fBnjam\fR is a pacman-like game with multiplayer support.
.SH "OPTIONS"
.PP
.IP "\fB\-w\fP " 10
Start in windowed mode (as opposed to fullscreen)
.IP "\fB\-h\fP " 10
use hardware surfaces (faster, doesn't work well with all graphic cards)

View file

@ -2,31 +2,22 @@
# Slackware build script for njam
# Copyright 2012-2021 Petar Petrov slackalaxy@gmail.com
# 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.
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20240817 bkw: BUILD=3
# - new maintainer.
# - relicense as WTFPL.
# - get INSTALL and PREINSTALL out of doc dir (unneeded).
# - binary in /usr/games.
# - put icon in /usr/share/icons (symlink back to /usr/share/pixmaps).
# - include Debian's man page in the package.
# - gtk-update-icon-cache in doinst.sh.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=njam
VERSION=${VERSION:-1.25}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -38,9 +29,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -73,43 +61,43 @@ rm -rf $PRGNAM-$VERSION-src
tar xvf $CWD/${PRGNAM}_${VERSION}.orig.tar.gz
cd $PRGNAM-$VERSION-src
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 {} +
# 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
patch -p1 < $CWD/patches/fix_error_gcc.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--bindir=/usr/games \
--sysconfdir=/etc \
--localstatedir=/var \
--datadir=/usr/share/games \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
make install-strip 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
# man page is minimal, comes from Debian.
mkdir -p $PKG/usr/man/man6
gzip -9c < $CWD/njam.6 > $PKG/usr/man/man6/njam.6.gz
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
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a ChangeLog COPYING README TODO html $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/usr/share/{applications,pixmaps}
mkdir -p $PKG/usr/share/{applications,pixmaps,icons/hicolor/48x48/apps}
cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications
cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps
cp $CWD/$PRGNAM.png $PKG/usr/share/icons/hicolor/48x48/apps
ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
# Clean up
rm -rf $PKG/usr/share/$PRGNAM/{html,README}
mkdir -p $PKG/install

View file

@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=NjAM
Exec=njam -w
Exec=/usr/games/njam -w
Icon=njam
Categories=Game;
Terminal=false

View file

@ -6,5 +6,5 @@ MD5SUM="231fda022d309e1ef4a0d993ca693462"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Petar Petrov"
EMAIL="slackalaxy@gmail.com"
MAINTAINER="B. Watson"
EMAIL="urchlay@slackware.uk"

View file

@ -0,0 +1,16 @@
From: Daniel Echeverry <epsilon77@gmail.com>
Last-Update: 2013-01-04
Description: fix_error_gcc
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3
--- a/src/njamgame.cpp
+++ b/src/njamgame.cpp
@@ -228,7 +228,7 @@ void NjamEngine::StartGame(GameType Gt)
if (!temp)
{
printf("Loading file: %s", filename);
- printf(SDL_GetError());
+ printf("%s", SDL_GetError());
return;
}