[CriticalMass] New upstream release 1.5 (rhbz#766117)
Hans de Goede
jwrdegoede at fedoraproject.org
Sat Dec 10 16:31:35 UTC 2011
commit 09100a29c116b1fdaa42defc62377b2f691be8ce
Author: Hans de Goede <hdegoede at redhat.com>
Date: Sat Dec 10 17:32:15 2011 +0100
New upstream release 1.5 (rhbz#766117)
.gitignore | 1 +
CriticalMass-1.0.2-gcc43.patch | 46 -----
CriticalMass-1.0.2-res-change-rh566533.patch | 133 +--------------
CriticalMass-1.0.2-sys-curl.patch | 70 --------
CriticalMass-1.0.2-sys-tinyxml.patch | 234 --------------------------
CriticalMass-1.5-libpng15.patch | 32 ++++
CriticalMass.spec | 51 +++---
sources | 2 +-
8 files changed, 67 insertions(+), 502 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 070c356..0a6838a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
CriticalMass-1.0.2.tar.bz2
+/CriticalMass-1.5.tar.bz2
diff --git a/CriticalMass-1.0.2-res-change-rh566533.patch b/CriticalMass-1.0.2-res-change-rh566533.patch
index 965a1ca..25db0e7 100644
--- a/CriticalMass-1.0.2-res-change-rh566533.patch
+++ b/CriticalMass-1.0.2-res-change-rh566533.patch
@@ -1,130 +1,17 @@
---- CriticalMass-1.0.2/game/Selectable.hpp 2005-08-15 03:06:37.000000000 +0200
-+++ CriticalMass-1.0.2.foo/game/Selectable.hpp 2010-07-12 15:33:57.229790590 +0200
-@@ -139,7 +139,7 @@
- string text;
- bool operator==(Resolution &r1)
- {
-- return (r1.width=width) && (r1.height==height);
-+ return (r1.width==width) && (r1.height==height);
- }
- bool operator!=(Resolution &r1)
- {
---- CriticalMass-1.0.2/game/Video.cpp 2006-07-16 01:43:57.000000000 +0200
-+++ CriticalMass-1.0.2.foo/game/Video.cpp 2010-07-12 16:40:16.377919418 +0200
-@@ -124,10 +124,9 @@
- _fpsStepSize = 1.0f/(float)_maxFPS;
- }
-
-- ConfigS::instance()->getBoolean( "fullscreen", _isFullscreen);
--
- if( !setVideoMode())
- {
-+ SDL_QuitSubSystem( SDL_INIT_VIDEO);
- return false;
- }
-
-@@ -247,6 +246,8 @@
- bool Video::setVideoMode( void)
- {
- int videoFlags = SDL_OPENGL;
-+
-+ ConfigS::instance()->getBoolean( "fullscreen", _isFullscreen);
- if( _isFullscreen)
- {
- LOG_INFO << "Fullscreen request." << endl;
-@@ -279,14 +280,12 @@
- if( ! ::init("libGL.so.1"))
- {
- LOG_ERROR << "SDL Error: " << SDL_GetError() << endl;
-- SDL_QuitSubSystem( SDL_INIT_VIDEO);
- return false;
- }
-
- if( SDL_SetVideoMode( _width, _height, _bpp, videoFlags ) == NULL )
- {
- LOG_ERROR << "Video Mode: failed #" << SDL_GetError() << endl;
-- SDL_QuitSubSystem( SDL_INIT_VIDEO);
- return false;
- }
- glViewport(0,0, _width, _height);
-@@ -304,16 +303,20 @@
- return true;
- }
-
--void Video::updateSettings( void)
-+bool Video::updateSettings( void)
+diff -up CriticalMass-1.5/game/Video.cpp~ CriticalMass-1.5/game/Video.cpp
+--- CriticalMass-1.5/game/Video.cpp~ 2010-10-17 03:09:48.000000000 +0200
++++ CriticalMass-1.5/game/Video.cpp 2011-12-10 11:54:31.566090135 +0100
+@@ -290,10 +290,10 @@ bool Video::setVideoMode( void)
+ bool Video::updateSettings( void)
{
-- bool fullscreen = _isFullscreen;
+ bool fullscreen = _isFullscreen;
- ConfigS::instance()->getBoolean( "fullscreen", _isFullscreen);
-+ bool isFullscreen, oldIsFullscreen;
-+ int width, height, oldWidth, oldHeight;
-+
-+ isFullscreen = oldIsFullscreen = _isFullscreen;
-+ width = oldWidth = _width;
-+ height = oldHeight = _height;
-
- int width = 0;
-+ ConfigS::instance()->getBoolean( "fullscreen", isFullscreen);
++ ConfigS::instance()->getBoolean( "fullscreen", fullscreen);
++ int width = _width;
ConfigS::instance()->getInteger( "width", width);
- int height = 0;
++ int height = _height;
ConfigS::instance()->getInteger( "height", height);
-- if( (fullscreen != _isFullscreen) || (width != _width) || (height != _height))
-+
-+ if( (isFullscreen != oldIsFullscreen) || (width != oldWidth) || (height != oldHeight))
- {
- #ifdef DYNAMIC_GL
- SDL_QuitSubSystem( SDL_INIT_VIDEO);
-@@ -322,7 +325,22 @@
- LOG_ERROR << "Update Video: failed # " << SDL_GetError() << endl;
- }
- #endif
-- setVideoMode();
-+ if (!setVideoMode()) {
-+ // Try again with old settings.
-+ Value *fs = new Value( oldIsFullscreen);
-+ Value *w = new Value( oldWidth);
-+ Value *h = new Value( oldHeight);
-+
-+ ConfigS::instance()->updateKeyword( "fullscreen", fs);
-+ ConfigS::instance()->updateKeyword( "width", w);
-+ ConfigS::instance()->updateKeyword( "height", h);
-+
-+ if (!setVideoMode()) {
-+ SDL_QuitSubSystem(SDL_INIT_VIDEO);
-+ GameState::isAlive = false;
-+ return false;
-+ }
-+ }
- reload();
- #ifdef DYNAMIC_GL
- //hide&grab cursor and warp to centre
-@@ -345,6 +363,8 @@
-
- ConfigS::instance()->getBoolean( "showStarfield", _showStarfield);
- ConfigS::instance()->getBoolean( "showNebulas", _showNebulas);
-+
-+ return true;
- }
-
- void Video::updateLogic( void)
-@@ -360,7 +380,8 @@
- float thisTime = Timer::getTime();
- if( thisTime > nextTime)
- {
-- updateSettings();
-+ if (!updateSettings())
-+ return false;
- nextTime = thisTime+0.5f;
- }
-
---- CriticalMass-1.0.2/game/Video.hpp 2005-12-31 01:37:26.000000000 +0100
-+++ CriticalMass-1.0.2.foo/game/Video.hpp 2010-07-12 16:37:20.560170285 +0200
-@@ -52,7 +52,7 @@
- Video &operator=(const Video&);
-
- void reload( void);
-- void updateSettings( void);
-+ bool updateSettings( void);
- bool setVideoMode( void);
- bool _isFullscreen;
+ if( (fullscreen != _isFullscreen) || (width != _width) || (height != _height))
diff --git a/CriticalMass-1.5-libpng15.patch b/CriticalMass-1.5-libpng15.patch
new file mode 100644
index 0000000..5693dd0
--- /dev/null
+++ b/CriticalMass-1.5-libpng15.patch
@@ -0,0 +1,32 @@
+diff -up CriticalMass-1.5/utilssdl/PNG.cpp~ CriticalMass-1.5/utilssdl/PNG.cpp
+--- CriticalMass-1.5/utilssdl/PNG.cpp~ 2010-10-17 03:09:50.000000000 +0200
++++ CriticalMass-1.5/utilssdl/PNG.cpp 2011-12-10 17:14:27.904931754 +0100
+@@ -56,7 +56,7 @@ void PNG::writeData( png_structp png, pn
+ {
+ png_size_t check;
+
+- check = fwrite( data, 1, length, (FILE *)(png->io_ptr));
++ check = fwrite( data, 1, length, (FILE *)png_get_io_ptr(png));
+ if( check != length)
+ {
+ png_error( png, "Write Error");
+@@ -83,7 +83,7 @@ bool PNG::init( FILE *fp, int width, int
+ return false;
+ }
+
+- if( setjmp(_png->jmpbuf))
++ if( setjmp(png_jmpbuf(_png)))
+ {
+ fclose( fp);
+ png_destroy_write_struct(&_png, (png_infopp)NULL);
+diff -up CriticalMass-1.5/game/main.cpp~ CriticalMass-1.5/game/main.cpp
+--- CriticalMass-1.5/game/main.cpp~ 2010-10-17 03:09:48.000000000 +0200
++++ CriticalMass-1.5/game/main.cpp 2011-12-10 17:19:52.062927383 +0100
+@@ -27,6 +27,7 @@
+
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <zlib.h>
+
+ using namespace std;
+
diff --git a/CriticalMass.spec b/CriticalMass.spec
index 548ca85..cadcb6a 100644
--- a/CriticalMass.spec
+++ b/CriticalMass.spec
@@ -1,17 +1,14 @@
Name: CriticalMass
-Version: 1.0.2
-Release: 10%{?dist}
+Version: 1.5
+Release: 1%{?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
-Patch2: CriticalMass-1.0.2-gcc43.patch
-Patch3: CriticalMass-1.0.2-res-change-rh566533.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch0: CriticalMass-1.0.2-res-change-rh566533.patch
+Patch1: CriticalMass-1.5-libpng15.patch
BuildRequires: SDL_image-devel SDL_mixer-devel libpng-devel curl-devel
BuildRequires: tinyxml-devel desktop-file-utils
Requires: hicolor-icon-theme opengl-games-utils
@@ -30,19 +27,19 @@ a tiny spacecraft and sent after them.
%setup -q
%patch0 -p1
%patch1 -p1
-%patch2 -p1
-%patch3 -p1
+sed -i 's/curl-gnutls/curl/g' configure
%build
%configure
-# <sigh> ./configure doesn't properly pick up our CFLAGS
-CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL"
-make %{?_smp_mflags} CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS -fno-exceptions"
+# ./configure doesn't properly pick up our CFLAGS, and we need to override
+# the CFLAGS anyways, so as to not define USE_ONLINE_UPDATE, to stop critter
+# from phoning home
+CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE=1 -D_REENTRANT -DGAME_HAS_HERO_PARTICLE -I/usr/include/SDL"
+make CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS -std=c++0x"
%install
-rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
ln -s opengl-game-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/critter-wrapper
@@ -54,39 +51,37 @@ 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
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/256x256/apps
install -p -m 644 critter.png \
- $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+ $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/256x256/apps
%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
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
-touch --no-create %{_datadir}/icons/hicolor || :
-if [ -x %{_bindir}/gtk-update-icon-cache ]; then
- %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+if [ $1 -eq 0 ] ; then
+ touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
+%posttrans
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
%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
+%{_datadir}/icons/hicolor/256x256/apps/critter.png
%changelog
+* Sat Dec 10 2011 Hans de Goede <hdegoede at redhat.com> - 1.5-1
+- New upstream release 1.5 (rhbz#766117)
+
* Tue Dec 06 2011 Adam Jackson <ajax at redhat.com> - 1.0.2-10
- Rebuild for new libpng
diff --git a/sources b/sources
index 9dc7d24..835a3f3 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e2aff114bffa717fb79c82e1dc473ebe CriticalMass-1.0.2.tar.bz2
+296a46f730801cc845f6139d93e9d7bf CriticalMass-1.5.tar.bz2
More information about the scm-commits
mailing list