Author: musuruan
Update of /cvs/nonfree/rpms/dgen-sdl/F-8
In directory se02.es.rpmfusion.net:/tmp/cvs-serv18111/F-8
Modified Files:
.cvsignore sources
Added Files:
dgen-sdl-1.23-command_line.patch dgen-sdl-1.23-gcc34.patch
dgen-sdl-1.23-gcc4.patch
dgen-sdl-1.23-gzip_security_hole.patch
dgen-sdl-1.23-man_warning.patch dgen-sdl.spec
Log Message:
First import
dgen-sdl-1.23-command_line.patch:
--- NEW FILE dgen-sdl-1.23-command_line.patch ---
--- dgen-1.23.orig/sdl/sdl.cpp
+++ dgen-1.23/sdl/sdl.cpp
@@ -157,13 +157,15 @@
);
}
+void pd_initoptions()
+{
+ fullscreen = dgen_fullscreen;
+ x_scale = y_scale = dgen_scale;
+}
+
// Handle the switches
void pd_option(char c, const char *)
{
- // Set stuff up from the rcfile first, so we can override it with commandline
- // options
- fullscreen = dgen_fullscreen;
- x_scale = y_scale = dgen_scale;
#ifdef SDL_OPENGL_SUPPORT
opengl = dgen_opengl;
if(opengl)
--- dgen-1.23.orig/main.cpp
+++ dgen-1.23/main.cpp
@@ -236,6 +236,8 @@
// Parse the RC file
parse_rc(NULL);
+ pd_initoptions();
+
// Check all our options
strcpy(temp, "s:hvr:n:p:RPjd:D:");
strcat(temp, pd_options);
--- dgen-1.23.orig/pd.h
+++ dgen-1.23/pd.h
@@ -52,6 +52,8 @@
// This should be a list of all the command-line options specific to this
// platform, in the form given to getopt(3), i.e "a:b::c".
extern char *pd_options;
+// This is called once, during startup, before pd_option is.
+void pd_initoptions();
// And, this is called to handle platform-specific stuff.
void pd_option(char c, const char *optarg);
dgen-sdl-1.23-gcc34.patch:
--- NEW FILE dgen-sdl-1.23-gcc34.patch ---
--- star/star.c.orig 2005-12-24 22:08:06.000000000 -0500
+++ star/star.c 2005-12-24 22:08:18.000000000 -0500
@@ -1931,7 +1931,7 @@
case aind: case ainc: case adec:
case adsp: case axdp:
usereg();
- default:
+ default:;
}
}
dgen-sdl-1.23-gcc4.patch:
--- NEW FILE dgen-sdl-1.23-gcc4.patch ---
--- musa/m68kmake.c.orig 2006-05-13 12:52:38.000000000 +0100
+++ musa/m68kmake.c 2006-05-13 12:53:05.000000000 +0100
@@ -1029,10 +1029,10 @@
fprintf(filep, "/* ========================= OPCODE TABLE BUILDER
========================= */\n");
fprintf(filep, "/*
======================================================================== */\n\n");
- fprintf(filep, "#include \"m68kops.h\"\n");
- fprintf(filep, "#include \"m68kcpu.h\"\n");
fprintf(filep, "#include <stdlib.h>\n\n");
fprintf(filep, "#include <string.h>\n\n");
+ fprintf(filep, "#include \"m68kops.h\"\n");
+ fprintf(filep, "#include \"m68kcpu.h\"\n");
fprintf(filep, "extern void (*m68k_instruction_jump_table[])(void); /* opcode
handler jump table */\n\n");
dgen-sdl-1.23-gzip_security_hole.patch:
--- NEW FILE dgen-sdl-1.23-gzip_security_hole.patch ---
--- dgen-1.23.orig/romload.c
+++ dgen-1.23/romload.c
@@ -7,6 +7,10 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/wait.h>
static int load_bin_into(char *name,unsigned char *into)
{
@@ -126,13 +130,32 @@
(magicbuf[0] == 037 && magicbuf[1] == 0240) || /* LZH (?) */
(magicbuf[0] == 'P' && magicbuf[1] == 'K')) /* ZIP
(.zip ;) */
{
- char temp[0x100], temp2[0x80];
- srand(time(NULL));
+ char temp[0x100], *temp2;
+ int f;
/* Run it through gzip (I know this is cheap ;) */
- sprintf(temp2, "/tmp/dgenrom_%d_%d", rand(), rand());
- sprintf(temp, "gzip -S \"\" -cdq %s > %s", name, temp2);
- /* If gzip returned an error, stop */
- if(system(temp)) { remove(temp2); return -1; };
+ asprintf(&temp2, "/tmp/dgenrom_XXXXXX");
+ f = mkstemp(temp2);
+ if (f == -1) {
+ perror("mkstemp");
+ return -1;
+ }
+ close(f);
+
+ f = open(name, O_RDONLY);
+ if (f == -1) {
+ perror("open");
+ return -1;
+ }
+ if (dup2(f, 0) == -1) {
+ perror("dup2");
+ return -1;
+ }
+ sprintf(temp, "zcat > %s", temp2);
+ if (system(temp)) {
+ perror("system");
+ return -1;
+ }
+
/* Recurse with the new file */
len = load_rom_into(temp2, into);
remove(temp2);
@@ -142,14 +165,32 @@
/* Do bzip2 also */
if(magicbuf[0] == 'B' && magicbuf[1] == 'Z' &&
magicbuf[2] == 'h')
{
+ char temp[0x100], *temp2;
+ int f;
/* Damn, this looks almost like the gzip stuff above. *lol* :) */
- char temp[0x100], temp2[0x80];
- srand(time(NULL));
- /* Go through bzip2 */
- sprintf(temp2, "/tmp/dgenrom_%d_%d", rand(), rand());
- sprintf(temp, "bzip2 -cd %s > %s", name, temp2);
- /* If we got an error, stop */
- if(system(temp)) { remove(temp2); return -1; };
+ asprintf(&temp2, "/tmp/dgenrom_XXXXXX");
+ f = mkstemp(temp2);
+ if (f == -1) {
+ perror("mkstemp");
+ return -1;
+ }
+ close(f);
+
+ f = open(name, O_RDONLY);
+ if (f == -1) {
+ perror("open");
+ return -1;
+ }
+ if (dup2(f, 0) == -1) {
+ perror("dup2");
+ return -1;
+ }
+ sprintf(temp, "bzcat > %s", temp2);
+ if (system(temp)) {
+ perror("system");
+ return -1;
+ }
+
/* Recurse with the uncompressed file */
len = load_rom_into(temp2, into);
remove(temp2);
dgen-sdl-1.23-man_warning.patch:
--- NEW FILE dgen-sdl-1.23-man_warning.patch ---
--- dgen-1.23.orig/dgenrc.5
+++ dgen-1.23/dgenrc.5
@@ -170,7 +170,7 @@
or any combination thereof, to require that the specified modifier be pressed
in combination with the key. For example, the identifier "alt-enter" would
correspond to holding down the Alt key while pressing Enter.
-
+.P
The numbers "0" through "9" ("kp_0" through
"kp_9" for the numeric keypad),
letters "A" through "Z", and function keys "F1" through
"F12" map to their key
equivalents.
--- NEW FILE dgen-sdl.spec ---
Summary: DGen/SDL is a Sega Genesis (MegaDrive outside the US) emulator
Name: dgen-sdl
Version: 1.23
Release: 3%{?dist}
License: BSD
Group: Applications/Emulators
URL:
http://pknet.com/~joe/dgen-sdl.html
Source:
http://pknet.com/~joe/%{name}-%{version}.tar.gz
Patch0: dgen-sdl-1.23-gcc4.patch
Patch1: dgen-sdl-1.23-gcc34.patch
Patch2: dgen-sdl-1.23-man_warning.patch
Patch3: dgen-sdl-1.23-gzip_security_hole.patch
Patch4: dgen-sdl-1.23-command_line.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel >= 1.0.0
%ifarch %{ix86}
BuildRequires: nasm
%endif
%description
DGen/SDL is a semi-fantastic emulator for Unix-esque operating systems
supported by SDL library. It produces a virtual environment in which
Sega Genesis (MegaDrive outside the US) games may run with fairly
accurate audio and video.
%prep
%setup -q
%patch0 -p0
%patch1 -p0
%patch2 -p1
%patch3 -p1
%patch4 -p1
sed -i 's/\r//' mz80/mz80.txt
%build
%configure
# It does not compile with smp_mflags
make
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir docs
mkdir docs/mz80
cp -a mz80/mz80.txt docs/mz80
mkdir docs/star
cp -a star/stardoc.txt docs/star
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_bindir}/dgen
%{_bindir}/tobin
%{_mandir}/man1/dgen.1*
%{_mandir}/man1/tobin.1*
%{_mandir}/man5/dgenrc.5*
%doc AUTHORS ChangeLog COPYING README sample.dgenrc
%doc docs/mz80 docs/star
%changelog
* Mon Nov 26 2007 Andrea Musuruane <musuruan(a)gmail.com> 1.23-3
- removed %%{?dist} tag from changelog
- removed %%{?_smp_mflags} from make invocation
* Sat Dec 01 2006 Andrea Musuruane <musuruan(a)gmail.com> 1.23-2
- source tarball now matches upstreams
- added MZ80 and Starscream docs
* Sat Nov 18 2006 Andrea Musuruane <musuruan(a)gmail.com> 1.23-1
- first release for Dribble based on the old Falsehope package
- fixed Summary tag
- updated URL and Source tag
- fixed License tag
- changed BuildRoot to meet Fedora guidelines
- added SDL-devel to BuildRequires
- fixed BuildRequires to add nasm if arch is %%{ix86} and not only i386
- removed Requires tag
- removed Packager tag
- using %%configure macro instead of configure
- added %%{?_smp_mflags} to make invocation to speed up SMP builds
- cleaning of buildroot in %%install
- fixed %%files
- added a patch from Stephen Bridges to fix gcc4 compiling (Gentoo #133203)
- added a patch to fix gcc-3.4 compiling (Gentoo #116113)
- added a patch from Debian to fix man warning on dgenrc(5)
- added a patch from Debian to fix file-in-tmp security hole in gzip/bzip
rom extraction code (Debian #263282)
- added a patch from Debian to allows the SDL interface to set the fullscreen
and scale values using the values from the RC file, even if there are no
command-line options
* Tue Jul 03 2001 Henri Gomez <hgomez(a)slib.fr>
- dgen-sdl 1.2.3
- built against SDL 1.2.1
* Mon Aug 21 2000 Henri Gomez <hgomez(a)slib.fr>
- patch for 1.0 and 1.1 support (thanks to Joe Groff (ognir(a)humboldtl.com)
- recompiled with sdl 1.1
* Tue Jun 13 2000 Henri Gomez <hgomez(a)slib.fr>
- Initial RPM release
- for i386 platform use nasm for better performance.
- Built under Redhat 6.1 with updates.
Index: .cvsignore
===================================================================
RCS file: /cvs/nonfree/rpms/dgen-sdl/F-8/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 1 Jun 2008 15:28:04 -0000 1.1
+++ .cvsignore 26 Jul 2008 13:08:13 -0000 1.2
@@ -0,0 +1 @@
+dgen-sdl-1.23.tar.gz
Index: sources
===================================================================
RCS file: /cvs/nonfree/rpms/dgen-sdl/F-8/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 1 Jun 2008 15:28:04 -0000 1.1
+++ sources 26 Jul 2008 13:08:13 -0000 1.2
@@ -0,0 +1 @@
+b1896c1b21ddb152626aec2e8a157a3a dgen-sdl-1.23.tar.gz