summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2007-09-26 21:55:31 +0000
committerAlfredo Tupone <tupone@gentoo.org>2007-09-26 21:55:31 +0000
commitfb268da444deb82dcec63c0ee31cb589c80ec385 (patch)
treeadeb13416247ae8d103103186f8adedfc4019800 /games-strategy/glest
parentEnforce proper permissions on existing directories (security bug 182998) (diff)
downloadgentoo-2-fb268da444deb82dcec63c0ee31cb589c80ec385.tar.gz
gentoo-2-fb268da444deb82dcec63c0ee31cb589c80ec385.tar.bz2
gentoo-2-fb268da444deb82dcec63c0ee31cb589c80ec385.zip
Version bump to 2.0.1 Bug #191636
(Portage version: 2.1.3.9)
Diffstat (limited to 'games-strategy/glest')
-rw-r--r--games-strategy/glest/ChangeLog8
-rw-r--r--games-strategy/glest/files/digest-glest-2.0.112
-rw-r--r--games-strategy/glest/files/glest-2.0.1-home.patch86
-rw-r--r--games-strategy/glest/glest-2.0.1.ebuild98
4 files changed, 203 insertions, 1 deletions
diff --git a/games-strategy/glest/ChangeLog b/games-strategy/glest/ChangeLog
index 8ccee324bf5b..2fd4d5f66800 100644
--- a/games-strategy/glest/ChangeLog
+++ b/games-strategy/glest/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for games-strategy/glest
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-strategy/glest/ChangeLog,v 1.15 2007/06/27 18:04:35 nyhm Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/glest/ChangeLog,v 1.16 2007/09/26 21:55:30 tupone Exp $
+
+*glest-2.0.1 (26 Sep 2007)
+
+ 26 Sep 2007; Tupone Alfredo <tupone@gentoo.org>
+ +files/glest-2.0.1-home.patch, +glest-2.0.1.ebuild:
+ Version bump to 2.0.1 Bug #191636 by Greg Fitzgerald
27 Jun 2007; Tristan Heaven <nyhm@gentoo.org> glest-2.0.0-r1.ebuild:
Don't rely on LINGUAS being set
diff --git a/games-strategy/glest/files/digest-glest-2.0.1 b/games-strategy/glest/files/digest-glest-2.0.1
new file mode 100644
index 000000000000..e5bff50c9f59
--- /dev/null
+++ b/games-strategy/glest/files/digest-glest-2.0.1
@@ -0,0 +1,12 @@
+MD5 f929ec9135b43305fa870b2cc274a1e7 deutsch_2.0.1.zip 1903
+RMD160 50d53e084e1cd1f66656f82a19e35544901112a8 deutsch_2.0.1.zip 1903
+SHA256 776a4586d6556916467aef5f6a2623152fcc28f3ad069a45fdfa2c03de0f922f deutsch_2.0.1.zip 1903
+MD5 0ca333baa78328f97c30a22063ea19fc glest_data_2.0.1.zip 64587572
+RMD160 091da0051b640263d0600e9996cc801320de27a8 glest_data_2.0.1.zip 64587572
+SHA256 612ab01a862bb29e6b491f40f0f345c85db229962637ba1832b7f35f50001ef6 glest_data_2.0.1.zip 64587572
+MD5 2d35a5d08331957f63240cadc9766b75 glest_source_2.0.1.zip 510653
+RMD160 d1b4c983cf1cd5adc151ac6917b98ef00fbb7a66 glest_source_2.0.1.zip 510653
+SHA256 f476665f374537def35ebd7737b7fa8940ef9f014cfabd5fbbd50a4c647b42b2 glest_source_2.0.1.zip 510653
+MD5 d735cd5c66a994501cb52a457bd1ff9d magyar_2.0.1.zip 2012
+RMD160 4688dd98d15ba7e072d5bf56f30d7b5e10f5c415 magyar_2.0.1.zip 2012
+SHA256 580a4fd6144ca528c167d6b5668e97cdcd3b00aa6e8d22695fe5012794b6bf0d magyar_2.0.1.zip 2012
diff --git a/games-strategy/glest/files/glest-2.0.1-home.patch b/games-strategy/glest/files/glest-2.0.1-home.patch
new file mode 100644
index 000000000000..8690e47576e4
--- /dev/null
+++ b/games-strategy/glest/files/glest-2.0.1-home.patch
@@ -0,0 +1,86 @@
+--- source/glest_game/main/main.cpp
++++ source/glest_game/main/main.cpp
+@@ -13,6 +13,7 @@
+
+ #include <string>
+ #include <cstdlib>
++#include <sys/stat.h>
+
+ #include "game.h"
+ #include "main_menu.h"
+@@ -129,6 +130,17 @@
+ ExceptionHandler exceptionHandler;
+ exceptionHandler.install();
+
++ if (!getenv("HOME"))
++ throw runtime_error("HOME not set!");
++
++ char str[PATH_MAX];
++ snprintf(str, PATH_MAX, "%s/.glest", getenv("HOME"));
++ mkdir(str, 0750);
++ chdir(str);
++ mkdir("screens", 0750);
++
++ chdir("GENTOO_DATADIR");
++
+ try{
+ Config &config = Config::getInstance();
+
+--- source/glest_game/main/program.cpp
++++ source/glest_game/main/program.cpp
+@@ -65,8 +65,11 @@
+ updateCameraTimer.init(config.getInt("CameraFps"), maxTimes);
+
+ //log start
++ char str[PATH_MAX];
++ snprintf(str, PATH_MAX, "%s/.glest/glest.log", getenv("HOME"));
++
+ Logger &logger= Logger::getInstance();
+- logger.setFile("glest.log");
++ logger.setFile(str);
+ logger.clear();
+
+ srand(time(NULL));
+@@ -134,9 +137,10 @@
+ //save screen
+ if(key=='T'){
+ for(int i=0; i<100; ++i){
+- string path= "screens/screen" + intToStr(i) + ".tga";
++ char path[PATH_MAX];
++ snprintf(path, PATH_MAX, "%s/.glest/screens/screen%d.tga", getenv("HOME"), i);
+
+- FILE *f= fopen(path.c_str(), "rb");
++ FILE *f= fopen(path, "rb");
+ if(f==NULL){
+ Renderer::getInstance().saveScreen(path);
+ break;
+
+--- source/shared_lib/sources/util/properties.cpp
++++ source/shared_lib/sources/util/properties.cpp
+@@ -33,9 +33,13 @@
+
+ this->path= path;
+
+- fileStream.open(path.c_str(), ios_base::in);
++ char str[PATH_MAX];
++ snprintf(str, PATH_MAX, "%s/.glest/%s", getenv("HOME"), path.c_str());
++ fileStream.open(str, ios_base::in);
+ if(fileStream.fail()){
+- throw runtime_error("Can't open properties file: " + path);
++ fileStream.open(path.c_str(), ios_base::in); // use defaults
++ if(fileStream.fail())
++ throw runtime_error("Can't open properties file: " + path);
+ }
+
+ properties.clear();
+@@ -70,7 +74,9 @@
+ void Properties::save(const string &path){
+ ofstream fileStream;
+
+- fileStream.open(path.c_str(), ios_base::out | ios_base::trunc);
++ char str[PATH_MAX];
++ snprintf(str, PATH_MAX, "%s/.glest/%s", getenv("HOME"), path.c_str());
++ fileStream.open(str, ios_base::out | ios_base::trunc);
+
+ fileStream << "; === Properties File === \n";
+ fileStream << '\n';
diff --git a/games-strategy/glest/glest-2.0.1.ebuild b/games-strategy/glest/glest-2.0.1.ebuild
new file mode 100644
index 000000000000..52f1e5f03a92
--- /dev/null
+++ b/games-strategy/glest/glest-2.0.1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/glest/glest-2.0.1.ebuild,v 1.1 2007/09/26 21:55:30 tupone Exp $
+
+inherit autotools eutils games
+
+L_URI="http://www.glest.org/files/contrib/translations"
+DESCRIPTION="Cross-platform 3D realtime strategy game"
+HOMEPAGE="http://www.glest.org/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_source_${PV}.zip
+ mirror://sourceforge/${PN}/${PN}_data_${PV}.zip
+ linguas_de? ( ${L_URI}/deutsch_${PV}.zip )
+ linguas_hu? ( ${L_URI}/magyar_${PV}.zip )"
+
+LICENSE="GPL-2 glest-data"
+SLOT="0"
+KEYWORDS="~amd64 -ppc ~x86" # ppc: bug #145478
+IUSE="linguas_de linguas_hu"
+
+RDEPEND="media-libs/libsdl
+ media-libs/libogg
+ media-libs/libvorbis
+ media-libs/openal
+ dev-libs/xerces-c
+ virtual/opengl
+ virtual/glu
+ x11-libs/libX11
+ x11-libs/libXt
+ media-fonts/font-adobe-utopia-75dpi"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ dev-util/jam"
+
+S=${WORKDIR}/mk/linux
+
+GAMES_USE_SDL="nojoystick"
+
+src_unpack() {
+ unpack ${A}
+
+ local file
+ for file in $(find source mk -type f) ; do
+ edos2unix "${file}"
+ done
+
+ epatch \
+ "${FILESDIR}"/${P}-home.patch
+
+ sed -i \
+ -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}:" \
+ source/glest_game/main/main.cpp \
+ || die "sed main.cpp failed"
+
+ cd "${S}"
+ # sometimes they package configure, sometimes they don't
+ if [[ ! -f configure ]] ; then
+ chmod a+x autogen.sh
+ ./autogen.sh || die "autogen failed" # FIXME: use autotools.eclass
+ fi
+
+ sed -i 's:-O3 -g3::' Jamrules || die "sed Jamrules failed"
+}
+
+src_compile() {
+ # Fails with wx enabled, bug #130011
+ egamesconf \
+ --with-vorbis=/usr \
+ --with-ogg=/usr \
+ --with-wx-config=disabled_wx \
+ || die
+ jam -q || die "jam failed"
+}
+
+src_install() {
+ dogamesbin glest || die "dogamesbin failed"
+
+ insinto "${GAMES_DATADIR}"/${PN}
+ doins glest.ini || die "doins glest.ini failed"
+ dodoc ../../docs/README.linux
+
+ cd "${WORKDIR}"/glest_game
+ doins -r data maps scenarios techs tilesets || die "doins data failed"
+ dodoc docs/readme.txt
+
+ make_desktop_entry glest Glest /usr/share/pixmaps/${PN}.bmp
+ newicon techs/magitech/factions/magic/units/archmage/images/archmage.bmp \
+ ${PN}.bmp
+
+ dolang() {
+ insinto "${GAMES_DATADIR}"/${PN}/data/lang
+ doins "${WORKDIR}"/${1} || die "doins ${1} failed"
+ }
+
+ use linguas_de && dolang deutsch.lng
+ use linguas_hu && dolang magyar_${PV}.lng
+
+ prepgamesdirs
+}