Package: game-data-packager
Version: 37
Severity: wishlist
Tags: patch

Dear Maintainer,

Please add support for Tyrian data using following patch.
The data are freely usable, but not redistribuable.

The binary will be provided by 'opentyrian' package.

Here is the ITP bug for opentyrian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=553035

This current bug report replace this one that
should then be latter closed:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628689

Alexandre Detiste
diff -rupN 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-17 11:43:45.000000000 +0100
@@ -0,0 +1 @@
+http://www.camanis.net/tyrian/tyrian21.zip
diff -rupN 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 @@ default: $(DIRS)
 	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 @@ clean:
 	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 -rupN 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-17 12:57:14.445970699 +0100
@@ -0,0 +1,126 @@
+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 "$ZIPFILE"
+    rm *.exe
+    rm *.ovl
+    rmdir tyrian21
+
+    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
+
+    if [ "$downloaded" = "true" ]; then
+        rm "$ZIPFILE"
+    fi
+
+	cd "$oldpwd"
+}
diff -rupN 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-17 12:41:18.929931002 +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 <[email protected]>
+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 -rupN 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 <[email protected]>.
+
+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 -rupN 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 <[email protected]>, Mon, 17 Feb 2014 12:22:22 +0000
Les fichiers binaires game-data-packager-37/tyrian-data_37_all.deb et game-data-packager-tyrian/tyrian-data_37_all.deb sont différents
diff -rupN 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