Accepting request 120835 from games

command-line WAD archive utility

OBS-URL: https://build.opensuse.org/request/show/120835
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/deutex?expand=0&rev=1
This commit is contained in:
Stephan Kulow 2012-05-16 10:24:23 +00:00 committed by Git OBS Bridge
commit f167b49a8e
10 changed files with 400 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
deutex-4.4.902.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:020ca4bdaf3567396731f73ef5d28cc4193c3d07c22cbd763ba29ec6e57e5544
size 202584

75
deutex-automake.diff Normal file
View File

@ -0,0 +1,75 @@
---
Makefile.am | 37 +++++++++++++++++++++++++++++++++++++
configure.ac | 9 +++++++++
src/deutex.h | 2 +-
3 files changed, 47 insertions(+), 1 deletion(-)
Index: deutex-4.4.902/Makefile.am
===================================================================
--- /dev/null
+++ deutex-4.4.902/Makefile.am
@@ -0,0 +1,37 @@
+# -*- Makefile -*-
+
+AM_CFLAGS = -Wall -Wpointer-arith -Wstrict-prototypes
+
+bin_PROGRAMS = deusf deutex
+
+deutex_SOURCES = \
+ src/color.c \
+ src/compose.c \
+ src/deutex.c \
+ src/endianio.c \
+ src/endianm.c \
+ src/extract.c \
+ src/gifcodec.c \
+ src/ident.c \
+ src/listdir.c \
+ src/lists.c \
+ src/log.c \
+ src/lzw.c \
+ src/merge.c \
+ src/mkwad.c \
+ src/picture.c \
+ src/sound.c \
+ src/sscript.c \
+ src/substit.c \
+ src/text.c \
+ src/texture.c \
+ src/tools.c \
+ src/usedidx.c \
+ src/version.c \
+ src/wadio.c
+deutex_CFLAGS = ${AM_CFLAGS} -DDeuTex
+
+deusf_SOURCES = ${deutex_SOURCES}
+deusf_CFLAGS = ${AM_CFLAGS} -DDeuSF
+
+man_MANS = deutex.6
Index: deutex-4.4.902/configure.ac
===================================================================
--- /dev/null
+++ deutex-4.4.902/configure.ac
@@ -0,0 +1,9 @@
+AC_INIT([deutex], [4.4.902])
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_CHECK_HEADERS([inttypes.h])
+AC_CHECK_FUNCS([snprintf])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
Index: deutex-4.4.902/src/deutex.h
===================================================================
--- deutex-4.4.902.orig/src/deutex.h
+++ deutex-4.4.902/src/deutex.h
@@ -100,7 +100,7 @@ extern const char deutex_version[];
#endif
/* Fixed-size types */
-#ifdef HAVE_INTTYPES
+#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif

105
deutex-braces.diff Normal file
View File

