Initial import. Based on ebuild by Alexandru Toma <flash3001 at yahoo.com>, bug ...
authorAndrej Kacian <ticho@gentoo.org>
Thu, 8 Sep 2005 18:27:06 +0000 (18:27 +0000)
committerAndrej Kacian <ticho@gentoo.org>
Thu, 8 Sep 2005 18:27:06 +0000 (18:27 +0000)
Package-Manager: portage-2.0.51.22-r2

games-strategy/netherearth/ChangeLog [new file with mode: 0644]
games-strategy/netherearth/Manifest [new file with mode: 0644]
games-strategy/netherearth/files/Makefile [new file with mode: 0644]
games-strategy/netherearth/files/digest-netherearth-0.52 [new file with mode: 0644]
games-strategy/netherearth/files/netherearth-0.52-gentoo-paths.patch [new file with mode: 0644]
games-strategy/netherearth/files/netherearth-0.52-linux.patch [new file with mode: 0644]
games-strategy/netherearth/metadata.xml [new file with mode: 0644]
games-strategy/netherearth/netherearth-0.52.ebuild [new file with mode: 0644]

diff --git a/games-strategy/netherearth/ChangeLog b/games-strategy/netherearth/ChangeLog
new file mode 100644 (file)
index 0000000..9158c1c
--- /dev/null
@@ -0,0 +1,13 @@
+# ChangeLog for games-strategy/netherearth
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/netherearth/ChangeLog,v 1.1 2005/09/08 18:27:06 ticho Exp $
+
+*netherearth-0.52 (08 Sep 2005)
+
+  08 Sep 2005; Andrej Kacian <ticho@gentoo.org>
+  +files/netherearth-0.52-gentoo-paths.patch,
+  +files/netherearth-0.52-linux.patch, +files/Makefile, +metadata.xml,
+  +netherearth-0.52.ebuild:
+  Initial import. Based on ebuild by Alexandru Toma <flash3001 at yahoo.com>,
+  bug #48062.
+
diff --git a/games-strategy/netherearth/Manifest b/games-strategy/netherearth/Manifest
new file mode 100644 (file)
index 0000000..22f2845
--- /dev/null
@@ -0,0 +1,17 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 1fadcc9d6d7199fb831fa536881ac105 ChangeLog 543
+MD5 9dfa6fe4146063c9a1a5496fbc503f26 metadata.xml 507
+MD5 573b3ee4a8d79aab0639e5a235536aa1 netherearth-0.52.ebuild 2010
+MD5 743a943130080746a237aaca99a32f1d files/Makefile 1003
+MD5 20198e78dc33ad3838798bfc53120260 files/netherearth-0.52-linux.patch 1255
+MD5 eaafb11314df445e9792778c9741d7e1 files/netherearth-0.52-gentoo-paths.patch 4356
+MD5 a617f2b3f264865654c4c847ff7eb11c files/digest-netherearth-0.52 118
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDIIKWQlM6RnzZP+IRAq4VAKDD+sR074bYocS0hg4lovjA8c7owACdFnnt
+LDggnvca5kjvfXqxtGN4p14=
+=utG9
+-----END PGP SIGNATURE-----
diff --git a/games-strategy/netherearth/files/Makefile b/games-strategy/netherearth/files/Makefile
new file mode 100644 (file)
index 0000000..07c671a
--- /dev/null
@@ -0,0 +1,20 @@
+# ls *.cpp\r
+#\r
+#3dobject-ase.cpp  construction.cpp  maps.cpp         netherdebug.cpp    radar.cpp\r
+#3dobject.cpp      enemy_ai.cpp      menu.cpp         nethersave.cpp     robot_ai.cpp\r
+#bitmap.cpp        glprintf.cpp      myglutaux.cpp    particles.cpp      robots.cpp\r
+#bullet.cpp        main.cpp          nether.cpp       piece3dobject.cpp  shadow3dobject.cpp\r
+#cmc.cpp           mainmenu.cpp      nethercycle.cpp  quaternion.cpp     vector.cpp\r
+\r
+\r
+SOURCES = 3dobject-ase.cpp 3dobject.cpp cmc.cpp nether.cpp piece3dobject.cpp vector.cpp bitmap.cpp bullet.cpp glprintf.cpp main.cpp mainmenu.cpp maps.cpp menu.cpp myglutaux.cpp nethercycle.cpp netherdebug.cpp nethersave.cpp particles.cpp construction.cpp quaternion.cpp radar.cpp enemy_ai.cpp robot_ai.cpp robots.cpp shadow3dobject.cpp\r
+OBJECTS = $(SOURCES:.cpp=.o)\r
+TARGET = nether_earth\r
+\r
+.cpp.o:\r
+       g++ ${CXXFLAGS} -c $< -o $@\r
+\r
+all: $(TARGET)\r
+\r
+$(TARGET): $(OBJECTS)\r
+       g++ $(OBJECTS) -o $(TARGET) -lGL -lGLU -lglut -lSDL -lSDL_mixer -lpthread\r
diff --git a/games-strategy/netherearth/files/digest-netherearth-0.52 b/games-strategy/netherearth/files/digest-netherearth-0.52
new file mode 100644 (file)
index 0000000..82d92e6
--- /dev/null
@@ -0,0 +1,2 @@
+MD5 caace4bbfd32010c348f80cf0dba6e63 sources.zip 75918
+MD5 efbc914203944b6ec214884a00ed2b32 netherearth052.zip 872397
diff --git a/games-strategy/netherearth/files/netherearth-0.52-gentoo-paths.patch b/games-strategy/netherearth/files/netherearth-0.52-gentoo-paths.patch
new file mode 100644 (file)
index 0000000..25f99be
--- /dev/null
@@ -0,0 +1,139 @@
+diff -ud ../NetherEarth_v0.51-linsrc.orig/3dobject-ase.cpp ./3dobject-ase.cpp
+--- ../NetherEarth_v0.51-linsrc.orig/3dobject-ase.cpp  2002-10-26 00:00:00.000000000 +0300
++++ ./3dobject-ase.cpp 2004-04-16 21:42:55.000000000 +0300
+@@ -34,7 +34,7 @@
+       char buffer[256];\r
+       FILE *fp;\r
+ \r
+-      fp=fopen(file,"r+");\r
++      fp=fopen(file,"r");\r
+       if (fp==NULL) return false;\r
+ \r
+       /* Look for the materials: */ \r
+diff -ud ../NetherEarth_v0.51-linsrc.orig/3dobject.cpp ./3dobject.cpp
+--- ../NetherEarth_v0.51-linsrc.orig/3dobject.cpp      2004-01-06 20:49:00.000000000 +0200
++++ ./3dobject.cpp     2004-04-16 21:43:44.000000000 +0300
+@@ -74,7 +74,7 @@
+ \r
+       int *smooth;\r
+ \r
+-      fp=fopen(file,"r+");\r
++      fp=fopen(file,"r");\r
+       if (fp==NULL) return false;\r
+ \r
+       /* Importar un fichero .ASC de 3DStudio */ \r
+diff -ud ../NetherEarth_v0.51-linsrc.orig/bitmap.cpp ./bitmap.cpp
+--- ../NetherEarth_v0.51-linsrc.orig/bitmap.cpp        2004-01-06 20:49:00.000000000 +0200
++++ ./bitmap.cpp       2004-04-16 21:45:13.000000000 +0300
+@@ -14,7 +14,7 @@
+       g=0;\r
+       b=0;\r
+ \r
+-      fp=fopen(file,"rb+");\r
++      fp=fopen(file,"rb");\r
+       if (fp==NULL) return;\r
+ \r
+       /* Tag: */ \r
+diff -ud ../NetherEarth_v0.51-linsrc.orig/mainmenu.cpp ./mainmenu.cpp
+--- ../NetherEarth_v0.51-linsrc.orig/mainmenu.cpp      2004-01-06 20:50:00.000000000 +0200
++++ ./mainmenu.cpp     2004-04-16 21:14:14.000000000 +0300
+@@ -6,6 +6,9 @@
+ #include <dirent.h>\r
+ #endif\r
+ \r
++#include <stdlib.h>
++#include <fcntl.h>
++#include <unistd.h>
+ #include "string.h"\r
+ #include "stdio.h"\r
+ #include "math.h"\r
+@@ -483,8 +486,10 @@
+ {\r
+       int v;\r
+       FILE *fp;\r
++      char cfg_path[300];
+ \r
+-      fp=fopen("nether.cfg","r");\r
++      sprintf(cfg_path, "%s/.netherearth/nether.cfg", getenv("HOME"));
++      fp=fopen(cfg_path,"r");\r
+       if (fp==0) return;\r
+ \r
+       if (2!=fscanf(fp,"%i %i",&SCREEN_X,&SCREEN_Y)) return;\r
+@@ -510,8 +515,12 @@
+ void save_configuration(void)\r
+ {\r
+       FILE *fp;\r
++      char cfg_path[300];
+ \r
+-      fp=fopen("nether.cfg","w");\r
++      sprintf(cfg_path, "%s/.netherearth", getenv("HOME"));
++      mkdir(cfg_path, 0755);
++      sprintf(cfg_path, "%s/.netherearth/nether.cfg", getenv("HOME"));
++      fp=fopen(cfg_path,"w");\r
+       if (fp==0) return;\r
+ \r
+       fprintf(fp,"%i %i\n",SCREEN_X,SCREEN_Y);\r
+diff -ud ../NetherEarth_v0.51-linsrc.orig/nether.cpp ./nether.cpp
+--- ../NetherEarth_v0.51-linsrc.orig/nether.cpp        2004-01-06 21:03:00.000000000 +0200
++++ ./nether.cpp       2004-04-16 20:54:54.000000000 +0300
+@@ -1203,7 +1203,7 @@
+                       if (option_menu==(i+1)) glColor3f(1.0,0.0,0.0);\r
+                                                      else glColor3f(0.5,0.5,1.0);\r
+                       glTranslatef(0,-2,0);\r
+-                      sprintf(filename,"savedgame%i.txt",i);\r
++                      sprintf(filename,"%s/.netherearth/savedgame%i.txt", getenv("HOME"), i);\r
+                       fp=fopen(filename,"r");\r
+                       if (fp==0) {\r
+                               scaledglprintf(0.01,0.01,"SLOT%i - EMPTY",i+1);\r
+@@ -1232,7 +1232,7 @@
+                       if (option_menu==(i+1)) glColor3f(1.0,0.0,0.0);\r
+                                                      else glColor3f(0.5,0.5,1.0);\r
+                       glTranslatef(0,-2,0);\r
+-                      sprintf(filename,"savedgame%i.txt",i);\r
++                      sprintf(filename,"%s/.netherearth/savedgame%i.txt", getenv("HOME"), i);\r
+                       fp=fopen(filename,"r");\r
+                       if (fp==0) {\r
+                               scaledglprintf(0.01,0.01,"SLOT%i - EMPTY",i+1);\r
+@@ -1291,7 +1291,7 @@
+                       case 4:\r
+                               {\r
+                                       char filename[80];\r
+-                                      sprintf(filename,"savedgame%i.txt",option_menu-1);\r
++                                      sprintf(filename,"%s/.netherearth/savedgame%i.txt", getenv("HOME"), option_menu-1);\r
+                                       save_game(filename);\r
+                                       //save_debug_report("debugreport.txt");\r
+                                       game_state=STATE_PAUSE;\r
+@@ -1326,7 +1326,7 @@
+                       case 4:\r
+                               {\r
+                                       char filename[80];\r
+-                                      sprintf(filename,"savedgame%i.txt",option_menu-1);\r
++                                      sprintf(filename,"%s/.netherearth/savedgame%i.txt", getenv("HOME"), option_menu-1);\r
+                                       killmenu(act_menu);\r
+                                       load_game(filename);\r
+                                       newmenu(act_menu);\r
+diff -ud ../NetherEarth_v0.51-linsrc.orig/nethersave.cpp ./nethersave.cpp
+--- ../NetherEarth_v0.51-linsrc.orig/nethersave.cpp    2003-09-17 00:00:00.000000000 +0300
++++ ./nethersave.cpp   2004-04-16 21:23:04.000000000 +0300
+@@ -2,6 +2,10 @@
+ #include "windows.h"\r
+ #endif\r
+ \r
++#include <stdlib.h>
++#include <sys/types.h>
++#include <fcntl.h>
++#include <unistd.h>
+ #include "string.h"\r
+ #include "stdio.h"\r
+ #include "math.h"\r
+@@ -40,7 +44,10 @@
+       ROBOT *r;\r
+       BULLET *bul;\r
+       EXPLOSION *e;\r
++      char tmp_path[300];
+ \r
++      sprintf(tmp_path, "%s/.netherearth", getenv("HOME"));
++      mkdir(tmp_path, 0755);
+       fp=fopen(filename,"w");\r
+       if (fp==0) return false;\r
+ \r
diff --git a/games-strategy/netherearth/files/netherearth-0.52-linux.patch b/games-strategy/netherearth/files/netherearth-0.52-linux.patch
new file mode 100644 (file)
index 0000000..6c4c0d1
--- /dev/null
@@ -0,0 +1,47 @@
+diff -burN sources/glprintf.cpp sources-linux/glprintf.cpp
+--- sources/glprintf.cpp       2002-10-26 00:17:00.000000000 +0200
++++ sources-linux/glprintf.cpp 2005-06-18 18:22:54.000000000 +0200
+@@ -3,6 +3,7 @@
+ #endif\r
+ #include "GL/gl.h"\r
+ \r
++#include "string.h"
+ #include "stdio.h"\r
+ #include "stdarg.h"\r
+ #include "GL/gl.h"\r
+diff -burN sources/list.h sources-linux/list.h
+--- sources/list.h     2002-10-27 12:17:00.000000000 +0100
++++ sources-linux/list.h       2005-06-18 18:21:34.000000000 +0200
+@@ -1,6 +1,9 @@
+ #ifndef GENERIC_LIST\r
+ #define GENERIC_LIST\r
+ \r
++
++#include "stdlib.h"
++
+ /* \r
+ Funciones para LISTAS: \r
+ \r
+diff -burN sources/maps.cpp sources-linux/maps.cpp
+--- sources/maps.cpp   2005-05-05 23:42:00.000000000 +0200
++++ sources-linux/maps.cpp     2005-06-18 18:23:05.000000000 +0200
+@@ -3,6 +3,7 @@
+ #endif\r
+ \r
+ #include "stdio.h"\r
++#include "string.h"
+ \r
+ #include "GL/gl.h"\r
+ #include "GL/glu.h"\r
+diff -burN sources/myglutaux.cpp sources-linux/myglutaux.cpp
+--- sources/myglutaux.cpp      2002-10-26 00:17:00.000000000 +0200
++++ sources-linux/myglutaux.cpp        2005-06-18 18:23:29.000000000 +0200
+@@ -5,6 +5,8 @@
+ #include <GL/gl.h>\r
+ #include "GL/glut.h"\r
+ \r
++#include "string.h"
++#include "stdlib.h"
+ #include "stdio.h"\r
+ #include "math.h"\r
+ #include "vector.h"\r
diff --git a/games-strategy/netherearth/metadata.xml b/games-strategy/netherearth/metadata.xml
new file mode 100644 (file)
index 0000000..7040053
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>games</herd>
+<maintainer>
+       <email>ticho@gentoo.org</email>
+       <name>Andrej Kacian</name>
+</maintainer>
+<longdescription>
+       Nether Earth was the very first real time strategy game. It worked on a
+       SPECTRUM machine, and only needed 48KB of RAM to work!! It has all the
+       typical elements of strategy games: resources, factories, combat units,
+       etc.
+</longdescription>
+</pkgmetadata>
diff --git a/games-strategy/netherearth/netherearth-0.52.ebuild b/games-strategy/netherearth/netherearth-0.52.ebuild
new file mode 100644 (file)
index 0000000..729ed3e
--- /dev/null
@@ -0,0 +1,74 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/netherearth/netherearth-0.52.ebuild,v 1.1 2005/09/08 18:27:06 ticho Exp $
+
+inherit eutils games
+
+MY_PV="${PV/./}"
+DESCRIPTION="A remake of the SPECTRUM game Nether Earth."
+HOMEPAGE="http://braingames.getput.com/nether/"
+SRC_URI="http://braingames.getput.com/nether/sources.zip
+       http://braingames.getput.com/nether/${PN}${MY_PV}.zip"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND=">=media-libs/libsdl-1.2.6-r3
+       >=media-libs/sdl-mixer-1.2.5-r1
+       virtual/glut"
+
+DEPEND="${RDEPEND}
+       app-arch/unzip"
+
+S=${WORKDIR}/sources
+
+data=../nether\ earth\ v${PV}
+
+src_unpack() {
+       DATA_DIR=${GAMES_DATADIR}/${PN}
+
+       unzip -LL "${DISTDIR}/${PN}${MY_PV}.zip" >/dev/null || die "unzip ${PN}${MY_PV} failed"
+       unzip -LL "${DISTDIR}/sources.zip" >/dev/null || die "unzip sources.zip failed"
+       cd "${S}"
+       cp "${FILESDIR}/Makefile" . || die "Makefile copying failed"
+
+       # Fix compilation errors/warnings
+       epatch "${FILESDIR}/${P}-linux.patch" || die "epatch failed"
+
+       # Modify dirs and some fopen() permissions
+       epatch "${FILESDIR}/${P}-gentoo-paths.patch" || die "epatch failed"
+       sed -i \
+               -e "s:models:${DATA_DIR}/models:" \
+               -e "s:textures:${DATA_DIR}/textures:" \
+               -e "s:maps/\*:${DATA_DIR}/maps/\*:" \
+               -e "s:\./maps:${DATA_DIR}/maps:" \
+               mainmenu.cpp || die "sed mainmenu.cpp failed"
+       sed -i \
+               -e "s:models:${DATA_DIR}/models:g" \
+               -e "s:textures:${DATA_DIR}/textures:" \
+               -e "s:sound/:${DATA_DIR}/sound/:" \
+               nether.cpp || die "sed nether.cpp failed"
+       sed -i -e "s:maps:${DATA_DIR}/maps:" \
+               main.cpp || die "sed main.cpp failed"
+       sed -i -e "s:textures/:${DATA_DIR}/textures/:" \
+               myglutaux.cpp || die "sed myglutaux.cpp failed"
+
+       cd "${data}"
+       rm textures/thumbs.db
+}
+
+src_install() {
+       dogamesbin nether_earth
+
+       cd "${data}"
+
+       # Install all game data
+       insinto "${DATA_DIR}"
+       doins -r maps models sound textures
+
+       dodoc readme.txt
+
+       prepgamesdirs
+}