diff --git a/Makefile b/Makefile index 24dd716..8a8612e 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,27 @@ all: install: mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/usr/share/patchimage/ - cp -rv data database override patches scripts tools $(DESTDIR)/usr/share/patchimage/ + cp -rv data database patches scripts $(DESTDIR)/usr/share/patchimage/ install -m755 patchimage.sh $(DESTDIR)/usr/bin/patchimage + if [ $(shell uname -m) = x86_64 ]; then \ + mkdir -p $(DESTDIR)/usr/lib/x86_64-linux-gnu/patchimage/tools ; \ + mkdir -p $(DESTDIR)/usr/lib/x86_64-linux-gnu/patchimage/override ; \ + cp -rv tools/*.64 tools/unp tools/ucat tools/gdown.pl tools/ignore_3dstool.txt \ + $(DESTDIR)/usr/lib/x86_64-linux-gnu/patchimage/tools ; \ + cp -rv override/linux64 $(DESTDIR)/usr/lib/x86_64-linux-gnu/patchimage/override ; \ + else mkdir -p $(DESTDIR)/usr/lib/i386-linux-gnu/patchimage/tools ; \ + mkdir -p $(DESTDIR)/usr/lib/i386-linux-gnu/patchimage/override ; \ + cp -rv tools/*.32 tools/unp tools/ucat tools/gdown.pl tools/ignore_3dstool.txt \ + $(DESTDIR)/usr/lib/i386-linux-gnu/patchimage/tools ; \ + cp -rv override/linux32 $(DESTDIR)/usr/lib/i386-linux-gnu/patchimage/override ; \ + fi uninstall: rm -rf $(DESTDIR)/usr/share/patchimage rm -f $(DESTDIR)/usr/bin/patchimage + if [ $(shell uname -m) = x86_64 ]; then \ + rm -rf $(DESTDIR)/usr/lib/x86_64-linux-gnu/patchimage ; \ + else rm -rf $(DESTDIR)/usr/lib/i386-linux-gnu/patchimage ; \ + fi clean: diff --git a/debian/patchimage-tools-amd64.install b/debian/patchimage-tools-amd64.install index 7bf5a74..eb0b80e 100644 --- a/debian/patchimage-tools-amd64.install +++ b/debian/patchimage-tools-amd64.install @@ -1,9 +1,13 @@ -usr/share/patchimage/tools/3dstool.64 -usr/share/patchimage/tools/applyppf3.64 -usr/share/patchimage/tools/ctrtool.64 -usr/share/patchimage/tools/titledumper.64 -usr/share/patchimage/tools/uips.64 -usr/share/patchimage/tools/wit.64 -usr/share/patchimage/tools/wszst.64 -usr/share/patchimage/tools/xdelta3.64 -usr/share/patchimage/override/linux64 +usr/lib/x86_64-linux-gnu/patchimage/tools/gdown.pl +usr/lib/x86_64-linux-gnu/patchimage/tools/ignore_3dstool.txt +usr/lib/x86_64-linux-gnu/patchimage/tools/ucat +usr/lib/x86_64-linux-gnu/patchimage/tools/unp +usr/lib/x86_64-linux-gnu/patchimage/tools/3dstool.64 +usr/lib/x86_64-linux-gnu/patchimage/tools/applyppf3.64 +usr/lib/x86_64-linux-gnu/patchimage/tools/ctrtool.64 +usr/lib/x86_64-linux-gnu/patchimage/tools/titledumper.64 +usr/lib/x86_64-linux-gnu/patchimage/tools/uips.64 +usr/lib/x86_64-linux-gnu/patchimage/tools/wit.64 +usr/lib/x86_64-linux-gnu/patchimage/tools/wszst.64 +usr/lib/x86_64-linux-gnu/patchimage/tools/xdelta3.64 +usr/lib/x86_64-linux-gnu/patchimage/override/linux64 diff --git a/debian/patchimage-tools-i386.install b/debian/patchimage-tools-i386.install index 533fe43..40a3070 100644 --- a/debian/patchimage-tools-i386.install +++ b/debian/patchimage-tools-i386.install @@ -1,9 +1,13 @@ -usr/share/patchimage/tools/3dstool.32 -usr/share/patchimage/tools/applyppf3.32 -usr/share/patchimage/tools/ctrtool.32 -usr/share/patchimage/tools/titledumper.32 -usr/share/patchimage/tools/uips.32 -usr/share/patchimage/tools/wit.32 -usr/share/patchimage/tools/wszst.32 -usr/share/patchimage/tools/xdelta3.32 -usr/share/patchimage/override/linux32 +usr/lib/i386-linux-gnu/patchimage/tools/gdown.pl +usr/lib/i386-linux-gnu/patchimage/tools/ignore_3dstool.txt +usr/lib/i386-linux-gnu/patchimage/tools/ucat +usr/lib/i386-linux-gnu/patchimage/tools/unp +usr/lib/i386-linux-gnu/patchimage/tools/3dstool.32 +usr/lib/i386-linux-gnu/patchimage/tools/applyppf3.32 +usr/lib/i386-linux-gnu/patchimage/tools/ctrtool.32 +usr/lib/i386-linux-gnu/patchimage/tools/titledumper.32 +usr/lib/i386-linux-gnu/patchimage/tools/uips.32 +usr/lib/i386-linux-gnu/patchimage/tools/wit.32 +usr/lib/i386-linux-gnu/patchimage/tools/wszst.32 +usr/lib/i386-linux-gnu/patchimage/tools/xdelta3.32 +usr/lib/i386-linux-gnu/patchimage/override/linux32 diff --git a/debian/patchimage.install b/debian/patchimage.install index 6501fcd..7473308 100644 --- a/debian/patchimage.install +++ b/debian/patchimage.install @@ -3,7 +3,3 @@ usr/share/patchimage/data usr/share/patchimage/database usr/share/patchimage/patches usr/share/patchimage/scripts -usr/share/patchimage/tools/gdown.pl -usr/share/patchimage/tools/ignore_3dstool.txt -usr/share/patchimage/tools/ucat -usr/share/patchimage/tools/unp diff --git a/patchimage.sh b/patchimage.sh index 8cb4472..0c98f13 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -22,8 +22,13 @@ else export PATCHIMAGE_SCRIPT_DIR=/usr/share/patchimage/scripts export PATCHIMAGE_PATCH_DIR=/usr/share/patchimage/patches export PATCHIMAGE_DATA_DIR=/usr/share/patchimage/data - export PATCHIMAGE_TOOLS_DIR=/usr/share/patchimage/tools - export PATCHIMAGE_OVERRIDE_DIR=/usr/share/patchimage/override + if [[ $(uname -m) == "x86_64" ]]; then + export PATCHIMAGE_TOOLS_DIR=/usr/lib/x86_64-linux-gnu/patchimage/tools + export PATCHIMAGE_OVERRIDE_DIR=/usr/lib/x86_64-linux-gnu/patchimage/override + else + export PATCHIMAGE_TOOLS_DIR=/usr/lib/i386-linux-gnu/patchimage/tools + export PATCHIMAGE_OVERRIDE_DIR=/usr/lib/i386-linux-gnu/patchimage/override + fi export PATCHIMAGE_DATABASE_DIR=/usr/share/patchimage/database fi