@ -0,0 +1,105 @@
From: Jan Engelhardt <jengelh@medozas.de>
Fix build warnings.
src/mkwad.c: In function "WADRreadBytes":
src/mkwad.c:386:6: warning: suggest explicit braces to avoid ambiguous "else"
src/mkwad.c: In function "WADRreadShort":
src/mkwad.c:405:6: warning: suggest explicit braces to avoid ambiguous "else"
src/mkwad.c: In function "WADRreadLong":
src/mkwad.c:417:6: warning: suggest explicit braces to avoid ambiguous "else"
src/mkwad.c: In function "WADRreadEntry2":
src/mkwad.c:492:6: warning: suggest explicit braces to avoid ambiguous "else"
src/color.c: In function "COLinit":
src/color.c:224:6: warning: suggest explicit braces to avoid ambiguous "else"
---
src/color.c | 3 ++-
src/mkwad.c | 12 ++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
Index: deutex-4.4.902/src/color.c
===================================================================
--- deutex-4.4.902.orig/src/color.c
+++ deutex-4.4.902/src/color.c
@@ -221,12 +221,13 @@ void COLinit( UInt8 invR, UInt8 invG, UI
const char *name = NULL;
/*Int16 R,G,B;*/
if(COLok!=FALSE) Bug("PL02", "COLok");
- if(Colsz< 256*sizeof(struct PIXEL))
+ if(Colsz< 256*sizeof(struct PIXEL)) {
if (lumpname == NULL)
ProgError ("PL03", "%s: wrong size for PLAYPAL", fname (pathname));
else
ProgError ("PL04", "%s: %s: wrong size for PLAYPAL",
fname (pathname), lump_name (lumpname));
+ }
COLok=TRUE;
COLpal= (struct PIXEL *)Malloc(256*sizeof(struct PIXEL));
for(i=0;i< NCOLOURS;i++)
Index: deutex-4.4.902/src/mkwad.c
===================================================================
--- deutex-4.4.902.orig/src/mkwad.c
+++ deutex-4.4.902/src/mkwad.c
@@ -383,7 +383,7 @@ iolen_t WADRreadBytes (struct WADINFO *i
{
long ofs = ftell (info->fd);
iolen_t result = WADRreadBytes2 (info, buffer, nbytes);
- if (result != nbytes)
+ if (result != nbytes) {
if (ferror (info->fd))
ProgError ("WR43", "%s: read error (got %lu/%lu bytes)",
fnameofs (info->filename, ofs),
@@ -394,6 +394,7 @@ iolen_t WADRreadBytes (struct WADINFO *i
fnameofs (info->filename, ofs),
(unsigned long) result,
(unsigned long) nbytes);
+ }
return nbytes;
}
@@ -402,11 +403,12 @@ Int16 WADRreadShort(struct WADINFO *info
{ Int16 res;
long ofs = ftell (info->fd);
if (!(info->ok&WADR_READ)) Bug("WR51", "WadRdS");
- if (wad_read_i16 (info->fd, &res))
+ if (wad_read_i16 (info->fd, &res)) {
if (ferror (info->fd))
ProgError ("WR53", "%s: read error", fnameofs (info->filename, ofs));
else
ProgError ("WR55", "%s: unexpected EOF", fnameofs (info->filename, ofs));
+ }
return res;
}
@@ -414,11 +416,12 @@ Int32 WADRreadLong(struct WADINFO *info)
{ Int32 res;
long ofs = ftell (info->fd);
if (!(info->ok&WADR_READ)) Bug("WR61", "WadRdL");
- if (wad_read_i32 (info->fd, &res))
+ if (wad_read_i32 (info->fd, &res)) {
if (ferror (info->fd))
ProgError ("WR63", "%s: read error", fnameofs (info->filename, ofs));
else
ProgError ("WR65", "%s: unexpected EOF", fnameofs (info->filename, ofs));
+ }
return res;
}
@@ -489,7 +492,7 @@ char *WADRreadEntry2 (struct WADINFO *in
buffer = Malloc (size);
WADRseek (info, start);
actual_size = WADRreadBytes2 (info, buffer, size);
- if (actual_size < size)
+ if (actual_size < size) {
if (ferror (info->fd))
ProgError ("WR78", "%s: Lump %s: read error at byte %ld",
fnameofs (info->filename, start + actual_size),
@@ -500,6 +503,7 @@ char *WADRreadEntry2 (struct WADINFO *in
fnameofs (info->filename, start + actual_size),
lump_name (info->dir[n].name),
(long) actual_size);
+ }
*psize = actual_size;
return buffer;
}

35
deutex-init-stdfp.diff Normal file
View File

@ -0,0 +1,35 @@
From: Jan Engelhardt <jengelh@medozas.de>
Date: 2010-08-23 12:14:04 +0200
Stderr needs to be initialized first, otherwise ProgError will
crash when called from a check_types that does detect a size
mismatch.
---
src/deutex.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: deutex-4.4.902/src/deutex.c
===================================================================
--- deutex-4.4.902.orig/src/deutex.c
+++ deutex-4.4.902/src/deutex.c
@@ -975,9 +975,6 @@ int main (int argc, char *argv_non_const
"\t+------------------------------------+\n\n");
#endif
- /* Sanity checks */
- check_types ();
-
/*
** default parameters
*/
@@ -1017,6 +1014,9 @@ int main (int argc, char *argv_non_const
PrintInit(FALSE);
PrintVerbosity(2);
+ /* Sanity checks */
+ check_types();
+
/* Do a second pass through argv to catch options like --help that
shouldn't cause the creation of a log file. */
{

31
deutex-proto.diff Normal file
View File

@ -0,0 +1,31 @@
From: Jan Engelhardt <jengelh@medozas.de>
src/deutex.c:108:1: warning: function declaration is not a prototype
src/deutex.c:1611:13: warning: function declaration is not a prototype
---
src/deutex.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: deutex-4.4.902/src/deutex.c
===================================================================
--- deutex-4.4.902.orig/src/deutex.c
+++ deutex-4.4.902/src/deutex.c
@@ -105,7 +105,7 @@ const char *logfile
static char anon[1] = { '\0' };
typedef void (*comfun_t) (int argc, const char *argv[]);
-static void opt_widths ();
+static void opt_widths (void);
static int is_prefix (const char *s1, const char *s2);
static void call_opt (comfun_t func, ...);
@@ -1608,7 +1608,7 @@ void COMmanopt(int argc, const char *arg
/*
* opt_widths - make a pass through Com and compute widths per section
*/
-static void opt_widths ()
+static void opt_widths (void)
{
comdef_t *d;
comdef_t *current_section = NULL;

23
deutex-soundbuf.diff Normal file
View File

@ -0,0 +1,23 @@
From: Jan Engelhardt <jengelh@medozas.de>
I: Statement might potentially overflow a destination buffer, where a size
larger than the actual buffer was specified
E: deutex destbufferoverflow src/sound.c:315:11
---
src/sound.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: deutex-4.4.902/src/sound.c
===================================================================
--- deutex-4.4.902.orig/src/sound.c
+++ deutex-4.4.902/src/sound.c
@@ -312,7 +312,7 @@ char *SNDloadVocFile(char *file, Int32
ProgError("VR12", "%s: bad magic", fname (file));
if(fseek(fp,headv.block1,SEEK_SET))
ProgError("VR13", "%s: bad header", fname (file));
- if(fread(&blockv,sizeof(struct VOCHEAD),1,fp)!=1)
+ if(fread(&blockv,sizeof(struct VOCBLOCK1),1,fp)!=1)
ProgError("VR14", "%s: read error in first block", fname (file));
if(blockv.type!=1)
ProgError("VR15", "%s: first block is not sound", fname (file));

30
deutex.changes Normal file
View File

@ -0,0 +1,30 @@
-------------------------------------------------------------------
Wed Feb 22 16:47:15 UTC 2012 - jreidinger@suse.com
- add explicit buildrequires for autotools
- use license format conforming SPDX
-------------------------------------------------------------------
Tue Jun 7 20:57:13 UTC 2011 - jengelh@medozas.de
- update to deutex-4.4.902
- start specfile afresh
-------------------------------------------------------------------
Mon Aug 23 10:13:21 UTC 2010 - jengelh@medozas.de
- (imported changelog entry from non-Fedora based spec file)
* deutex-4.4.0 package
* fixed crash in check_types
* fix types such that deutex works on 64-bit
-------------------------------------------------------------------
Sat Nov 8 16:49:24 CET 2008 - prusnak@suse.cz
- fix overflows (overflow.patch)
-------------------------------------------------------------------
Sun Dec 23 09:03:00 CET 2007 - claes.backstrom@fsfe.org
- Initial package built from Fedora package (4.4.0-6)

74
deutex.spec Normal file
View File

@ -0,0 +1,74 @@
#
# spec file for package deutex
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: deutex
Version: 4.4.902
Release: 0
Group: Development/Tools/Other
Summary: WAD composer for Doom and related games
License: GPL-2.0+
Url: http://www.teaser.fr/~amajorel/deutex/
# This prerelease tarball is unfortunately not linked from the homepage,
# but referenced from
# http://doom-editing.gamehourz.com/DeuTex-release-candidate-ftopict85808.html
#Source: http://www.teaser.fr/~amajorel/deutex/fungus/deutex-4.4.902.tar.gz
Source: %name-%version.tar.xz
Patch1: deutex-automake.diff
Patch2: deutex-braces.diff
Patch3: deutex-proto.diff
Patch4: deutex-init-stdfp.diff
Patch5: deutex-soundbuf.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: xz
BuildRequires: autoconf automake libtool
Provides: deusf = %version
%description
DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can
be used to extract the lumps of a wad and save them as individual
files. Conversely, it can also build a wad from separate files. When
extracting a lump to a file, it does not just copy the raw data, it
converts it to an appropriate format (such as PPM for graphics, Sun
audio for samples, etc.). Conversely, when it reads files for
inclusion in pwads, it does the necessary conversions (for example,
from PPM to Doom picture format). In addition, DeuTex has functions
such as merging wads, etc.
%prep
%setup -q
%patch -P 1 -P 2 -P 3 -P 4 -P 5 -p1
%build
autoreconf -fi;
%configure
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags};
iconv -f iso8859-1 -t utf-8 <deutex.6 >deutex.6.new;
iconv -f iso8859-1 -t utf-8 <dtexman6.txt >dtexman6.txt.new;
mv deutex.6.new deutex.6;
mv dtexman6.txt.new dtexman6.txt;
%install
make install DESTDIR="%buildroot";
%files
%defattr(-,root,root)
%_bindir/*
%doc %_mandir/*/*
%doc dtexman6.txt CHANGES COPYING COPYING.LIB FAQ
%changelog