summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sterrett <mr_bones_@gentoo.org>2004-01-30 11:18:19 +0000
committerMichael Sterrett <mr_bones_@gentoo.org>2004-01-30 11:18:19 +0000
commit37c6f783874f526ee529a179c5f270dee55acdef (patch)
tree9d474cecd152e414f424132184073671b5366069 /games-action
parentinitial commit (diff)
downloadgentoo-2-37c6f783874f526ee529a179c5f270dee55acdef.tar.gz
gentoo-2-37c6f783874f526ee529a179c5f270dee55acdef.tar.bz2
gentoo-2-37c6f783874f526ee529a179c5f270dee55acdef.zip
initial commit
Diffstat (limited to 'games-action')
-rw-r--r--games-action/formido/ChangeLog10
-rw-r--r--games-action/formido/Manifest6
-rw-r--r--games-action/formido/files/digest-formido-1.02
-rw-r--r--games-action/formido/files/homedir.patch150
-rw-r--r--games-action/formido/formido-1.0.ebuild61
-rw-r--r--games-action/formido/metadata.xml9
6 files changed, 236 insertions, 2 deletions
diff --git a/games-action/formido/ChangeLog b/games-action/formido/ChangeLog
new file mode 100644
index 000000000000..d16f73030be2
--- /dev/null
+++ b/games-action/formido/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for games-action/formido
+# Copyright 2000-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-action/formido/ChangeLog,v 1.1 2004/01/30 11:18:13 mr_bones_ Exp $
+
+*formido-1.0 (30 Jan 2004)
+
+ 30 Jan 2004; Michael Sterrett <mr_bones_@gentoo.org> formido-1.0.ebuild,
+ metadata.xml, files/homedir.patch:
+ initial commit
+
diff --git a/games-action/formido/Manifest b/games-action/formido/Manifest
index ae50d7b2ae50..5b19b5325c09 100644
--- a/games-action/formido/Manifest
+++ b/games-action/formido/Manifest
@@ -1,3 +1,5 @@
-MD5 b69f52f3959cd580b002869b6cd1f688 formido-1.0.ebuild 1253
-MD5 2d05f5b96c8b7044de9a3b6bb828fc88 files/digest-formido-20031024 146
+MD5 10e6a093fd26ddacd08f7cf32f3bf219 formido-1.0.ebuild 1545
+MD5 b244cf1c41a78cacb62296d573935c07 metadata.xml 245
+MD5 1ac7955c4aaad680696fb5ae471488f2 ChangeLog 383
MD5 85c542a67baa6657dbe274491dd84d36 files/digest-formido-1.0 132
+MD5 aaf2970c6efd0a241e14e1113a2ef80e files/homedir.patch 4606
diff --git a/games-action/formido/files/digest-formido-1.0 b/games-action/formido/files/digest-formido-1.0
new file mode 100644
index 000000000000..df2f75e94ff4
--- /dev/null
+++ b/games-action/formido/files/digest-formido-1.0
@@ -0,0 +1,2 @@
+MD5 4019842f46a2bec5c642a2717486ac0a formido-1.0.tar.bz2 2965419
+MD5 8d344651a3bcfd1d809dab1bcec2b7ee formido-music.tar.bz2 6159005
diff --git a/games-action/formido/files/homedir.patch b/games-action/formido/files/homedir.patch
new file mode 100644
index 000000000000..f27598a3f980
--- /dev/null
+++ b/games-action/formido/files/homedir.patch
@@ -0,0 +1,150 @@
+diff -ru formido-1.0.orig/src/blend.cpp formido-1.0/src/blend.cpp
+--- formido-1.0.orig/src/blend.cpp 2003-11-07 10:59:01.000000000 -0800
++++ formido-1.0/src/blend.cpp 2004-01-30 02:22:04.000000000 -0800
+@@ -218,7 +218,7 @@
+ // 8-bit tables
+ else {
+ // First, try to load tables from 'data/alpha8.tab'
+- FILE *fin = fopen("data/alpha8.tab", "rb");
++ FILE *fin = fopen("./alpha8.tab", "rb");
+ if(fin) {
+ // Load the tables
+ fread(a_table8, sizeof(a_table8), 1, fin);
+@@ -251,7 +251,7 @@
+ }
+
+ // Save the table to disk
+- FILE *fout = fopen("data/alpha8.tab", "wb");
++ FILE *fout = fopen("./alpha8.tab", "wb");
+ if(fout) {
+ fwrite(a_table8, sizeof(a_table8), 1, fout);
+ fclose(fout);
+diff -ru formido-1.0.orig/src/config.cpp formido-1.0/src/config.cpp
+--- formido-1.0.orig/src/config.cpp 2003-11-07 10:59:01.000000000 -0800
++++ formido-1.0/src/config.cpp 2004-01-30 00:26:31.000000000 -0800
+@@ -30,8 +30,10 @@
+ void load_config(char *file, CONFIG *conf) {
+
+ FILE *f = fopen(file, "rt");
+- if(!f)
+- error_msg("Unable to load config file: %s!", file);
++ if(!f) {
++ if (!(f = fopen(CONFIG(file), "rt")))
++ error_msg("Unable to load config file: %s!", file);
++ }
+
+ fscanf(f, "video_mode_color_depth = %d\n", &(conf->vid_color_depth));
+ fscanf(f, "video_mode_fullscreen = %d\n", &(conf->fullscreen));
+diff -ru formido-1.0.orig/src/game.cpp formido-1.0/src/game.cpp
+--- formido-1.0.orig/src/game.cpp 2003-11-07 10:59:01.000000000 -0800
++++ formido-1.0/src/game.cpp 2004-01-30 00:31:12.000000000 -0800
+@@ -173,15 +173,15 @@
+
+ char file[100] = "";
+ int num = 0;
+- sprintf(file, "shot%03d.bmp", num);
++ sprintf(file, "./shot%03d.bmp", num);
+
+ game_paused = true;
+
+ // Check if exists
+- FILE *f = fopen(CONFIG(file), "r");
++ FILE *f = fopen(file, "r");
+ if(!f) {
+ // Doesn't exist, save it.
+- SDL_SaveBMP(screen, CONFIG(file));
++ SDL_SaveBMP(screen, file);
+ }
+ else {
+ fclose(f);
+@@ -189,14 +189,14 @@
+ // Exists, choose another name
+ while(num < 1000) {
+ num++;
+- sprintf(file, "shot%03d.bmp", num);
++ sprintf(file, "./shot%03d.bmp", num);
+
+
+ // Check if exists
+- f = fopen(CONFIG(file), "r");
++ f = fopen(file, "r");
+ if(!f) {
+ // Doesn't exist, save it.
+- SDL_SaveBMP(screen, CONFIG(file));
++ SDL_SaveBMP(screen, file);
+ break;
+ }
+ else
+diff -ru formido-1.0.orig/src/init.cpp formido-1.0/src/init.cpp
+--- formido-1.0.orig/src/init.cpp 2003-11-07 10:59:01.000000000 -0800
++++ formido-1.0/src/init.cpp 2004-01-30 00:23:08.000000000 -0800
+@@ -80,8 +80,7 @@
+ void init_sdl() {
+
+ // Load the config
+- //load_config("formido.cfg", &config);
+- load_config(CONFIG("formido.cfg"), &config);
++ load_config("formido.cfg", &config);
+
+ // Initialize SDL with video and audio support
+ if(config.sound) {
+diff -ru formido-1.0.orig/src/main.cpp formido-1.0/src/main.cpp
+--- formido-1.0.orig/src/main.cpp 2003-11-07 10:59:01.000000000 -0800
++++ formido-1.0/src/main.cpp 2004-01-30 00:29:09.000000000 -0800
+@@ -23,6 +23,9 @@
+ */
+
+ #include <stdlib.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <unistd.h>
+ #include "SDL.h"
+ #include "SDL_image.h"
+ #include "SDL_mixer.h"
+@@ -272,6 +275,15 @@
+
+ // The good old main()
+ int main(int argc, char *argv[]) {
++ if (!getenv("HOME")) {
++ error_msg("Environment variable HOME not set. Exiting.");
++ }
++ chdir(getenv("HOME"));
++ /* Don't check the return here because it may already exist. */
++ mkdir(".formido", 0744);
++ if (chdir(".formido") != 0) {
++ error_msg("Failed to change directories to ~/.formido");
++ }
+
+ // Initialize SDL
+ init_sdl();
+@@ -359,8 +371,7 @@
+
+
+ // Save the config
+- //save_config("formido.cfg", &config);
+- save_config(CONFIG("formido.cfg"), &config);
++ save_config("./formido.cfg", &config);
+
+ return 0;
+ }
+diff -ru formido-1.0.orig/src/menu.cpp formido-1.0/src/menu.cpp
+--- formido-1.0.orig/src/menu.cpp 2003-11-07 10:59:01.000000000 -0800
++++ formido-1.0/src/menu.cpp 2004-01-30 00:23:22.000000000 -0800
+@@ -262,7 +262,7 @@
+ menu_id = MENU_ID_MAIN;
+ menu_item = MENU_GAME_SETTINGS;
+ // Load back the initial settings from config
+- load_config(CONFIG("formido.cfg"), &config);
++ load_config("formido.cfg", &config);
+ Mix_VolumeMusic(config.music_vol);
+ }
+ else if(menu_id == MENU_ID_HALL_OF_FAME) {
+@@ -305,7 +305,7 @@
+ menu_item = MENU_GAME_SETTINGS;
+ menu_id = MENU_ID_MAIN;
+ // Save config
+- save_config(CONFIG("formido.cfg"), &config);
++ save_config("./formido.cfg", &config);
+ break;
+
+ // Keys
diff --git a/games-action/formido/formido-1.0.ebuild b/games-action/formido/formido-1.0.ebuild
new file mode 100644
index 000000000000..2befd0d304c4
--- /dev/null
+++ b/games-action/formido/formido-1.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-action/formido/formido-1.0.ebuild,v 1.1 2004/01/30 11:18:13 mr_bones_ Exp $
+
+inherit eutils games
+
+DESCRIPTION="A shooting game in the spirit of Phobia games"
+HOMEPAGE="http://www.mhgames.cjb.net/"
+SRC_URI="http://koti.mbnet.fi/lsoft/formido/${P}.tar.bz2
+ http://koti.mbnet.fi/lsoft/formido/formido-music.tar.bz2"
+
+LICENSE="GPL-2"
+KEYWORDS="x86"
+SLOT=0
+IUSE=""
+
+RDEPEND=">=media-libs/libsdl-1.2.5
+ >=media-libs/sdl-image-1.2.2
+ >=media-libs/sdl-mixer-1.2.4"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4"
+
+src_unpack() {
+ unpack ${P}.tar.bz2
+
+ cd ${S}
+ epatch "${FILESDIR}/homedir.patch"
+
+ sed -i \
+ -e "/^FLAGS/ s:$: ${CXXFLAGS}:" Makefile || \
+ die "sed Makefile failed"
+
+ cd ${S}/data
+ unpack ${PN}-music.tar.bz2
+}
+
+src_compile() {
+ emake \
+ CONFIGDIR="${GAMES_DATADIR}/${PN}" \
+ DATDIR="${GAMES_DATADIR}/${PN}/data" \
+ HISCOREDIR="${GAMES_STATEDIR}/${PN}" || die "emake failed"
+}
+
+src_install() {
+ dogamesbin formido || die "dogamesbin failed"
+ dodoc README || die "dodoc failed"
+
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins "${PN}.cfg" || die "doins failed (cfg)"
+
+ insinto "${GAMES_DATADIR}/${PN}/data"
+ doins data/* || die "doins failed (data)"
+ # no need to install this twice.
+ rm -f "${D}${GAMES_DATADIR}/${PN}/data/hiscore.dat"
+
+ insinto "${GAMES_STATEDIR}/${PN}"
+ insopts -m 664
+ doins data/hiscore.dat || die "doins failed (hiscore)"
+
+ prepgamesdirs
+}
diff --git a/games-action/formido/metadata.xml b/games-action/formido/metadata.xml
new file mode 100644
index 000000000000..499f8d9f075c
--- /dev/null
+++ b/games-action/formido/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>games</herd>
+<maintainer>
+ <email>games@gentoo.org</email>
+ <name>Games Team</name>
+</maintainer>
+</pkgmetadata>