Hi,

After digging in /usr/lib/game-data-packager/game-data-packager-shared ,
I found that gdp_unzip() is deprecated and when working archive with
subfolders; his behaviour depends on installed packages (unzip versus
7zip).

So "it works for me" because I have 7zip installed.

Here is a new patch using new function "gdp_unzip_paths()", this
should work for everybody. I tested it with all three avaible
unzippers.



2014-02-19 17:32 GMT+01:00 Etienne Millon <m...@emillon.org>:
> Hi,
>
> After applying this patch I to run "game-data-packager tyrian -w" and
> got the following error:
>
>> 2014-02-19 17:26:04 (1.10 MB/s) -
>> '/tmp/game-data-packager.f61l7L/tyrian21.zip' saved
>> [4754048/4754048]
>>
>> rm: cannot remove '*.exe': No such file or directory rmdir: failed
>> to remove '/tmp/game-data-packager.f61l7L': Directory not empty
>
> I presume that's because you're in the wrong directory at:
>
>> +    gdp_unzip "$ZIPFILE"
>> +    rm *.exe
>> +    rm *.ovl
>> +    rmdir tyrian21
>
> (the rmdir is suspicious, too)
>
> Thanks for your work!
>
> --
> Etienne Millon
diff -Naur game-data-packager-37/debian/control game-data-packager-tyrian/debian/control
--- game-data-packager-37/debian/control	2013-11-18 20:32:13.000000000 +0100
+++ game-data-packager-tyrian/debian/control	2014-02-19 09:27:35.148265180 +0100
@@ -25,6 +25,7 @@
 # for lgeneral
 	lgc-pg
 Architecture: all
+Multi-Arch: foreign
 Description: Installer for game data files
  Various games are divided into two logical parts: engine
  and data. Often the engine and data are licensed in
@@ -37,5 +38,5 @@
  .
  At the moment, game-data-packager has support for building .deb
  files for Doom games (Doom, Doom II and Final Doom); LGeneral;
- Heretic; Hexen; Hexen II; Rise of the Triad; Quake; Quake II;
- Quake III Arena and Wolfenstein 3D.
+ Heretic; Hexen; Hexen II; Rise of the Triad; Tyrian; Quake; 
+ Quake II; Quake III Arena and Wolfenstein 3D.
diff -Naur game-data-packager-37/lib/tyrian-mirrors game-data-packager-tyrian/lib/tyrian-mirrors
--- game-data-packager-37/lib/tyrian-mirrors	1970-01-01 01:00:00.000000000 +0100
+++ game-data-packager-tyrian/lib/tyrian-mirrors	2014-02-20 21:44:10.796639561 +0100
@@ -0,0 +1,2 @@
+http://www.camanis.net/tyrian/tyrian21.zip
+#http://localhost/tyrian21.zip
diff -Naur game-data-packager-37/Makefile game-data-packager-tyrian/Makefile
--- game-data-packager-37/Makefile	2013-11-18 20:32:13.000000000 +0100
+++ game-data-packager-tyrian/Makefile	2014-02-17 12:38:51.577924881 +0100
@@ -42,6 +42,7 @@
 	make -f rott.mk VERSION=$(VERSION)
 	make -f wolf3d.mk VERSION=$(VERSION)
 	make -f lgeneral.mk LONG="LGeneral" VERSION=$(VERSION)
+	make -f tyrian.mk VERSION=$(VERSION)
 
 $(DIRS):
 	mkdir -p $@
@@ -88,6 +89,7 @@
 	make -f rott.mk VERSION=$(VERSION) clean
 	make -f wolf3d.mk VERSION=$(VERSION) clean
 	make -f lgeneral.mk LONG="LGeneral" VERSION=$(VERSION) clean
+	make -f tyrian.mk VERSION=$(VERSION) clean
 	for d in $(DIRS); do [ ! -d "$$d" ]  || rmdir "$$d"; done
 
 check:
