separate out the process of installing a game pack into a .sh file, for later "adding... svn-r421
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 4 Feb 2010 09:55:28 +0000 (09:55 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 4 Feb 2010 09:55:28 +0000 (09:55 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@421 61c419a2-8eb2-4b30-bcec-8cead039b335

Makefile
download-gamepacks.sh
install-gamepack.sh [new file with mode: 0644]

index e0de180..3bfdfa1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -958,19 +958,7 @@ install-data: binaries
        [ "$(OS)" != "Darwin" ] || $(CP_R) setup/data/osx/NetRadiant.app/* $(INSTALLDIR_BASE)/NetRadiant.app/
        set -ex; \
        for GAME in games/*; do \
-               if [ x"$$GAME" = x"games/*" ]; then \
-                       echo; echo "*** NO GAME PACKS FOUND ***"; echo "Please run download-gamepacks.sh and try again."; echo; echo; \
-                       continue; \
-               fi; \
-               if [ -d "$$GAME/tools" ]; then \
-                       GAME=$$GAME/tools; \
-               fi; \
-               for GAMEFILE in $$GAME/games/*.game; do \
-                       $(CP) "$$GAMEFILE" $(INSTALLDIR)/games/; \
-               done; \
-               for GAMEDIR in $$GAME/*.game; do \
-                       $(CP_R) "$$GAMEDIR" $(INSTALLDIR)/; \
-               done; \
+               CP="$(CP)" CP_R="$(CP_R)" $(SH) install-gamepack.sh "$$GAME" "$(INSTALLDIR)"; \
        done
        $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
        $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
index 89cfe0c..710dc02 100644 (file)
@@ -4,6 +4,8 @@
 #   sh download-gamepack.sh
 #   LICENSEFILTER=GPL BATCH=1 sh download-gamepack.sh
 
+set -e
+
 pack()
 {
        pack=$1; shift
@@ -17,6 +19,18 @@ pack()
                        svn)
                                svn update "games/$pack" "$@"
                                ;;
+                       zip1)
+                               rm -rf zipdownload
+                               mkdir zipdownload
+                               cd zipdownload
+                               wget "$source" "$@"
+                               unzip *
+                               cd ..
+                               rm -rf "games/$pack"
+                               mkdir "games/$pack"
+                               mv zipdownload/*/* "games/$pack/"
+                               rm -rf zipdownload
+                               ;;
                esac
                return
        fi
@@ -70,13 +84,28 @@ pack()
                svn)
                        svn checkout "$source" "games/$pack" "$@"
                        ;;
+               zip1)
+                       rm -rf zipdownload
+                       mkdir zipdownload
+                       cd zipdownload
+                       wget "$source" "$@"
+                       unzip *
+                       cd ..
+                       mkdir "games/$pack"
+                       mv zipdownload/*/* "games/$pack/"
+                       rm -rf zipdownload
+                       ;;
        esac
 }
 
 mkdir -p games
-pack NexuizPack      GPL         svn svn://svn.icculus.org/nexuiz/trunk/misc/netradiant-NexuizPack
-pack Quake2WorldPack GPL         svn svn://jdolan.dyndns.org/quake2world/trunk/gtkradiant
-pack DarkPlacesPack  GPL         svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/DarkPlacesPack/branches/1.5/
-pack WarsowPack      GPL         svn http://opensvn.csie.org/warsowgamepack/netradiant/games/WarsowPack/
-pack Q3Pack          proprietary svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/Q3Pack/trunk/ -r29
-pack UFOAIPack       proprietary svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/UFOAIPack/branches/1.5/
+pack DarkPlacesPack  GPL         svn  https://zerowing.idsoftware.com/svn/radiant.gamepacks/DarkPlacesPack/branches/1.5/
+pack NexuizPack      GPL         svn  svn://svn.icculus.org/nexuiz/trunk/misc/netradiant-NexuizPack
+pack OpenArenaPack   unknown     zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/OpenArenaPack.zip
+pack Q3Pack          proprietary svn  https://zerowing.idsoftware.com/svn/radiant.gamepacks/Q3Pack/trunk/ -r29
+pack Quake2Pack      proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/Quake2Pack.zip
+pack Quake2WorldPack GPL         svn  svn://jdolan.dyndns.org/quake2world/trunk/gtkradiant
+pack QuakePack       proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/QuakePack.zip
+pack TremulousPack   proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/TremulousPack.zip
+pack UFOAIPack       proprietary svn  https://zerowing.idsoftware.com/svn/radiant.gamepacks/UFOAIPack/branches/1.5/
+pack WarsowPack      GPL         svn  http://opensvn.csie.org/warsowgamepack/netradiant/games/WarsowPack/
diff --git a/install-gamepack.sh b/install-gamepack.sh
new file mode 100644 (file)
index 0000000..4073d40
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# installs a game pack
+# Usage:
+#   install-gamepack.sh gamepack installdir
+
+set -ex
+
+: ${CP:=cp}
+: ${CP_R:=cp -r}
+
+pack=$1
+dest=$2
+
+if [ -d "$pack/tools" ]; then
+       pack="$pack/tools"
+fi
+for GAMEFILE in "$pack/games"/*.game; do
+       $CP "$GAMEFILE" "$dest/games/"
+done
+for GAMEDIR in "$pack"/*.game/; do
+       $CP_R "$GAMEDIR" "$dest/"
+done