rpms/tecnoballz/F-7 tecnoballz-0.92-dropsgid.patch, NONE, 1.1 tecnoballz-0.92-no-smpeg.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 sources, 1.2, 1.3 tecnoballz.spec, 1.2, 1.3 tecnoballz-0.91-64-bit.patch, 1.1, NONE tecnoballz-0.91-build.patch, 1.1, NONE tecnoballz-0.91-configfile.patch, 1.1, NONE tecnoballz-0.91-datadir.patch, 1.1, NONE tecnoballz-0.91-dropsgid.patch, 1.1, NONE tecnoballz-0.91-gcc41.patch, 1.1, NONE tecnoballz-0.91-hiscorepath.patch, 1.1, NONE tecnoballz-0.91-no-smpeg.patch, 1.1, NONE tecnoballz-0.91-owner.patch, 1.1, NONE
Andrea Musuruane (musuruan)
fedora-extras-commits at redhat.com
Sun Dec 23 14:21:55 UTC 2007
- Previous message (by thread): rpms/tecnoballz/F-8 tecnoballz-0.92-dropsgid.patch, NONE, 1.1 tecnoballz-0.92-no-smpeg.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 sources, 1.2, 1.3 tecnoballz.spec, 1.2, 1.3 tecnoballz-0.91-64-bit.patch, 1.1, NONE tecnoballz-0.91-build.patch, 1.1, NONE tecnoballz-0.91-configfile.patch, 1.1, NONE tecnoballz-0.91-datadir.patch, 1.1, NONE tecnoballz-0.91-dropsgid.patch, 1.1, NONE tecnoballz-0.91-gcc41.patch, 1.1, NONE tecnoballz-0.91-hiscorepath.patch, 1.1, NONE tecnoballz-0.91-no-smpeg.patch, 1.1, NONE tecnoballz-0.91-owner.patch, 1.1, NONE
- Next message (by thread): rpms/quake3/devel urbanterror.autodlrc, NONE, 1.1 urbanterror.desktop, NONE, 1.1 urbanterror.png, NONE, 1.1 urbanterror.sh, NONE, 1.1 wop.png, NONE, 1.1 worldofpadman.autodlrc, NONE, 1.1 worldofpadman.desktop, NONE, 1.1 worldofpadman.sh, NONE, 1.1 quake3.desktop, 1.1, 1.2 quake3.spec, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: musuruan
Update of /cvs/pkgs/rpms/tecnoballz/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11495
Modified Files:
.cvsignore sources tecnoballz.spec
Added Files:
tecnoballz-0.92-dropsgid.patch tecnoballz-0.92-no-smpeg.patch
Removed Files:
tecnoballz-0.91-64-bit.patch tecnoballz-0.91-build.patch
tecnoballz-0.91-configfile.patch tecnoballz-0.91-datadir.patch
tecnoballz-0.91-dropsgid.patch tecnoballz-0.91-gcc41.patch
tecnoballz-0.91-hiscorepath.patch
tecnoballz-0.91-no-smpeg.patch tecnoballz-0.91-owner.patch
Log Message:
- updated to v0.92
- license changed to GPLv3+
- changed description
- dropped French man page because it is outdated
- added SDL_image-devel to BR
- added a new patch by Hans de Goede to drop setgid privileges when not needed
- dropped no longer needed patches
tecnoballz-0.92-dropsgid.patch:
--- NEW FILE tecnoballz-0.92-dropsgid.patch ---
diff -up tecnoballz-0.92/include/handler_resources.h.sgid tecnoballz-0.92/include/handler_resources.h
--- tecnoballz-0.92/include/handler_resources.h.sgid 2007-10-09 07:46:24.000000000 +0200
+++ tecnoballz-0.92/include/handler_resources.h 2007-12-21 11:16:40.000000000 +0100
@@ -42,7 +42,6 @@ class handler_resources:public virtual t
static const char *folderdata;
static const char *folder_320;
static const char *folder_640;
- static char *fnamescore;
static char tmp_filename[512];
static char pathstring[512];
static const Uint32 TEXTS_OFFSET = 2048;
@@ -93,6 +92,8 @@ class handler_resources:public virtual t
static const Sint16 *zesinus360;
static const Uint32 color_gradations[180];
+ static char *fnamescore;
+ static int score_fhand;
private:
/** Size last file loaded in memory */
Uint32 last_filesize_loaded;
diff -up tecnoballz-0.92/src/handler_resources.cc.sgid tecnoballz-0.92/src/handler_resources.cc
--- tecnoballz-0.92/src/handler_resources.cc.sgid 2007-10-29 14:18:53.000000000 +0100
+++ tecnoballz-0.92/src/handler_resources.cc 2007-12-21 11:16:40.000000000 +0100
@@ -46,6 +46,7 @@
#endif
char * handler_resources::fnamescore = SCOREFILE;
+int handler_resources::score_fhand = -1;
const char *
handler_resources::folder_640 = "hires/";
const char *
@@ -737,18 +738,54 @@ handler_resources::load_sinus ()
char *
handler_resources::load_high_score_file ()
{
- char* filedata = NULL;
+ if (score_fhand == -1)
+ return NULL;
+
+ /* read the size of the file */
+ struct stat sb;
+ if (fstat (score_fhand, &sb))
+ {
+ std::cerr << "(!)handler_resources::load_high_score_file() " <<
+ "can't stat file " << fnamescore
+ << "strerror:" << strerror (errno) << std::endl;
+ return NULL;
+ }
+ /* save filesize */
+ last_filesize_loaded = sb.st_size;
+
+ /* allocate memory require to load the filedata */
+ char *buffer = NULL;
try
+ {
+ buffer = new char[sb.st_size];
+ }
+ catch (std::bad_alloc &)
+ {
+ std::cerr << "(!)handler_resources::load_high_score_file() " <<
+ "not enough memory to allocate " <<
+ sb.st_size << " bytes!" << std::endl;
+ throw;
+ }
+
+ /* read the file */
+ if(lseek(score_fhand, 0, SEEK_SET) != 0)
{
- filedata = load_file (fnamescore, &last_filesize_loaded);
+ std::cerr << "(!)handler_resources::load_high_score_file() can't rewind file " <<
+ fnamescore << "strerror:" << strerror (errno) << std::endl;
+ delete buffer;
+ return NULL;
}
- catch (...)
+
+ if (read (score_fhand, buffer, sb.st_size) != sb.st_size)
{
- std::cerr << "(!)handler_resources::load_high_score_file() " <<
- "can't open the scores files!" << std::endl;
- filedata = NULL;
+ std::cerr << "(!)handler_resources::load_high_score_file() " <<
+ "can't read file " << fnamescore
+ << "strerror:" << strerror (errno) << std::endl;
+ delete buffer;
+ return NULL;
}
- return filedata;
+
+ return buffer;
}
/*
@@ -759,25 +796,18 @@ handler_resources::load_high_score_file
void
handler_resources::save_high_score_file (char *buffer, Uint32 size)
{
-#ifdef WIN32
- /* set umask so that files are group-writable */
- _umask (0002);
-#else
- umask (0002);
-#endif
- Sint32 fhand = open (fnamescore, O_WRONLY | O_CREAT, 00666);
- if (fhand == -1)
+ if (score_fhand == -1)
+ return;
+
+ if(lseek(score_fhand, 0, SEEK_SET) != 0)
{
- fprintf (stderr,
- "handler_resources::saveScores(): file:%s / error:%s\n",
- fnamescore, strerror (errno));
+ fprintf(stderr,
+ "handler_resources::saveScores() can't rewind file %s (%s)\n\n",
+ fnamescore, strerror(errno));
+ return;
}
-#ifdef WIN32
- _write (fhand, buffer, size);
-#else
- write (fhand, buffer, size);
-#endif
- if (close (fhand) == -1)
+
+ if(write(score_fhand, buffer, size) != size)
{
fprintf (stderr,
"handler_resources::saveScores(): file:%s / error:%s\n",
diff -up tecnoballz-0.92/src/main.cc.sgid tecnoballz-0.92/src/main.cc
--- tecnoballz-0.92/src/main.cc.sgid 2007-11-19 13:44:15.000000000 +0100
+++ tecnoballz-0.92/src/main.cc 2007-12-21 11:17:38.000000000 +0100
@@ -26,6 +26,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
+#include <unistd.h>
+#include "../include/handler_resources.h"
#include "../include/tecnoballz.h"
#include "../include/handler_display.h"
#include "../include/handler_audio.h"
@@ -61,6 +63,19 @@ returnToMenu (void)
Sint32
main (Sint32 arg_count, char **arg_values)
{
+ gid_t realgid;
+
+ handler_resources::score_fhand = open(handler_resources::fnamescore, O_RDWR);
+
+ /* Figure out who we really are. */
+ realgid = getgid();
+
+ /* This is where we drop our setuid/setgid privileges. */
+ if (setresgid(-1, realgid, realgid) != 0) {
+ perror("Could not drop setgid privileges. Aborting.");
+ exit(1);
+ }
+
/* GP2X or PSP port */
#ifdef TECNOBALLZ_HANDHELD_CONSOLE
/* Use atexit() to call the return-to-menu function,
@@ -71,7 +86,7 @@ main (Sint32 arg_count, char **arg_value
configuration.load ();
if (!configuration.scan_arguments (arg_count, arg_values))
{
- return 0;
+ goto main_exit;
}
if (tecnoballz::is_verbose)
{
@@ -79,7 +94,6 @@ main (Sint32 arg_count, char **arg_value
<< "TecnoballZ starts! " << std::endl
<< "================================" << std::endl;
}
- Sint32 error = 0;
try
{
tecnoballz::first_init (&configuration);
@@ -94,6 +108,8 @@ main (Sint32 arg_count, char **arg_value
{
std::cerr << "fatal error" << std::endl;
tecnoballz::release_all_objects (&configuration);
+ if (handler_resources::score_fhand != -1)
+ close(handler_resources::score_fhand);
throw;
}
if (tecnoballz::is_verbose)
@@ -106,7 +122,12 @@ main (Sint32 arg_count, char **arg_value
std::cout << "TecnoballZ is finished! ========" << std::endl;
}
configuration.save ();
- return error;
+
+main_exit:
+ if (handler_resources::score_fhand != -1)
+ close(handler_resources::score_fhand);
+
+ return 0;
}
tecnoballz-0.92-no-smpeg.patch:
--- NEW FILE tecnoballz-0.92-no-smpeg.patch ---
diff -durN tecnoballz-0.92.orig/configure tecnoballz-0.92/configure
--- tecnoballz-0.92.orig/configure 2007-11-19 14:45:33.000000000 +0100
+++ tecnoballz-0.92/configure 2007-12-16 16:10:54.000000000 +0100
@@ -5019,81 +5019,6 @@
fi
-{ echo "$as_me:$LINENO: checking for SMPEG_play in -lsmpeg" >&5
-echo $ECHO_N "checking for SMPEG_play in -lsmpeg... $ECHO_C" >&6; }
-if test "${ac_cv_lib_smpeg_SMPEG_play+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsmpeg $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char SMPEG_play ();
-int
-main ()
-{
-return SMPEG_play ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_smpeg_SMPEG_play=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_smpeg_SMPEG_play=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_smpeg_SMPEG_play" >&5
-echo "${ECHO_T}$ac_cv_lib_smpeg_SMPEG_play" >&6; }
-if test $ac_cv_lib_smpeg_SMPEG_play = yes; then
-
- MM_LIBS="${MM_LIBS} -lsmpeg"
-
-else
-
- { { echo "$as_me:$LINENO: error: Could not find the smpeg lib : -lsmpeg" >&5
-echo "$as_me: error: Could not find the smpeg lib : -lsmpeg" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-
-
-
{ echo "$as_me:$LINENO: checking for Player_Stop in -lmikmod" >&5
echo $ECHO_N "checking for Player_Stop in -lmikmod... $ECHO_C" >&6; }
if test "${ac_cv_lib_mikmod_Player_Stop+set}" = set; then
diff -durN tecnoballz-0.92.orig/configure.ac tecnoballz-0.92/configure.ac
--- tecnoballz-0.92.orig/configure.ac 2007-11-19 13:44:15.000000000 +0100
+++ tecnoballz-0.92/configure.ac 2007-12-16 16:09:30.000000000 +0100
@@ -60,11 +60,6 @@
],[
AC_MSG_ERROR(Could not find the ogg lib : -logg)
])
-AC_CHECK_LIB(smpeg, SMPEG_play, [
- MM_LIBS="${MM_LIBS} -lsmpeg"
-],[
- AC_MSG_ERROR(Could not find the smpeg lib : -lsmpeg)
-])
AC_SUBST(MM_LIBS)
AC_CHECK_LIB(mikmod, Player_Stop, [
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/tecnoballz/F-7/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore 3 Apr 2007 17:37:27 -0000 1.2
+++ .cvsignore 23 Dec 2007 14:21:20 -0000 1.3
@@ -1 +1 @@
-tecnoballz-0.91.tgz
+tecnoballz-0.92.tgz
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/tecnoballz/F-7/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources 3 Apr 2007 17:37:27 -0000 1.2
+++ sources 23 Dec 2007 14:21:20 -0000 1.3
@@ -1 +1 @@
-6af1aea114f4d22d6c6d0e12babecddf tecnoballz-0.91.tgz
+111022212bc77b7dfcb453eaa5eac751 tecnoballz-0.92.tgz
Index: tecnoballz.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tecnoballz/F-7/tecnoballz.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- tecnoballz.spec 25 Aug 2007 13:50:52 -0000 1.2
+++ tecnoballz.spec 23 Dec 2007 14:21:20 -0000 1.3
@@ -1,32 +1,21 @@
Name: tecnoballz
-Version: 0.91
-Release: 6%{?dist}
+Version: 0.92
+Release: 1%{?dist}
Summary: A Brick Busting game
Group: Amusements/Games
-License: GPLv2+
+License: GPLv3+
URL: http://linux.tlk.fr/games/TecnoballZ/
Source0: http://linux.tlk.fr/games/TecnoballZ/download/%{name}-%{version}.tgz
Source1: %{name}.xpm
Source2: %{name}.desktop
-# Vine Linux
-Patch0: tecnoballz-0.91-datadir.patch
-Patch1: tecnoballz-0.91-owner.patch
-# Debian
-Patch2: tecnoballz-0.91-hiscorepath.patch
-# BoredByPolitics
-Patch3: tecnoballz-0.91-build.patch
-# Martin Michlmayr
-Patch4: tecnoballz-0.91-gcc41.patch
-# Upstream CVS
-Patch5: tecnoballz-0.91-configfile.patch
# Hans de Goede
-Patch6: tecnoballz-0.91-64-bit.patch
-Patch7: tecnoballz-0.91-no-smpeg.patch
-Patch8: tecnoballz-0.91-dropsgid.patch
+Patch0: tecnoballz-0.92-no-smpeg.patch
+Patch1: tecnoballz-0.92-dropsgid.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: SDL_image-devel
BuildRequires: SDL_mixer-devel
BuildRequires: libvorbis-devel
BuildRequires: mikmod-devel
@@ -35,48 +24,35 @@
%description
-TecnoballZ is a "breaking blocks" game that was first written for the
-Amiga platfrom.
-You'll need to break all the blocks in each level. The game is divided
-into Areas which are divided into Levels. Between some levels, you
-have to defeat a guardian to pass to the next level. When passing an
-Area, a new edge is open. You can buy weapons and bonus between levels
-with the money earned during the game.
+A exciting Brick Breaker with 50 levels of game and 11 special levels,
+distributed on the 2 modes of game to give the player a sophisticated
+system of attack weapons with an enormous power of fire that can be
+build by gaining bonuses. Numerous decors, musics and sounds
+complete this great game. This game was ported from the Commodore Amiga.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
-%patch2 -p1
-%patch3 -p2
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-
-#fix man encodig
-iconv -f ASCII -t UTF-8 man/tecnoballz.1 > man/tecnoballz.1.conv && mv -f man/tecnoballz.1.conv man/tecnoballz.1
-iconv -f ISO8859-1 -t UTF-8 man/tecnoballz.fr.1 > man/tecnoballz.fr.1.conv && mv -f man/tecnoballz.fr.1.conv man/tecnoballz.fr.1
+
+# FIX: set gamedir and scoredir
+sed -i 's:gamesdir = $(prefix)/games:gamesdir = ${bindir}:' src/Makefile.in
+sed -i 's:scoredir = /var/games/tecnoballz:scoredir = ${localstatedir}/games/%{name}:' Makefile.in
%build
%configure
+# FIX: ovverride CXXFLAGS to pick up RPM_OPT_FLAGS
make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS"
%install
rm -rf %{buildroot}
-%makeinstall datadir=%{buildroot}%{_datadir}/%{name} VARDIR=%{buildroot}%{_localstatedir}/games/%{name}
+make install DESTDIR=%{buildroot}
-# install man6
-mkdir -p %{buildroot}%{_mandir}/man6/
-mkdir -p %{buildroot}%{_mandir}/fr/man6/
-sed s/TH\ TecnoballZ/TH\ TecnoballZ\ 6/ < man/%{name}.1 > man/%{name}.6
-sed s/TH\ TecnoballZ/TH\ TecnoballZ\ 6/ < man/%{name}.fr.1 > man/%{name}.fr.6
-install -p -m0644 man/%{name}.6 %{buildroot}%{_mandir}/man6/%{name}.6
-install -p -m0644 man/%{name}.fr.6 %{buildroot}%{_mandir}/fr/man6/%{name}.6
+# FIX: install missing files
+cp -fr src/TecnoballZ/levels-data.xml src/TecnoballZ/texts %{buildroot}%{_datadir}/%{name}
# install desktop file
mkdir -p %{buildroot}%{_datadir}/applications
@@ -112,7 +88,6 @@
%attr(2755,root,games) %{_bindir}/tecnoballz
%{_datadir}/tecnoballz
%{_mandir}/man6/tecnoballz.6*
-%{_mandir}/fr/man6/tecnoballz.6*
%{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm
%{_datadir}/applications/fedora-%{name}.desktop
%doc AUTHORS CHANGES COPYING README
@@ -120,6 +95,15 @@
%changelog
+* Sat Dec 22 2007 Andrea Musuruane <musuruan at gmail.com> 0.92-1
+- updated to v0.92
+- license changed to GPLv3+
+- changed description
+- dropped French man page because it is outdated
+- added SDL_image-devel to BR
+- added a new patch by Hans de Goede to drop setgid privileges when not needed
+- dropped no longer needed patches
+
* Sat Aug 25 2007 Andrea Musuruane <musuruan at gmail.com> 0.91-6
- changed license due to new guidelines
- removed %%{?dist} tag from changelog
--- tecnoballz-0.91-64-bit.patch DELETED ---
--- tecnoballz-0.91-build.patch DELETED ---
--- tecnoballz-0.91-configfile.patch DELETED ---
--- tecnoballz-0.91-datadir.patch DELETED ---
--- tecnoballz-0.91-dropsgid.patch DELETED ---
--- tecnoballz-0.91-gcc41.patch DELETED ---
--- tecnoballz-0.91-hiscorepath.patch DELETED ---
--- tecnoballz-0.91-no-smpeg.patch DELETED ---
--- tecnoballz-0.91-owner.patch DELETED ---
- Previous message (by thread): rpms/tecnoballz/F-8 tecnoballz-0.92-dropsgid.patch, NONE, 1.1 tecnoballz-0.92-no-smpeg.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 sources, 1.2, 1.3 tecnoballz.spec, 1.2, 1.3 tecnoballz-0.91-64-bit.patch, 1.1, NONE tecnoballz-0.91-build.patch, 1.1, NONE tecnoballz-0.91-configfile.patch, 1.1, NONE tecnoballz-0.91-datadir.patch, 1.1, NONE tecnoballz-0.91-dropsgid.patch, 1.1, NONE tecnoballz-0.91-gcc41.patch, 1.1, NONE tecnoballz-0.91-hiscorepath.patch, 1.1, NONE tecnoballz-0.91-no-smpeg.patch, 1.1, NONE tecnoballz-0.91-owner.patch, 1.1, NONE
- Next message (by thread): rpms/quake3/devel urbanterror.autodlrc, NONE, 1.1 urbanterror.desktop, NONE, 1.1 urbanterror.png, NONE, 1.1 urbanterror.sh, NONE, 1.1 wop.png, NONE, 1.1 worldofpadman.autodlrc, NONE, 1.1 worldofpadman.desktop, NONE, 1.1 worldofpadman.sh, NONE, 1.1 quake3.desktop, 1.1, 1.2 quake3.spec, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list