[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#553035: willing to help



Hi,

For me, game-data-packager is the way to go to keep everything uniform.
Here is a patch adding tyrian to game-data-packager version 37.

It currently only recommends "opentyrian",
so this can be compiled manually.


 Makefile                  |    2 
 lib/tyrian-mirrors        |    1 
 supported/tyrian          |  126 
++++++++++++++++++++++++++++++++++++++++++++++
 tyrian-data/README.Debian |    4 +
 tyrian-data/control.in    |   13 ++++
 tyrian-data/copyright     |   20 +++++++
 tyrian.mk                 |   34 ++++++++++++
 7 files changed, 200 insertions(+)


Sample output:

tchet@legacy:~$ game-data-packager tyrian
game-data-packager tyrian arguments:
        game-data-packager tyrian [ -f path ] | [ -w ]
                -f path         path to your existing copy of tyrian21.zip
                -w              fetch tyrian21.zip from the World Wide Web
tchet@legacy:~$ 
tchet@legacy:~/game-data-packager-tyrian$ ./game-data-packager tyrian -f 
../tyrian21.zip 
generated "/home/tchet/game-data-packager-tyrian/tyrian-data_37_all.deb".


Alexandre Detiste


Le jeudi 13 février 2014, 19:46:35 Etienne Millon a écrit :
> * Alexandre Detiste <alexandre.detiste@gmail.com> [140129 09:24]:
> > I use this game and I'm willing to help.
> 
> Hi,
> 
> Unfortunately not a lot has changed since my last message. Due to the
> non-redistributability of opentyrian-data, it's impossible to create a
> source package for it. 

This is precisely the role of game-data-packager.

> For the moment I created an open-tyrian binary
> package that installs the data files to
> /usr/share/games/opentyrian/data. The zip can be found at the
> following URL:
> 
> http://www.camanis.net/tyrian/tyrian21.zip
> 
> However it's not possible as is. This zip file should be downloaded
> and unpacked during postinst to somewhere in /var (cache or lib). It
> is also possible to do this before launching the game somewhere in
> $HOME. The latter is probably better as it avoids to download as root.
> 
> In the meantime, if you want to test, you can remove the dependency
> and launch the game in a directory where data/ contains game data (see
> src/file.c).
> 
> For the actual download code, I don't know if it's possible to use
> game-data-packager, but it's always possible to roll our own solution,
> à la flashplugin-nonfree.
> 
> In the meantime, I refreshed my packaging, fixed a few
> warnings and pushed my package to the following URL:
> 
> git+ssh://git.debian.org/git/pkg-games/opentyrian.git

I got the code form elsewhere, but it works 
fine the data .deb from G-D-P.

#!/bin/sh
#hg clone https://code.google.com/p/opentyrian/
cd /home/tchet/bin/opentyrian
hg update

 
> As you can see your help is welcome :)
> 
> You can add yourself to Uploaders and help fix the remaining lintian
> warnings, do the copyright review (should be OK), and/or of course
> find a solution for the data files :)
> 
> If it's your first package I'll be happy to help you.
> 
> Please let me know what you're interested in.
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,13 @@
+Package: tyrian-data
+Provides: tyrian-data
+Section: non-free/games
+Priority: optional
+Architecture: all
+Recommends: opentyrian
+Installed-Size: 56
+Version: VERSION
+Maintainer: Debian Games Team <pkg-games-devel@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 -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 <alexandre.detiste@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 -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 <alexandre.detiste@gmail.com>, 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 to: