diff --git a/.cvsignore b/.cvsignore index e69de29..070c356 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +CriticalMass-1.0.2.tar.bz2 diff --git a/CriticalMass-1.0.2-sys-curl.patch b/CriticalMass-1.0.2-sys-curl.patch new file mode 100644 index 0000000..f1b74cf --- /dev/null +++ b/CriticalMass-1.0.2-sys-curl.patch @@ -0,0 +1,70 @@ +diff -up CriticalMass-1.0.2/game/Makefile.in~ CriticalMass-1.0.2/game/Makefile.in +--- CriticalMass-1.0.2/game/Makefile.in~ 2007-11-29 22:09:43.000000000 +0100 ++++ CriticalMass-1.0.2/game/Makefile.in 2007-11-29 22:09:43.000000000 +0100 +@@ -71,7 +71,7 @@ am_critter_OBJECTS = ActionCallbacks.$(O + critter_OBJECTS = $(am_critter_OBJECTS) + critter_LDADD = $(LDADD) + @WIN32_TRUE@am__DEPENDENCIES_1 = critter.res +-critter_DEPENDENCIES = ../curl/lib/libcurl.a ../utils/libutils.a \ ++critter_DEPENDENCIES = ../utils/libutils.a \ + ../utilssdl/libutilssdl.a ../utilsgl/libutilsgl.a \ + ../tinyxml/libtinyxml.a $(am__DEPENDENCIES_1) + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +@@ -231,10 +231,10 @@ critter_SOURCES = \ + XMLHelper.cpp \ + main.cpp + +-LDADD = ../curl/lib/libcurl.a ../utils/libutils.a \ ++LDADD = ../utils/libutils.a -lcurl \ + ../utilssdl/libutilssdl.a ../utilsgl/libutilsgl.a \ + ../tinyxml/libtinyxml.a $(am__append_1) +-@APPLE_FALSE@@WIN32_FALSE@INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" ++@APPLE_FALSE@@WIN32_FALSE@INCLUDES = -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" + @APPLE_TRUE@@WIN32_FALSE@INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"/Contents/Resources/\" + @WIN32_TRUE@INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"./\" + @WIN32_FALSE@pkgdata_DATA = resource.dat +diff -up CriticalMass-1.0.2/game/Makefile.am~ CriticalMass-1.0.2/game/Makefile.am +--- CriticalMass-1.0.2/game/Makefile.am~ 2007-11-29 22:09:03.000000000 +0100 ++++ CriticalMass-1.0.2/game/Makefile.am 2007-11-29 22:09:03.000000000 +0100 +@@ -41,7 +41,7 @@ critter_SOURCES = \ + main.cpp + + LDADD = \ +- ../curl/lib/libcurl.a \ ++ -lcurl \ + ../utils/libutils.a \ + ../utilssdl/libutilssdl.a \ + ../utilsgl/libutilsgl.a \ +@@ -55,7 +55,7 @@ else + if APPLE + INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"/Contents/Resources/\" + else +-INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" ++INCLUDES = -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" + endif + + endif +diff -up CriticalMass-1.0.2/Makefile.in~ CriticalMass-1.0.2/Makefile.in +--- CriticalMass-1.0.2/Makefile.in~ 2007-11-29 22:07:06.000000000 +0100 ++++ CriticalMass-1.0.2/Makefile.in 2007-11-29 22:07:06.000000000 +0100 +@@ -178,7 +178,7 @@ target_vendor = @target_vendor@ + + # require automake 1.4 + AUTOMAKE_OPTIONS = 1.4 +-SUBDIRS = curl tinyxml utils utilssdl utilsgl tools data game ++SUBDIRS = tinyxml utils utilssdl utilsgl tools data game + DIST_SUBDIRS = $(SUBDIRS) + man_MANS = critter.6 + EXTRA_DIST = $(man_MANS) +diff -up CriticalMass-1.0.2/Makefile.am~ CriticalMass-1.0.2/Makefile.am +--- CriticalMass-1.0.2/Makefile.am~ 2007-11-29 22:06:55.000000000 +0100 ++++ CriticalMass-1.0.2/Makefile.am 2007-11-29 22:06:55.000000000 +0100 +@@ -4,7 +4,7 @@ + AUTOMAKE_OPTIONS = 1.4 + + ## Any directories that you want built and installed should go here. +-SUBDIRS = curl tinyxml utils utilssdl utilsgl tools data game ++SUBDIRS = tinyxml utils utilssdl utilsgl tools data game + + ## Any directories you want a part of the distribution should be listed + ## here, as well as have a Makefile generated at the end of configure.in diff --git a/CriticalMass-1.0.2-sys-tinyxml.patch b/CriticalMass-1.0.2-sys-tinyxml.patch new file mode 100644 index 0000000..14c9d08 --- /dev/null +++ b/CriticalMass-1.0.2-sys-tinyxml.patch @@ -0,0 +1,234 @@ +diff -up CriticalMass-1.0.2/game/Makefile.in~ CriticalMass-1.0.2/game/Makefile.in +--- CriticalMass-1.0.2/game/Makefile.in~ 2007-11-30 22:01:35.000000000 +0100 ++++ CriticalMass-1.0.2/game/Makefile.in 2007-11-30 22:01:35.000000000 +0100 +@@ -73,7 +73,7 @@ critter_LDADD = $(LDADD) + @WIN32_TRUE@am__DEPENDENCIES_1 = critter.res + critter_DEPENDENCIES = ../utils/libutils.a \ + ../utilssdl/libutilssdl.a ../utilsgl/libutilsgl.a \ +- ../tinyxml/libtinyxml.a $(am__DEPENDENCIES_1) ++ $(am__DEPENDENCIES_1) + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) + depcomp = + am__depfiles_maybe = +@@ -233,8 +233,8 @@ critter_SOURCES = \ + + LDADD = ../utils/libutils.a -lcurl \ + ../utilssdl/libutilssdl.a ../utilsgl/libutilsgl.a \ +- ../tinyxml/libtinyxml.a $(am__append_1) +-@APPLE_FALSE@@WIN32_FALSE@INCLUDES = -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" ++ -ltinyxml $(am__append_1) ++@APPLE_FALSE@@WIN32_FALSE@INCLUDES = -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" + @APPLE_TRUE@@WIN32_FALSE@INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"/Contents/Resources/\" + @WIN32_TRUE@INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"./\" + @WIN32_FALSE@pkgdata_DATA = resource.dat +diff -up CriticalMass-1.0.2/game/Makefile.am~ CriticalMass-1.0.2/game/Makefile.am +--- CriticalMass-1.0.2/game/Makefile.am~ 2007-11-30 22:02:50.000000000 +0100 ++++ CriticalMass-1.0.2/game/Makefile.am 2007-11-30 22:02:50.000000000 +0100 +@@ -45,7 +45,7 @@ LDADD = \ + ../utils/libutils.a \ + ../utilssdl/libutilssdl.a \ + ../utilsgl/libutilsgl.a \ +- ../tinyxml/libtinyxml.a ++ -ltinyxml + + if WIN32 + INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"./\" +@@ -55,7 +55,7 @@ else + if APPLE + INCLUDES = -I../curl/include -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"/Contents/Resources/\" + else +-INCLUDES = -I../tinyxml -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" ++INCLUDES = -I../utils -I../utilssdl -I../utilsgl -DDATA_DIR=\"$(pkgdatadir)/\" + endif + + endif +diff -up CriticalMass-1.0.2/Makefile.in~ CriticalMass-1.0.2/Makefile.in +--- CriticalMass-1.0.2/Makefile.in~ 2007-11-30 22:12:35.000000000 +0100 ++++ CriticalMass-1.0.2/Makefile.in 2007-11-30 22:12:35.000000000 +0100 +@@ -178,7 +178,7 @@ target_vendor = @target_vendor@ + + # require automake 1.4 + AUTOMAKE_OPTIONS = 1.4 +-SUBDIRS = tinyxml utils utilssdl utilsgl tools data game ++SUBDIRS = utils utilssdl utilsgl tools data game + DIST_SUBDIRS = $(SUBDIRS) + man_MANS = critter.6 + EXTRA_DIST = $(man_MANS) +diff -up CriticalMass-1.0.2/Makefile.am~ CriticalMass-1.0.2/Makefile.am +--- CriticalMass-1.0.2/Makefile.am~ 2007-11-30 22:12:42.000000000 +0100 ++++ CriticalMass-1.0.2/Makefile.am 2007-11-30 22:12:42.000000000 +0100 +@@ -4,7 +4,7 @@ + AUTOMAKE_OPTIONS = 1.4 + + ## Any directories that you want built and installed should go here. +-SUBDIRS = tinyxml utils utilssdl utilsgl tools data game ++SUBDIRS = utils utilssdl utilsgl tools data game + + ## Any directories you want a part of the distribution should be listed + ## here, as well as have a Makefile generated at the end of configure.in +diff -up CriticalMass-1.0.2/game/EnemyFactory.cpp~ CriticalMass-1.0.2/game/EnemyFactory.cpp +--- CriticalMass-1.0.2/game/EnemyFactory.cpp~ 2007-12-01 11:09:42.000000000 +0100 ++++ CriticalMass-1.0.2/game/EnemyFactory.cpp 2007-12-01 11:09:42.000000000 +0100 +@@ -59,10 +59,10 @@ void EnemyFactory::createEnemy( TiXmlNod + LEnemy *enemy = new LEnemy(); + + elem = enemyNode->ToElement(); +- enemy->spawnTime = strToFloat( *elem->Attribute("spawnTime")); ++ enemy->spawnTime = strToFloat(elem->Attribute("spawnTime")); + EnemyType enemyType = eSimpleEnemy; + if( elem->Attribute("type")) +- enemyType = (EnemyType)strToInt(*elem->Attribute("type")); ++ enemyType = (EnemyType)strToInt(elem->Attribute("type")); + + node = enemyNode->FirstChild("Model"); + elem = node->ToElement(); +@@ -66,27 +66,27 @@ void EnemyFactory::createEnemy( TiXmlNod + + node = enemyNode->FirstChild("Model"); + elem = node->ToElement(); +- enemy->modelName = *elem->Attribute("Name"); ++ enemy->modelName = elem->Attribute("Name"); + + node = enemyNode->FirstChild("SpawnPoint"); + elem = node->ToElement(); +- enemy->spawnPoint.x = strToFloat( *elem->Attribute("x")); +- enemy->spawnPoint.y = strToFloat( *elem->Attribute("y")); +- enemy->spawnPoint.z = strToFloat( *elem->Attribute("z")); ++ enemy->spawnPoint.x = strToFloat(elem->Attribute("x")); ++ enemy->spawnPoint.y = strToFloat(elem->Attribute("y")); ++ enemy->spawnPoint.z = strToFloat(elem->Attribute("z")); + + node = enemyNode->FirstChild("Home"); + elem = node->ToElement(); +- enemy->home.x = strToFloat( *elem->Attribute("x")); +- enemy->home.y = strToFloat( *elem->Attribute("y")); +- enemy->home.z = strToFloat( *elem->Attribute("z")); ++ enemy->home.x = strToFloat(elem->Attribute("x")); ++ enemy->home.y = strToFloat(elem->Attribute("y")); ++ enemy->home.z = strToFloat(elem->Attribute("z")); + + node = enemyNode->FirstChild("EntryPath"); + elem = node->ToElement(); +- enemy->entry = lpm.getPath( *elem->Attribute("Name")); ++ enemy->entry = lpm.getPath(elem->Attribute("Name")); + + node = enemyNode->FirstChild("IdlePath"); + elem = node->ToElement(); +- enemy->idle = lpm.getPath( *elem->Attribute("Name")); ++ enemy->idle = lpm.getPath(elem->Attribute("Name")); + + node = enemyNode->FirstChild("AttackPath"); + enemy->numAttackPaths = countSiblings( node, "AttackPath"); +@@ -94,7 +94,7 @@ void EnemyFactory::createEnemy( TiXmlNod + for( int i=0; i< enemy->numAttackPaths; i++) + { + elem = node->ToElement(); +- enemy->attack[ i] = lpm.getPath( *elem->Attribute("Name")); ++ enemy->attack[ i] = lpm.getPath(elem->Attribute("Name")); + node = node->NextSibling( "AttackPath"); + } + +@@ -104,7 +104,7 @@ void EnemyFactory::createEnemy( TiXmlNod + for( int i=0; i< enemy->numRetreatPaths; i++) + { + elem = node->ToElement(); +- enemy->retreat[ i] = lpm.getPath( *elem->Attribute("Name")); ++ enemy->retreat[ i] = lpm.getPath(elem->Attribute("Name")); + node = node->NextSibling( "RetreatPath"); + } + +diff -up CriticalMass-1.0.2/game/OnlineUpdate.cpp~ CriticalMass-1.0.2/game/OnlineUpdate.cpp +--- CriticalMass-1.0.2/game/OnlineUpdate.cpp~ 2007-12-01 11:16:51.000000000 +0100 ++++ CriticalMass-1.0.2/game/OnlineUpdate.cpp 2007-12-01 11:16:51.000000000 +0100 +@@ -216,8 +216,8 @@ bool OnlineUpdate::process( void) + while( node) + { + TiXmlElement *element = node->ToElement(); +- const string *name = element->Attribute("Name"); +- if( name && (*name == GAMETITLE)) ++ const char *name = element->Attribute("Name"); ++ if( name && (name == GAMETITLE)) + { + // LOG_INFO << "Found " << GAMETITLE << " update section\n"; + TiXmlNode *release = node->FirstChild( "Release"); +@@ -228,18 +228,18 @@ bool OnlineUpdate::process( void) + while( release) + { + element = release->ToElement(); +- const string *version = element->Attribute("Version"); +- const string *date = element->Attribute("Date"); ++ const char *version = element->Attribute("Version"); ++ const char *date = element->Attribute("Date"); + if( version && date) + { +-// LOG_INFO << "Version " << *version << " released on " << *date << endl; ++// LOG_INFO << "Version " << version << " released on " << *date << endl; + +- int versionID = getVersionID(*version); ++ int versionID = getVersionID(version); + if( versionID > latestVersionID) + { + latestVersionID = versionID; +- _latestVersion = *version; +- _latestVersionDate = *date; ++ _latestVersion = version; ++ _latestVersionDate = date; + TiXmlNode *body = release->FirstChild( "Body"); + if( body) + { +@@ -292,8 +292,8 @@ bool OnlineUpdate::process( void) + while( node) + { + TiXmlElement *element = node->ToElement(); +- const string *title = element->Attribute("Title"); +- const string *date = element->Attribute("Date"); ++ const char *title = element->Attribute("Title"); ++ const char *date = element->Attribute("Date"); + if( title && date) + { + TiXmlNode *body = element->FirstChild( "Body"); +@@ -303,8 +303,8 @@ bool OnlineUpdate::process( void) + if( leaf) + { + NewsItem *newsItem = new NewsItem; +- newsItem->title = *title; +- newsItem->date = *date; ++ newsItem->title = title; ++ newsItem->date = date; + newsItem->text = leaf->Value(); + newsItem->r = 1.0; + newsItem->g = 1.0; +diff -up CriticalMass-1.0.2/game/MenuManager.cpp~ CriticalMass-1.0.2/game/MenuManager.cpp +--- CriticalMass-1.0.2/game/MenuManager.cpp~ 2007-12-01 11:10:55.000000000 +0100 ++++ CriticalMass-1.0.2/game/MenuManager.cpp 2007-12-01 11:10:55.000000000 +0100 +@@ -305,13 +305,13 @@ bool MenuManager::draw( void) + glDisable(GL_TEXTURE_2D); + + TiXmlElement* elem = _currentMenu->ToElement(); +- const string* val = elem->Attribute("Text"); ++ const char* val = elem->Attribute("Text"); + if( val) + { + GLBitmapFont &fontWhite = + *(FontManagerS::instance()->getFont( "bitmaps/menuWhite")); + glColor4f(1.0, 1.0, 1.0, 1.0); +- fontWhite.DrawString( (*val).c_str(), 122, 527, 0.5, 0.5); ++ fontWhite.DrawString(val, 122, 527, 0.5, 0.5); + } + + list::iterator i; +diff -up CriticalMass-1.0.2/game/StageManager.cpp~ CriticalMass-1.0.2/game/StageManager.cpp +--- CriticalMass-1.0.2/game/StageManager.cpp~ 2007-12-01 12:05:46.000000000 +0100 ++++ CriticalMass-1.0.2/game/StageManager.cpp 2007-12-01 12:05:46.000000000 +0100 +@@ -162,9 +162,9 @@ bool StageManager::activateLevel( void) + #endif + + TiXmlElement* levelNode = _activeLevel->ToElement(); +- _activeLevelName = *levelNode->Attribute("Name"); ++ _activeLevelName = levelNode->Attribute("Name"); + LOG_INFO << "Level '" << _activeLevelName +- << "' by " << *levelNode->Attribute("Author") << endl; ++ << "' by " << levelNode->Attribute("Author") << endl; + + static ParticleGroup *effects = + ParticleGroupManagerS::instance()->getParticleGroup( EFFECTS_GROUP2); diff --git a/CriticalMass.desktop b/CriticalMass.desktop new file mode 100644 index 0000000..695c93c --- /dev/null +++ b/CriticalMass.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Critical Mass +Comment=SDL/OpenGL space shoot'em up game also known as critter +Exec=critter-wrapper +Icon=critter +Type=Application +Terminal=false +Categories=Game;ArcadeGame; diff --git a/CriticalMass.spec b/CriticalMass.spec new file mode 100644 index 0000000..71bca7f --- /dev/null +++ b/CriticalMass.spec @@ -0,0 +1,90 @@ +Name: CriticalMass +Version: 1.0.2 +Release: 2%{?dist} +Summary: SDL/OpenGL space shoot'em up game also known as critter +Group: Amusements/Games +License: GPLv2+ +URL: http://criticalmass.sourceforge.net/critter.php +Source0: http://downloads.sourceforge.net/criticalmass/%{name}-%{version}.tar.bz2 +Source1: %{name}.desktop +Patch0: CriticalMass-1.0.2-sys-curl.patch +Patch1: CriticalMass-1.0.2-sys-tinyxml.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: SDL_image-devel SDL_mixer-devel libpng-devel curl-devel +BuildRequires: desktop-file-utils +Requires: hicolor-icon-theme opengl-games-utils +# Also known as critter, so make "yum install critter" work +Provides: critter = %{version}-%{release} + +%description +Critical Mass (aka Critter) is an SDL/OpenGL space shoot'em up game. Your +world has been infested by an aggressive army of space critters. Overrun and +unprepared, your government was unable to defend its precious resources. As +a last effort to recapture some of the "goodies", you have been placed into +a tiny spacecraft and sent after them. + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 + + +%build +%configure +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +ln -s opengl-game-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/critter-wrapper + +# remove unwanted utility +rm $RPM_BUILD_ROOT%{_bindir}/Packer + +# below is the desktop file and icon stuff. +mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications +desktop-file-install --vendor fedora \ + --dir $RPM_BUILD_ROOT%{_datadir}/applications \ + %{SOURCE1} +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps +install -p -m 644 critter.png \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post +touch --no-create %{_datadir}/icons/hicolor || : +if [ -x %{_bindir}/gtk-update-icon-cache ]; then + %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : +fi + +%postun +touch --no-create %{_datadir}/icons/hicolor || : +if [ -x %{_bindir}/gtk-update-icon-cache ]; then + %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : +fi + + +%files +%defattr(-,root,root,-) +%doc COPYING Readme.html TODO +%{_bindir}/critter* +%{_datadir}/Critical_Mass +%{_mandir}/man6/critter.6* +%{_datadir}/applications/fedora-%{name}.desktop +%{_datadir}/icons/hicolor/48x48/apps/critter.png + + +%changelog +* Sat Dec 1 2007 Hans de Goede 1.0.2-2 +- Use system version of tinyxml +- Some other small specfile cleanups +- Use opengl-games-utils wrapper to show error dialog when DRI is missing + +* Thu Nov 29 2007 Hans de Goede 1.0.2-1 +- Initial Fedora Package diff --git a/sources b/sources index e69de29..9dc7d24 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +e2aff114bffa717fb79c82e1dc473ebe CriticalMass-1.0.2.tar.bz2