diff options
Diffstat (limited to 'games-arcade')
-rw-r--r-- | games-arcade/njam/ChangeLog | 8 | ||||
-rw-r--r-- | games-arcade/njam/Manifest | 5 | ||||
-rw-r--r-- | games-arcade/njam/files/digest-njam-1.00 | 1 | ||||
-rw-r--r-- | games-arcade/njam/files/njam-1.00-conf.patch | 112 | ||||
-rw-r--r-- | games-arcade/njam/njam-1.00.ebuild | 68 |
5 files changed, 191 insertions, 3 deletions
diff --git a/games-arcade/njam/ChangeLog b/games-arcade/njam/ChangeLog index 125b7d56af51..0bb000e3ad3c 100644 --- a/games-arcade/njam/ChangeLog +++ b/games-arcade/njam/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for games-arcade/njam # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-arcade/njam/ChangeLog,v 1.2 2003/09/10 20:32:23 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-arcade/njam/ChangeLog,v 1.3 2003/11/07 08:17:37 mr_bones_ Exp $ + +*njam-1.00 (07 Nov 2003) + + 07 Nov 2003; Michael Sterrett <mr_bones_@gentoo.org> njam-1.00.ebuild, + files/njam-1.00-conf.patch: + version bump for bug 32790 *njam-0.96 (29 Jul 2003) diff --git a/games-arcade/njam/Manifest b/games-arcade/njam/Manifest index cd1c06491acd..1d8e1ede7e4d 100644 --- a/games-arcade/njam/Manifest +++ b/games-arcade/njam/Manifest @@ -1,8 +1,9 @@ -MD5 b4255506ede4ab6adec664c1be901334 ChangeLog 438 +MD5 8e1d51710fcbe91d3b14fd87f4d450d1 ChangeLog 600 MD5 0776961623f561e8a71330d2ba24f28b njam-0.96.ebuild 1008 -MD5 c63f6a8c74a62085c8dfc849151f8e68 njam-1.00.ebuild 1013 +MD5 ec82fd91c6b1f07f3b2b63d969cba7ae njam-1.00.ebuild 2128 MD5 b244cf1c41a78cacb62296d573935c07 metadata.xml 245 MD5 959b0cda2752af90309b81d91e8984fb files/digest-njam-0.96 66 MD5 8fa83f62f9156efb50d3e66e8b1dba2a files/digest-njam-1.00 66 +MD5 39dee9ea7a61dbef098f3a7421758fef files/njam-1.00-conf.patch 3136 MD5 cd9bb343d66a3e25ae8edd50bef223de files/0.96/njam.diff 7257 MD5 136cbe591908936157d78aa9858ea054 files/0.96/njamgame.diff 980 diff --git a/games-arcade/njam/files/digest-njam-1.00 b/games-arcade/njam/files/digest-njam-1.00 new file mode 100644 index 000000000000..89bc9b172246 --- /dev/null +++ b/games-arcade/njam/files/digest-njam-1.00 @@ -0,0 +1 @@ +MD5 88b276a1334477295fc3ba3cc44e05fd njam-1.00-src.tar.gz 1342417 diff --git a/games-arcade/njam/files/njam-1.00-conf.patch b/games-arcade/njam/files/njam-1.00-conf.patch new file mode 100644 index 000000000000..d0acc9699367 --- /dev/null +++ b/games-arcade/njam/files/njam-1.00-conf.patch @@ -0,0 +1,112 @@ +--- njam.cpp.orig 2003-11-06 23:59:22.000000000 -0800 ++++ njam.cpp 2003-11-06 23:59:50.000000000 -0800 +@@ -33,6 +33,8 @@ + // needed for chdir
+ #ifdef __linux__
+ #include <unistd.h>
++#include <sys/stat.h>
++#include <sys/types.h>
+ #endif
+
+ #include <stdio.h>
+@@ -213,16 +215,30 @@ + if (m_NetworkAvailable)
+ SDLNet_Quit();
+
++ FILE *fp;
+ // write configuration options
+- char filename[] = "njam.conf";
+- FILE *fp = fopen(filename, "w+");
+- if (fp)
++ if (getenv("HOME") && !chdir(getenv("HOME")))
+ {
+- fprintf(fp, "M=%d\n", (m_GameOptions.PlayMusic ? 1 : 0));
+- fprintf(fp, "S=%d\n", (m_GameOptions.PlaySound ? 1 : 0));
+- fprintf(fp, "A=%d\n", (m_GameOptions.UseAllSkins ? 1 : 0));
+- fprintf(fp, "I=%s\n", m_GameOptions.ServerIP);
+- fclose(fp);
++ mkdir(".njam", 0774);
++ if (!chdir(".njam"))
++ {
++ char filename[] = "njam.conf";
++ fp = fopen(filename, "w+");
++
++ if (fp)
++ {
++ fprintf(fp,
++ "M=%d\n"
++ "S=%d\n"
++ "A=%d\n"
++ "I=%s\n",
++ (m_GameOptions.PlayMusic ? 1 : 0),
++ (m_GameOptions.PlaySound ? 1 : 0),
++ (m_GameOptions.UseAllSkins ? 1 : 0),
++ m_GameOptions.ServerIP);
++ fclose(fp);
++ }
++ }
+ }
+
+ // format: NAME#POINTS#LEVEL#
+@@ -597,35 +613,39 @@ + m_FontBlue = new NjamFont("data/font-blue.bmp", 6, 9);
+ m_FontYellow = new NjamFont("data/font-yellow.bmp", 10, 15);
+
++ FILE *fp;
+ // Load user settings from .conf file
+- char filename[] = "njam.conf";
+- FILE *fp = fopen(filename, "r");
+- if (fp)
++ if (getenv("HOME") && !chdir(getenv("HOME")) && !chdir(".njam"))
+ {
+- LogFile("Reading njam.conf file.\n");
+- char buff[20];
+- while (!feof(fp))
+- {
+- fgets(buff, 20, fp);
+- if (buff[1] == '=')
++ char filename[] = "njam.conf";
++ fp = fopen(filename, "r");
++ if (fp)
++ {
++ LogFile("Reading njam.conf file.\n");
++ char buff[20];
++ while (!feof(fp))
+ {
+- int i;
+- switch (buff[0])
++ fgets(buff, 20, fp);
++ if (buff[1] == '=')
+ {
+- case 'M': m_GameOptions.PlayMusic = (buff[2] == '1'); break;
+- case 'S': m_GameOptions.PlaySound = (buff[2] == '1'); break;
+- case 'A': m_GameOptions.UseAllSkins = (buff[2] == '1'); break;
+- case 'I': // serverIP
+- for (i=2; buff[i] != '\n' && buff[i] && i<17; i++)
+- m_GameOptions.ServerIP[i-2] = buff[i];
+- m_GameOptions.ServerIP[i] = '\0';
+- break;
+- default:
+- printf("Unknown configuration file option: %c\n", buff[0]);
++ int i;
++ switch (buff[0])
++ {
++ case 'M': m_GameOptions.PlayMusic = (buff[2] == '1'); break;
++ case 'S': m_GameOptions.PlaySound = (buff[2] == '1'); break;
++ case 'A': m_GameOptions.UseAllSkins = (buff[2] == '1'); break;
++ case 'I': // serverIP
++ for (i=2; buff[i] != '\n' && buff[i] && i<17; i++)
++ m_GameOptions.ServerIP[i-2] = buff[i];
++ m_GameOptions.ServerIP[i] = '\0';
++ break;
++ default:
++ printf("Unknown configuration file option: %c\n", buff[0]);
++ }
+ }
+ }
++ fclose(fp);
+ }
+- fclose(fp);
+ }
+
+ // create default hiscore
diff --git a/games-arcade/njam/njam-1.00.ebuild b/games-arcade/njam/njam-1.00.ebuild new file mode 100644 index 000000000000..711359be0104 --- /dev/null +++ b/games-arcade/njam/njam-1.00.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-arcade/njam/njam-1.00.ebuild,v 1.1 2003/11/07 08:17:37 mr_bones_ Exp $ + +inherit games + +MY_P="${P}-src" +S="${WORKDIR}/${MY_P}" +DESCRIPTION="Multi or single-player network Pacman-like game in SDL" +HOMEPAGE="http://njam.sourceforge.net/" +SRC_URI="mirror://sourceforge/njam/${MY_P}.tar.gz" +RESTRICT="nomirror" + +KEYWORDS="x86" +LICENSE="GPL-2" +SLOT="0" + +RDEPEND=">=media-libs/sdl-mixer-1.2.5 + >=media-libs/sdl-image-1.2.2 + >=media-libs/libsdl-1.2.5 + >=media-libs/sdl-net-1.2.4" +DEPEND="${RDEPEND} + >=sys-apps/sed-4" + +src_unpack() { + unpack ${A} + cd ${S} + + # store the conf file in the user's home directory. + epatch ${FILESDIR}/${P}-conf.patch + + sed -i \ + -e "s:\"data:\"${GAMES_DATADIR}/${PN}/data:" njam.cpp njamgame.cpp || \ + die "sed njam.cpp and njamgame.cpp failed" + sed -i \ + -e "s:\"hiscore.dat:\"${GAMES_STATEDIR}/${PN}/hiscore.dat:" \ + -e "s:\"skins:\"${GAMES_DATADIR}/${PN}/skins:" njam.cpp || \ + die "sed njam.cpp failed" + sed -i \ + -e "s:\"levels:\"${GAMES_DATADIR}/${PN}/levels:" njamedit.cpp || \ + die "sed njamedit.cpp failed" + sed -i \ + -e "s:\"log.txt:\"/dev/null:" njamutils.cpp || \ + die "sed njamutils.cpp failed" + sed -i \ + -e "s:-O3:${CFLAGS}:" Makefile || \ + die "sed Makefile failed" +} + +src_compile() { + emake PREFIX="/usr/share" || die "emake failed" +} + +src_install() { + dogamesbin njam || die "dogamesbin failed" + dodoc CHANGES README TODO || die "dodoc failed" + dohtml html/* || die "dohtml failed" + insinto ${GAMES_DATADIR}/njam/data + doins data/* || die "doins failed (data)" + insinto ${GAMES_DATADIR}/njam/skins + doins skins/* || die "doins failed (skins)" + insinto ${GAMES_DATADIR}/njam/levels + doins levels/* || die "doins failed (levels)" + dodir "${GAMES_STATEDIR}/${PN}" || die "dodir failed" + touch "${D}${GAMES_STATEDIR}/${PN}/hiscore.dat" + fperms 664 "${GAMES_STATEDIR}/${PN}/hiscore.dat" || die "fperms failed" + prepgamesdirs +} |