[game-data-packager] 01/01: text games: provide launcher script in /usr/games when using frotz
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Tue May 5 08:49:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
detiste-guest pushed a commit to branch master
in repository game-data-packager.
commit 7d5580d4c387acd6e00602956435f0f655ead8d2
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Tue May 5 10:48:35 2015 +0200
text games: provide launcher script in /usr/games when using frotz
---
game_data_packager/games/quake.py | 2 +-
game_data_packager/games/z_code.py | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/game_data_packager/games/quake.py b/game_data_packager/games/quake.py
index 9eb1998..ab8682a 100644
--- a/game_data_packager/games/quake.py
+++ b/game_data_packager/games/quake.py
@@ -64,7 +64,7 @@ class QuakeGameData(GameData):
quakedir = os.path.join(destdir, 'usr/share/games/quake')
mkdir_p(quakedir)
path = os.path.join(quakedir, detector)
- with open(os.path.join(quakedir, detector), 'w') as f:
+ with open(path, 'w') as f:
f.write('#!/bin/sh\nexit 0\n')
os.chmod(path, 0o755)
diff --git a/game_data_packager/games/z_code.py b/game_data_packager/games/z_code.py
index 9ab3deb..d7aac1f 100644
--- a/game_data_packager/games/z_code.py
+++ b/game_data_packager/games/z_code.py
@@ -79,4 +79,16 @@ class ZCodeGameData(GameData):
'usr/share/applications/%s.desktop %s\n'
% (package.name, package.name, engine))
+ if engine == 'frotz':
+ bindir = os.path.join(destdir, 'usr/games')
+ mkdir_p(bindir)
+ pgm = package.name[0:len(package.name)-len('-data')]
+ path = os.path.join(bindir, pgm)
+ with open(path, 'w') as f:
+ f.write('#!/bin/sh\n')
+ f.write('test -x /usr/games/frotz && exec frotz $@ %s\n' % arg)
+ f.write('echo "You need to install some engine '
+ 'like frotz to play this game"\n')
+ os.chmod(path, 0o755)
+
GAME_DATA_SUBCLASS = ZCodeGameData
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git
More information about the Pkg-games-commits
mailing list