diff -Naur game-data-packager-37/supported/tyrian game-data-packager-tyrian/supported/tyrian
--- game-data-packager-37/supported/tyrian	1970-01-01 01:00:00.000000000 +0100
+++ game-data-packager-tyrian/supported/tyrian	2014-02-20 21:38:09.052624533 +0100
@@ -0,0 +1,127 @@
+SHORTNAME=tyrian
+LONGNAME="Tyrian"
+
+ZIPSUM=2a3b206a6de25ed4b771af073f8ca904
+
+tyrian_usage() {
+	echo "game-data-packager ${SHORTNAME} arguments:"
+	printf "\tgame-data-packager ${SHORTNAME} [ -f path ] | [ -w ]
+\t\t-f path\t\tpath to your existing copy of tyrian21.zip\n\
+\t\t-w\t\tfetch tyrian21.zip from the World Wide Web\n"
+}
+
+verify_args() {
+    case $# in
+        0)
+            tyrian_usage
+            exit 0
+            ;;
+        1)
+            if [ "$1" != "-w" ]; then
+                    usage >&2
+                    tyrian_usage >&2
+                    exit 1
+            fi
+            downloadzip
+            ;;
+        2)
+            if [ "$1" != "-f" ]; then
+                usage >&2
+                tyrian_usage >&2
+                exit 1
+            fi
+            downloaded=false
+            tyrianzip="$2"
+            ;;
+        *)
+            usage >&2
+            tyrian_usage >&2
+            exit 1
+            ;;
+    esac
+}
+
+tyrianmirrors=$LIBDIR/tyrian-mirrors
+
+downloadzip() {
+    dest="$WORKDIR/tyrian21.zip"
+    mirror=$(grep -v ^# "$tyrianmirrors" | sort -R | head -n1)
+    for try in $mirror; do
+        if wget --progress=dot --directory-prefix "$WORKDIR" -c "$try"
+        then
+            tyrianzip="$dest"
+            downloaded=true
+            return
+        fi
+    done
+    die "error: could not find tyrian21.zip at our chosen mirror"
+}
+
+checksum() {
+	CHECKSUM=`md5sum "$1" | cut -d' ' -f1`
+	debug "checksum = $CHECKSUM"
+}
+
+DEBBASE="tyrian-data_${GAME_PACKAGE_VERSION}_all.deb"
+DEB="$DATADIR/$DEBBASE"
+
+go() {
+	verify_args "$@"
+	ZIPFILE=`unravel "$tyrianzip"`
+    [ -e "$ZIPFILE" ] || die "ERROR: '$ZIPFILE' does not exist."
+    [ -f "$ZIPFILE" ] || die "ERROR: '$ZIPFILE' is not a file."
+    [ -r "$ZIPFILE" ] || die "ERROR: '$ZIPFILE' cannot be read."
+	checksum "$ZIPFILE"
+	if [ "$CHECKSUM" != "$ZIPSUM" ]; then
+		echo "warning: checksum is not what we expected" >&2
+	fi
+
+    OUTFILE=`unravel "$OUTDIR"`"/$DEBBASE"
+	cp -p "$DEB" "$OUTFILE"
+
+	oldpwd=`pwd`
+	cd "$WORKDIR"
+
+files='cubetxt1.dat cubetxt2.dat cubetxt3.dat cubetxt4.dat
+demo.1 demo.2 demo.3 demo.4 demo.5 
+estsc.shp exitmsg.bin file_id.diz helpme.doc
+levels1.dat levels2.dat levels3.dat levels4.dat
+license.doc loudness.awe
+manual.doc modems.txt music.mus
+netarena.pcx netfont1.pcx netfont2.pcx netmega.pcx netset.pcx netterm.int
+newsh0.shp newsh1.shp newsh2.shp newsh3.shp newsh4.shp newsh5.shp 
+newsh6.shp newsh7.shp newsh8.shp newsh9.shp newsha.shp newshb.shp newshc.shp
+newshd.shp newshe.shp newshf.shp newshg.shp newshh.shp newshi.shp newshj.shp 
+newshk.shp newshl.shp newshm.shp newshn.shp newsho.shp newshp.shp newshr.shp
+newsh^.shp newsh~.shp newsh#.shp newshs.shp newsht.shp newshu.shp newshv.shp
+order.doc order.tfp palette.dat
+setup.box setup.ini setup.int
+shapes).dat shapesw.dat shapesx.dat shapesy.dat shapesz.dat 
+shipedit.doc shipedit.pcx
+tshp2.pcx tyrend.anm tyrian1.lvl tyrian2.lvl tyrian3.lvl tyrian4.lvl 
+tyrian.cdt tyrianc.shp tyrian.hdt tyrian.ico tyrian.pic tyrian.shp tyrian.snd tyrset.pcx
+user1.shp user2.shp voicesc.snd voices.snd'
+
+    gdp_unzip_paths "$ZIPFILE" .
+    cd tyrian21
+    rm *.exe
+    rm *.ovl
+    slipstream_permcheck "$OUTFILE"
+    slipstream_unpack "$OUTFILE"
+    for file in $files; do
+        slipstream_file "$file" "usr/share/games/tyrian/$file"
+    done
+    slipstream_instsize
+    slipstream_repack "$OUTFILE"
+    slipstream_cleanup
+
+    rm $files
+    cd ..
+    rmdir tyrian21
+
+    if [ "$downloaded" = "true" ]; then
+        rm "$ZIPFILE"
+    fi
+
+	cd "$oldpwd"
+}
diff -Naur game-data-packager-37/tyrian-data/control.in game-data-packager-tyrian/tyrian-data/control.in
--- game-data-packager-37/tyrian-data/control.in	1970-01-01 01:00:00.000000000 +0100
+++ game-data-packager-tyrian/tyrian-data/control.in	2014-02-19 09:27:59.688266200 +0100
@@ -0,0 +1,14 @@
+Package: tyrian-data
+Provides: tyrian-data
+Section: non-free/games
+Priority: optional
+Architecture: all
+Multi-Arch: foreign
+Recommends: opentyrian
+Installed-Size: 56
+Version: VERSION
+Maintainer: Debian Games Team <pkg-games-de...@lists.alioth.debian.org>
+Description: Game data for OpenTyrian
+ OpenTyrian requires game data to play. This package contains
+ the game data from the shareware episode of OpenTyrian and
+ was generated using the "game-data-packager" program.
diff -Naur game-data-packager-37/tyrian-data/copyright game-data-packager-tyrian/tyrian-data/copyright
--- game-data-packager-37/tyrian-data/copyright	1970-01-01 01:00:00.000000000 +0100
+++ game-data-packager-tyrian/tyrian-data/copyright	2014-02-17 12:36:28.000000000 +0100
@@ -0,0 +1,20 @@
+The tyrian-data package was generated using game-data-packager.
+Copyright © 2014 Alexandre Detiste <alexandre.deti...@gmail.com>.
+
+The files within "/usr/share/games/tyrian" are subject to the copyright
+described in /usr/share/doc/tyrian-data/license.doc.
+
+The remainder of this package is covered by the following
+Licence:
+
+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; version 2 of the License.
+
+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.
+
+On Debian GNU/Linux systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL-2.
diff -Naur game-data-packager-37/tyrian-data/README.Debian game-data-packager-tyrian/tyrian-data/README.Debian
--- game-data-packager-37/tyrian-data/README.Debian	1970-01-01 01:00:00.000000000 +0100
+++ game-data-packager-tyrian/tyrian-data/README.Debian	2014-02-17 12:33:32.000000000 +0100
@@ -0,0 +1,4 @@
+This package was generated by the game-data-packager program, to facilitate
+installation of the OpenTyrian (tyrian) data files into a Debian system.
+
+ -- Alexandre Detiste <alexandre.deti...@gmail.com>, Mon, 17 Feb 2014 12:22:22 +0000
diff -Naur game-data-packager-37/tyrian.mk game-data-packager-tyrian/tyrian.mk
--- game-data-packager-37/tyrian.mk	1970-01-01 01:00:00.000000000 +0100
+++ game-data-packager-tyrian/tyrian.mk	2014-02-17 13:02:53.609984789 +0100
@@ -0,0 +1,34 @@
+BASICFILES = usr/share/doc/tyrian-data/README.Debian \
+usr/share/doc/tyrian-data/copyright
+DESTFILES = $(addprefix build/tyrian-data/, $(BASICFILES))
+
+# VERSION is defined by the parent make
+out/tyrian-data_$(VERSION)_all.deb: build/tyrian-data/DEBIAN/control $(DESTFILES)
+		fakeroot dpkg-deb -b build/tyrian-data $@
+
+DIRS = build/tyrian-data \
+build/tyrian-data/DEBIAN \
+build/tyrian-data/usr \
+build/tyrian-data/usr/share \
+build/tyrian-data/usr/share/games \
+build/tyrian-data/usr/share/games/tyrian \
+build/tyrian-data/usr/share/doc \
+build/tyrian-data/usr/share/doc/tyrian-data
+
+$(DIRS):
+	mkdir $@
+
+$(DESTFILES): $(DIRS)
+	cp -p tyrian-data/`basename "$@"` $@
+
+build/tyrian-data/DEBIAN/control: tyrian-data/control.in $(DIRS)
+	m4 -DPACKAGE=tyrian-data -DVERSION=$(VERSION) $< > $@ 
+
+clean:
+	rm -f build/tyrian-data/DEBIAN/control out/tyrian-data_$(VERSION)_all.deb \
+		build/tyrian-data/usr/share/doc/tyrian-data/copyright \
+		build/tyrian-data/usr/share/doc/tyrian-data/README.Debian
+	for d in $(DIRS); do echo "$$d"; done | sort -r | while read d; do \
+		[ ! -d "$$d" ] || rmdir "$$d"; done
+
+.PHONY: clean $(DESTFILES)

Reply via email to