[game-data-packager] 01/01: fedora: make $licensedir relocatable to /usr/share/licenses
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Mon Jan 4 11:28:37 UTC 2016
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 9db19b6a5ac1fb70d27d64d2fbe759f6be5a341e
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Mon Jan 4 12:27:58 2016 +0100
fedora: make $licensedir relocatable to /usr/share/licenses
---
data/quake3.yaml | 12 ++++--------
data/rott.yaml | 8 ++++----
debian/rules | 1 +
game_data_packager/__init__.py | 4 +++-
game_data_packager/build.py | 16 ++++++++++++++--
game_data_packager/version.py | 4 ++++
tools/game-data-packager.spec | 9 ++++++++-
7 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/data/quake3.yaml b/data/quake3.yaml
index e2faf9d..3902c84 100644
--- a/data/quake3.yaml
+++ b/data/quake3.yaml
@@ -81,14 +81,10 @@ packages:
usr/lib/quake3/ta/missionpack/pak2.pk3: $install_to/missionpack/pak2.pk3
usr/lib/quake3/ta/missionpack/pak3.pk3: $install_to/missionpack/pak3.pk3
# let mix win & linux html documentation
- usr/share/doc/quake3-data/Help/BotCommands.htm:
- usr/share/doc/quake3-data/Help/BotCommands.html
- usr/share/doc/quake3-data/Help/Dedicated Server.htm:
- usr/share/doc/quake3-data/Help/DedicatedServer.html
- usr/share/doc/quake3-data/Help/Index.htm:
- usr/share/doc/quake3-data/Help/Index.html
- usr/share/doc/quake3-data/Help/Readme.htm:
- usr/share/doc/quake3-data/Help/Readme.html
+ $docdir/Help/BotCommands.htm: $docdir/Help/BotCommands.html
+ $docdir/Help/Dedicated Server.htm: $docdir/Help/DedicatedServer.html
+ $docdir/Help/Index.htm: $docdir/Help/Index.html
+ $docdir/Help/Readme.htm: $docdir/Help/Readme.html
install_to: usr/share/games/quake3-data
install:
- baseq3/pak0.pk3
diff --git a/data/rott.yaml b/data/rott.yaml
index db108fb..953c16e 100644
--- a/data/rott.yaml
+++ b/data/rott.yaml
@@ -49,7 +49,7 @@ packages:
debian:
depends: rott-data
url_misc: https://3drealms.com/catalog/rise-triad-dark-war_44/
- install_to: usr/share/games/rott
+ install_to: $assets/rott
install:
- any_registered_rtc
- DARKWAR.RTL
@@ -64,12 +64,12 @@ packages:
longname: "Extreme Rise of the Triad"
description: |
Use the 'rott-commercial -filertl extreme.rtl' command to play this game.
- install_to: usr/share/games/rott
+ install_to: $assets/rott
install:
- EXTREME.RTL
symlinks:
- usr/share/doc/rott-extreme-data/LICENSE.TXT:
- usr/share/doc/rott-registered-data/LICENSE.TXT
+ $licensedir/LICENSE.TXT:
+ $LICENSEDIR/rott-registered-data/LICENSE.TXT
files:
any_registered_rtc:
diff --git a/debian/rules b/debian/rules
index e0cdddb..1b99807 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,6 +32,7 @@ override_dh_install:
echo 'FORMAT = "deb"' >> debian/game-data-packager/usr/share/games/game-data-packager/game_data_packager/version.py
echo 'DISTRO = "generic"' >> debian/game-data-packager/usr/share/games/game-data-packager/game_data_packager/version.py
echo 'BINDIR = "usr/games"' >> debian/game-data-packager/usr/share/games/game-data-packager/game_data_packager/version.py
+ echo 'LICENSEDIR = "usr/share/doc"' >> debian/game-data-packager/usr/share/games/game-data-packager/game_data_packager/version.py
echo 'ASSETS = "usr/share/games"' >> debian/game-data-packager/usr/share/games/game-data-packager/game_data_packager/version.py
if dpkg-vendor --derives-from Ubuntu; then \
touch debian/game-data-packager/usr/share/games/game-data-packager/is-ubuntu-derived; \
diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index 94d780a..43af8b5 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -90,8 +90,10 @@ class WantedFile(HashedFile):
def install_to(self):
if self._install_to is not None:
return self._install_to
- if self.doc or self.license:
+ if self.doc:
return '$docdir'
+ if self.license:
+ return '$licensedir'
return None
@install_to.setter
def install_to(self, value):
diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 8c59890..4df2537 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -58,7 +58,7 @@ from .util import (AGENT,
rm_rf,
recursive_utime,
which)
-from .version import (ASSETS, BINDIR, FORMAT, DISTRO)
+from .version import (ASSETS, BINDIR, LICENSEDIR, FORMAT, DISTRO)
if FORMAT == 'deb':
from debian.deb822 import Deb822
@@ -1329,7 +1329,7 @@ class PackagingTask(object):
if not f.license:
continue
license_file = f.install_as
- licenses.add("/usr/share/doc/%s/%s" % (package.name, license_file))
+ licenses.add("/%s/%s/%s" % (LICENSEDIR, package.name, license_file))
if os.path.splitext(license_file)[0].lower() == 'license':
lintian_license(destdir, package.name, license_file)
@@ -1362,6 +1362,8 @@ class PackagingTask(object):
install_to = f.install_to
if install_to and install_to.startswith('$docdir'):
count_doc +=1
+ elif install_to and install_to.startswith('$licensedir'):
+ pass
else:
count_usr +=1
# doesn't have to be a .wad, ROTT's EXTREME.RTL
@@ -1515,6 +1517,8 @@ class PackagingTask(object):
docdir = os.path.join(destdir, 'usr/share/doc', package.name)
mkdir_p(docdir)
+ # only create licensedir if needed
+ licensedir = os.path.join(destdir, LICENSEDIR, package.name)
shutil.copyfile(os.path.join(DATADIR, 'changelog.gz'),
os.path.join(docdir, 'changelog.gz'))
@@ -1553,6 +1557,10 @@ class PackagingTask(object):
if install_to.startswith('$docdir'):
install_to = 'usr/share/doc/%s%s' % (package.name,
install_to[7:])
+ if install_to.startswith('$licensedir'):
+ mkdir_p(licensedir)
+ install_to = '%s/%s%s' % (LICENSEDIR, package.name,
+ install_to[11:])
copy_to = os.path.join(destdir, install_to, install_as)
copy_to_dir = os.path.dirname(copy_to)
@@ -1577,11 +1585,15 @@ class PackagingTask(object):
assets=ASSETS,
bindir=BINDIR,
docdir=docdir,
+ LICENSEDIR=LICENSEDIR,
+ licensedir=licensedir,
install_to=package.install_to)
real_file = string.Template(real_file).safe_substitute(
assets=ASSETS,
bindir=BINDIR,
docdir=docdir,
+ LICENSEDIR=LICENSEDIR,
+ licensedir=licensedir,
install_to=package.install_to)
toplevel, rest = symlink.split('/', 1)
diff --git a/game_data_packager/version.py b/game_data_packager/version.py
index a352d13..1de0a50 100644
--- a/game_data_packager/version.py
+++ b/game_data_packager/version.py
@@ -10,6 +10,7 @@ if os.path.isfile('/etc/debian_version'):
DISTRO = 'generic'
BINDIR = 'usr/games'
ASSETS = 'usr/share/games'
+ LICENSEDIR = 'usr/share/doc'
from debian.changelog import Changelog
cl = Changelog(open('debian/changelog', encoding='utf-8'), strict=False)
@@ -20,6 +21,7 @@ elif os.path.isfile('/etc/redhat-release'):
DISTRO = 'fedora'
BINDIR = 'usr/bin'
ASSETS = 'usr/share'
+ LICENSEDIR = 'usr/share/licenses'
cl = open('debian/changelog', encoding='utf-8').readline()
GAME_PACKAGE_VERSION = cl.split('(')[1].split(')')[0]
@@ -29,6 +31,7 @@ elif os.path.isfile('/etc/SuSE-release'):
DISTRO = 'suse'
BINDIR = 'usr/bin'
ASSETS = 'usr/share'
+ LICENSEDIR = 'usr/share/licenses'
cl = open('debian/changelog', encoding='utf-8').readline()
GAME_PACKAGE_VERSION = cl.split('(')[1].split(')')[0]
@@ -38,6 +41,7 @@ elif os.path.isfile('/etc/arch-release'):
DISTRO = 'arch'
BINDIR = 'usr/bin'
ASSETS = 'usr/share'
+ LICENSEDIR = 'usr/share/doc'
cl = open('debian/changelog', encoding='utf-8').readline()
GAME_PACKAGE_VERSION = cl.split('(')[1].split(')')[0]
diff --git a/tools/game-data-packager.spec b/tools/game-data-packager.spec
index 6cef900..21936d3 100644
--- a/tools/game-data-packager.spec
+++ b/tools/game-data-packager.spec
@@ -8,7 +8,7 @@
Name: game-data-packager
Version: 44
-Release: 0.2%{?gver}
+Release: 0.3%{?gver}
Summary: Installer for game data files
License: GPLv2 and GPLv2+
Url: https://wiki.debian.org/Games/GameDataPackager
@@ -77,6 +77,7 @@ echo 'GAME_PACKAGE_VERSION = """%{version}"""' >> $VERSION_PY
echo 'FORMAT = "rpm"' >> $VERSION_PY
echo 'DISTRO = "fedora"' >> $VERSION_PY
echo 'BINDIR = "usr/bin"' >> $VERSION_PY
+echo 'LICENSEDIR = "usr/share/licenses"' >> $VERSION_PY
echo 'ASSETS = "usr/share"' >> $VERSION_PY
rm $RPM_BUILD_ROOT/usr/share/games/game-data-packager/game_data_packager/util_arch.py
rm $RPM_BUILD_ROOT/usr/share/games/game-data-packager/game_data_packager/util_deb.py
@@ -103,6 +104,12 @@ find $RPM_BUILD_ROOT/etc/game-data-packager -empty -exec sh -c "echo '# we need
%license COPYING
%changelog
+* Sat Jan 02 2016 Alexandre Detiste <alexandre.detiste at gmail.com> - 44-0.3.git2016 unreleased
+- Git Snapshot
+- Add Cacodemon icon to doom2-masterlevels subpackage
+- The (optional) licenses of generated .rpm goes now correctly to /usr/share/licenses
+ instead of /usr/share/doc
+
* Thu Dec 31 2015 Alexandre Detiste <alexandre.detiste at gmail.com> - 44-0.2.git2015123150f64b6
- Git Snapshot
- Enable checks
--
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