[game-data-packager] 01/01: version.py: factor-out & automate fixup of this file
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Mon Jan 11 22:23:30 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 cec47bfb6fc7a0a34600d9d6706f4b48176bcba6
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Mon Jan 11 23:22:58 2016 +0100
version.py: factor-out & automate fixup of this file
---
Makefile | 1 +
debian/rules | 3 ---
game_data_packager/version.py | 5 +++++
tools/game-data-packager.spec | 5 -----
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index e9639c7..c4c96e7 100644
--- a/Makefile
+++ b/Makefile
@@ -118,6 +118,7 @@ install:
mkdir -p $(DESTDIR)/usr/share/games/game-data-packager
cp -ar game_data_packager/ $(DESTDIR)/usr/share/games/game-data-packager/
+ python3 -m game_data_packager.version > $(DESTDIR)/usr/share/games/game-data-packager/game_data_packager/version.py
install runtime/launcher.py $(DESTDIR)/usr/share/games/game-data-packager/gdp-launcher
install -m0644 runtime/*.desktop $(DESTDIR)/usr/share/games/game-data-packager/
install -m0644 out/*.copyright $(DESTDIR)/usr/share/games/game-data-packager/
diff --git a/debian/rules b/debian/rules
index 46aadb7..cd14b4b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -28,9 +28,6 @@ override_dh_auto_clean:
override_dh_install:
dh_install
- echo 'GAME_PACKAGE_VERSION = """$(DEB_VERSION)"""' > debian/game-data-packager/usr/share/games/game-data-packager/game_data_packager/version.py
- 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
if dpkg-vendor --derives-from Ubuntu; then \
touch debian/game-data-packager/usr/share/games/game-data-packager/is-ubuntu-derived; \
fi
diff --git a/game_data_packager/version.py b/game_data_packager/version.py
index e7ef868..984e7e1 100644
--- a/game_data_packager/version.py
+++ b/game_data_packager/version.py
@@ -34,3 +34,8 @@ elif os.path.isfile('/etc/SuSE-release'):
elif os.path.isfile('/etc/arch-release'):
FORMAT = 'arch'
DISTRO = 'arch'
+
+if __name__ == '__main__':
+ print('#!/usr/bin/python3')
+ for const in ('GAME_PACKAGE_VERSION', 'FORMAT', 'DISTRO'):
+ print('%s = "%s"' % (const, eval(const)))
diff --git a/tools/game-data-packager.spec b/tools/game-data-packager.spec
index 682d6af..bde5eba 100644
--- a/tools/game-data-packager.spec
+++ b/tools/game-data-packager.spec
@@ -71,11 +71,6 @@ make check
%install
make DESTDIR=$RPM_BUILD_ROOT bindir=/usr/bin install
-VERSION_PY=$RPM_BUILD_ROOT/usr/share/games/game-data-packager/game_data_packager/version.py
-echo '#!/usr/bin/python3' > $VERSION_PY
-echo 'GAME_PACKAGE_VERSION = """%{version}"""' >> $VERSION_PY
-echo 'FORMAT = "rpm"' >> $VERSION_PY
-echo 'DISTRO = "fedora"' >> $VERSION_PY
find $RPM_BUILD_ROOT/usr/share/games/game-data-packager/game_data_packager -name '*.py' -exec chmod 755 {} \;
find $RPM_BUILD_ROOT/etc/game-data-packager -empty -exec sh -c "echo '# we need more mirrors' > {}" \;
--
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