[game-data-packager] 01/01: make DATADIR relocatable

Alexandre Detiste detiste-guest at moszumanska.debian.org
Tue Jan 12 09:03:15 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 fb6c0c6fd7cd108b61aab714603f171944880100
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Tue Jan 12 10:02:47 2016 +0100

    make DATADIR relocatable
---
 Makefile                      | 30 +++++++++++++++---------------
 game_data_packager/paths.py   |  5 ++++-
 run                           |  4 +++-
 tools/game-data-packager.spec |  2 +-
 4 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index c4c96e7..36da072 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
 GDP_MIRROR ?= localhost
 bindir := /usr/games
+datadir := /usr/share/games
 PYTHON := python3
 PYFLAKES3 := $(shell if [ -x /usr/bin/pyflakes3 ] ;  then echo pyflakes3 ; \
                    elif [ -x /usr/bin/pyflakes3k ] ; then echo pyflakes3k ; \
@@ -112,22 +113,21 @@ check:
 	LC_ALL=C GDP_UNINSTALLED=1 PYTHONPATH=. $(PYTHON) tools/check_equivalence.py
 
 install:
-	echo DESTDIR: $(DESTDIR)
 	mkdir -p $(DESTDIR)$(bindir)
 	install -m0755 out/game-data-packager                  $(DESTDIR)$(bindir)
 
-	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/
-	install -m0644 out/*.png                               $(DESTDIR)/usr/share/games/game-data-packager/
-	install -m0644 out/*.svgz                              $(DESTDIR)/usr/share/games/game-data-packager/
-	install -m0644 out/bash_completion                     $(DESTDIR)/usr/share/games/game-data-packager/
-	install -m0644 out/changelog.gz                        $(DESTDIR)/usr/share/games/game-data-packager/
-	install -m0644 out/copyright                           $(DESTDIR)/usr/share/games/game-data-packager/
-	install -m0644 out/vfs.zip                             $(DESTDIR)/usr/share/games/game-data-packager/
+	mkdir -p $(DESTDIR)$(datadir)/game-data-packager
+	cp -ar game_data_packager/                             $(DESTDIR)$(datadir)/game-data-packager/
+	python3 -m game_data_packager.version >                $(DESTDIR)$(datadir)/game-data-packager/game_data_packager/version.py
+	install runtime/launcher.py                            $(DESTDIR)$(datadir)/game-data-packager/gdp-launcher
+	install -m0644 runtime/*.desktop                       $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 out/*.copyright                         $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 out/*.png                               $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 out/*.svgz                              $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 out/bash_completion                     $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 out/changelog.gz                        $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 out/copyright                           $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 out/vfs.zip                             $(DESTDIR)$(datadir)/game-data-packager/
 
 	mkdir -p $(DESTDIR)/usr/share/bash-completion/completions
 	install -m0644 data/bash-completion/game-data-packager $(DESTDIR)/usr/share/bash-completion/completions/
@@ -147,8 +147,8 @@ install:
 	install -m0644 runtime/doom2-masterlevels.desktop      $(DESTDIR)/usr/share/applications/
 	install -m0644 doc/doom2-masterlevels.6                $(DESTDIR)/usr/share/man/man6/
 	install -m0644 out/doom-common.png                     $(DESTDIR)/usr/share/pixmaps/doom2-masterlevels.png
-	install -m0644 runtime/confirm-binary-only.txt         $(DESTDIR)/usr/share/games/game-data-packager/
-	install -m0644 runtime/missing-data.txt                $(DESTDIR)/usr/share/games/game-data-packager/
+	install -m0644 runtime/confirm-binary-only.txt         $(DESTDIR)$(datadir)/game-data-packager/
+	install -m0644 runtime/missing-data.txt                $(DESTDIR)$(datadir)/game-data-packager/
 
 # Requires additional setup, so not part of "make check"
 manual-check:
diff --git a/game_data_packager/paths.py b/game_data_packager/paths.py
index a8b869a..532cebd 100644
--- a/game_data_packager/paths.py
+++ b/game_data_packager/paths.py
@@ -10,6 +10,9 @@ if os.environ.get('GDP_UNINSTALLED'):
     USE_VFS = bool(os.environ.get('GDP_USE_VFS'))
 else:
     CONFIG = '/etc/game-data-packager.conf'
-    DATADIR = '/usr/share/games/game-data-packager'
+    if os.path.isdir('/usr/share/games/game-data-packager'):
+        DATADIR = '/usr/share/games/game-data-packager'
+    else:
+        DATADIR = '/usr/share/game-data-packager'
     ETCDIR = '/etc/game-data-packager'
     USE_VFS = True
diff --git a/run b/run
index afcc1fc..c1d02b6 100755
--- a/run
+++ b/run
@@ -7,8 +7,10 @@ if [ "$0" = "./run" ]; then
 	GDP_UNINSTALLED=1
 	export GDP_UNINSTALLED
 	PYTHONPATH="$(pwd)"
-else
+elif [ -d /usr/share/games/game-data-packager ]; then
 	PYTHONPATH=/usr/share/games/game-data-packager
+else
+	PYTHONPATH=/usr/share/game-data-packager
 fi
 export PYTHONPATH
 
diff --git a/tools/game-data-packager.spec b/tools/game-data-packager.spec
index bde5eba..aa84d85 100644
--- a/tools/game-data-packager.spec
+++ b/tools/game-data-packager.spec
@@ -70,7 +70,7 @@ make %{?_smp_mflags}
 make check
 
 %install
-make DESTDIR=$RPM_BUILD_ROOT bindir=/usr/bin install
+make DESTDIR=$RPM_BUILD_ROOT bindir=/usr/bin datadir=/usr/share install
 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