[game-data-packager] 06/08: quake: generate control files for Python/YAML mode
Simon McVittie
smcv at debian.org
Wed Jan 14 00:38:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch master
in repository game-data-packager.
commit e22a0b05ad349ba2c187d9fcf449b245ebeea3de
Author: Simon McVittie <smcv at debian.org>
Date: Wed Jan 14 00:27:28 2015 +0000
quake: generate control files for Python/YAML mode
---
.../control.in => data/quake-common.control.in | 0
lib/game_data_packager/games/quake.py | 25 ++++++++++++++++++++++
quake.mk | 10 ++++-----
3 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/quake-common/DEBIAN/control.in b/data/quake-common.control.in
similarity index 100%
rename from quake-common/DEBIAN/control.in
rename to data/quake-common.control.in
diff --git a/lib/game_data_packager/games/quake.py b/lib/game_data_packager/games/quake.py
index dbff6ce..bffb998 100644
--- a/lib/game_data_packager/games/quake.py
+++ b/lib/game_data_packager/games/quake.py
@@ -19,6 +19,7 @@ import logging
import os
from .. import GameData
+from ..paths import DATADIR
from ..util import TemporaryUmask, mkdir_p
logger = logging.getLogger('game-data-packager.games.quake')
@@ -30,6 +31,30 @@ class QuakeGameData(GameData):
not to be a shell script.
"""
+ def get_control_template(self, package):
+ for name in (package.name, 'quake-common'):
+ path = os.path.join(DATADIR, '%s.control.in' % name)
+ if os.path.exists(path):
+ return path
+ else:
+ raise AssertionError('quake-common.control.in should exist')
+
+ def modify_control_template(self, control, package, destdir):
+ super(QuakeGameData, self).modify_control_template(control, package,
+ destdir)
+
+ desc = control['Description']
+ desc = desc.replace('LONG', (package.longname or self.longname))
+ control['Description'] = desc
+
+ if package.name == 'quake-registered':
+ control['Conflicts'] = 'quake-shareware'
+ control['Replaces'] = 'quake-shareware'
+ elif package.name == 'quake-shareware':
+ control['Conflicts'] = 'quake-registered'
+ else:
+ control['Depends'] = 'quake-registered'
+
def fill_extra_files(self, package, destdir):
super(QuakeGameData, self).fill_extra_files(package, destdir)
diff --git a/quake.mk b/quake.mk
index 1c4c7a9..1c09ddb 100644
--- a/quake.mk
+++ b/quake.mk
@@ -4,12 +4,12 @@ srcdir = $(CURDIR)
builddir = $(CURDIR)/build
outdir = $(CURDIR)/out
+all: do-$(PACKAGE)
+
QUAKEDEB = $(outdir)/$(PACKAGE)_$(VERSION)_all.deb
ifeq ($(filter-out quake-music quake-%-music,$(PACKAGE)),)
-all: do-$(PACKAGE)
-
do-${PACKAGE}: do-common
install -m644 data/quake-music.copyright ${outdir}/${PACKAGE}.copyright
( \
@@ -30,7 +30,7 @@ clean:
else
-do-${PACKAGE}: ${outdir}/${PACKAGE}.copyright
+do-${PACKAGE}: ${outdir}/${PACKAGE}.copyright $(QUAKEDEB)
$(QUAKEDEB): \
$(builddir)/$(PACKAGE)/DEBIAN/md5sums \
@@ -67,10 +67,10 @@ $(builddir)/$(PACKAGE)/usr/share/doc/$(PACKAGE)/copyright: quake-common/copyrigh
install -d `dirname $@`
m4 -DPACKAGE=$(PACKAGE) quake-common/copyright.in > $@
-$(builddir)/$(PACKAGE)/DEBIAN/control: quake-common/DEBIAN/control.in
+$(builddir)/$(PACKAGE)/DEBIAN/control: data/quake-common.control.in
install -d `dirname $@`
m4 -DVERSION=$(VERSION) -DPACKAGE=$(PACKAGE) -DLONG="$(LONG)" \
- < quake-common/DEBIAN/control.in > $@
+ < $< > $@
if [ "$(PACKAGE)" = "quake-registered" ]; then \
echo Conflicts: quake-shareware >> $@; \
echo Replaces: quake-shareware >> $@; \
--
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