[SCM] Installer for game data files branch, wolf3d, updated. 80ebcfc19d02a451044aab81346457f6bb1ddd28
Jon Dowland
jmtd at debian.org
Sat Apr 30 18:12:58 UTC 2011
The following commit has been merged in the wolf3d branch:
commit 1752ccfe95a78e20e4f83a2ec7b5bb6600599764
Author: Jon Dowland <jmtd at debian.org>
Date: Wed Apr 27 14:05:45 2011 +0100
depend on/use external id-shr-extract
diff --git a/Makefile b/Makefile
index d333e36..222ea1f 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ VERSION := $(shell dpkg-parsechangelog | grep ^Version | cut -d' ' -f2-)
DIRS := ./out ./build
LDLIBS = -ldynamite
-default: $(DIRS) wolf/extract
+default: $(DIRS)
make -f doom-common.mk IWAD=doom LONG="Doom" VERSION=$(VERSION)
make -f doom-common.mk IWAD=doom2 \
LONG="Doom 2: Hell on Earth" VERSION=$(VERSION)
@@ -14,8 +14,6 @@ default: $(DIRS) wolf/extract
make -f rott.mk VERSION=$(VERSION)
make -f wolf3d.mk VERSION=$(VERSION)
-wolf/extract: wolf/extract.c
-
$(DIRS):
mkdir -p $@
@@ -31,6 +29,5 @@ clean:
make -f rott.mk VERSION=$(VERSION) clean
make -f wolf3d.mk VERSION=$(VERSION) clean
for d in $(DIRS); do [ ! -d "$$d" ] || rmdir "$$d"; done
- rm -f wolf/extract
.PHONY: default clean
diff --git a/debian/control b/debian/control
index 4c5c973..23f9dc8 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Vcs-Browser: http://git.debian.org/?p=pkg-games/game-data-packager.git
Homepage: http://wiki.debian.org/Games/GameDataPackager
Package: game-data-packager
-Depends: fakeroot, unzip | p7zip-full, ${misc:Depends}, ${shlib:Depends}
+Depends: fakeroot, unzip | p7zip-full, ${misc:Depends}, ${shlib:Depends}, dynamite (>= 0.1.1-1.1)
Conflicts: doom-package
Replaces: doom-package
Provides: doom-package
diff --git a/debian/copyright b/debian/copyright
index aacaf5a..4c955fe 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -11,7 +11,3 @@ This package is distributed under the terms of version 2 of the GNU
general public licence (GPL). On Debian systems the GNU General Public
License (GPL) version 2 is located on the filesystem at
/usr/share/common-licenses/GPL-2.
-
-The file wolf/extract.c is copyright © 2007 Hans de Goede
-<j.w.r.degoede at hhs.nl> and is distributed under the terms of version 2 of the
-GNU general public licence (GPL), or (at your option) any later version.
diff --git a/debian/game-data-packager.install b/debian/game-data-packager.install
index cd78dfd..e793bfd 100644
--- a/debian/game-data-packager.install
+++ b/debian/game-data-packager.install
@@ -15,4 +15,3 @@ out/doom2-wad_*_all.deb usr/share/games/game-data-packager
out/tnt-wad_*_all.deb usr/share/games/game-data-packager
out/plutonia-wad_*_all.deb usr/share/games/game-data-packager
out/rott-data_*_all.deb usr/share/games/game-data-packager
-wolf/extract usr/lib/game-data-packager/wolf
diff --git a/supported/wolf3d b/supported/wolf3d
index 1ec7e10..c90b91f 100644
--- a/supported/wolf3d
+++ b/supported/wolf3d
@@ -83,7 +83,7 @@ go() {
cd "$WORKDIR"
gdp_unzip "$ZIPFILE" W3DSW14.SHR
- /usr/lib/game-data-packager/wolf/extract W3DSW14.SHR >/dev/null
+ id-shr-extract W3DSW14.SHR >/dev/null
rm order.frm w3dhelp.exe W3DSW14.SHR wolf3d.exe
wlfiles="
diff --git a/wolf/extract.c b/wolf/extract.c
deleted file mode 100644
index 7b5fb65..0000000
--- a/wolf/extract.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* utility to extract the .SHR installer data files of early ID software
- shareware games
-
- Copyright (C) 2007 Hans de Goede <j.w.r.degoede at hhs.nl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <libdynamite.h>
-
-struct cookie_s {
- char *in_buffer;
- int in_buffer_remaining;
- int in_buffer_index;
- int in_buffer_size;
- FILE* out_file;
-};
-
-size_t reader(void* buffer, size_t size, void* cookie)
-{
- struct cookie_s *c = cookie;
- if (size > c->in_buffer_remaining)
- size = c->in_buffer_remaining;
-
- memcpy (buffer, c->in_buffer + c->in_buffer_index, size);
-
- c->in_buffer_index += size;
- c->in_buffer_remaining -= size;
-
- return size;
-}
-
-size_t writer(void* buffer, size_t size, void* cookie)
-{
- struct cookie_s *c = cookie;
- return fwrite(buffer, 1, size, c->out_file);
-}
-
-int main(int argc, char *argv[])
-{
- struct cookie_s cookie;
- FILE *in_file;
- char filename[16];
- unsigned char buf[4];
- int i, compressed_size;
-
- if (argc != 2) {
- fprintf(stderr, "%s: Usage: %s <filename.CHR> %d\n", argv[0], argv[0], argc);
- return 1;
- }
-
- in_file = fopen(argv[1], "r");
- if (!in_file) {
- fprintf(stderr, "error opening: %s", argv[1]);
- perror(NULL);
- return 1;
- }
-
- /* skip first 0x3A bytes header */
- if (fseek(in_file, 0x3A, SEEK_CUR)) {
- perror("error skipping initial file header");
- return 1;
- }
-
- cookie.in_buffer = malloc(65536);
- if (!cookie.in_buffer) {
- fprintf(stderr, "Error: out of memory\n");
- return 1;
- }
- cookie.in_buffer_size = 65536;
-
- while (1)
- {
- /* get the name of the file */
- if (fread(filename, 1, sizeof(filename), in_file) != sizeof(filename)) {
- if (feof(in_file)) {
- free(cookie.in_buffer);
- fclose(in_file);
- return 0; /* done */
- }
- perror("error getting output filename from file");
- return 1;
- }
-
- /* verify the filename and convert to lower case */
- for (i = 0 ; i < sizeof(filename); i++) {
- if (filename[i] == 0)
- break; /* done */
- if (!isprint(filename[i])) {
- fprintf(stderr, "error invalid output filename\n");
- return 1;
- }
- filename[i] = tolower(filename[i]);
- }
- if (i == sizeof(filename)) {
- fprintf(stderr, "error too long output filename\n");
- return 1;
- }
-
- /* seek to compressed size */
- if (fseek(in_file, 0x88 - sizeof(filename), SEEK_CUR)) {
- perror("error skipping file header before file size");
- return 1;
- }
-
- if (fread(buf, 1, 4, in_file) != 4) {
- perror("error reading file size");
- return 1;
- }
- compressed_size = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
- if (compressed_size > cookie.in_buffer_size) {
- cookie.in_buffer = realloc(cookie.in_buffer, compressed_size);
- if (!cookie.in_buffer) {
- fprintf(stderr, "Error: out of memory\n");
- return 1;
- }
- cookie.in_buffer_size = compressed_size;
- }
-
- /* seek to begin of compressed data */
- if (fseek(in_file, 0x1C, SEEK_CUR)) {
- perror("error skipping file header before file size");
- return 1;
- }
-
- /* read compressed data */
- if (fread(cookie.in_buffer, 1, compressed_size, in_file) !=
- compressed_size) {
- perror("error reading compressed data");
- return 1;
- }
-
- cookie.in_buffer_index = 0;
- cookie.in_buffer_remaining = compressed_size;
-
- cookie.out_file = fopen(filename, "w");
- if (!cookie.out_file) {
- fprintf(stderr, "Error creating: %s for writing", filename);
- perror(NULL);
- return 1;
- }
-
- printf("decompressing: %s, compressed size: %d\n", filename,
- compressed_size);
-
- if ((i = dynamite_explode(reader, writer, &cookie))) {
- fprintf(stderr, "Error: %d while decompressing\n", i);
- return i;
- }
-
- fclose(cookie.out_file);
- }
-
- /* never reached */
- return 0;
-}
--
Installer for game data files
More information about the Pkg-games-commits
mailing list