<?xml version="1.0" standalone="yes"?>
<install product="GtkRadiant-1.M4_VER_MAJOR" desc="GtkRadiant M4_VER" version="M4_VER"
         nouninstall="yes"
         postinstall="sh setup.data/postinstall.sh $*">
ifdef(`M4_OSX', `  <install_drop_list>
    /sw/games
    /Applications
  </install_drop_list>')
  <eula>
    license.txt
  </eula>
  <readme required="true">
    README
  </readme>
	<option install="true" required="true">
	  GtkRadiant editor core and documentation
		<!-- copies everything including some game pack specific stuff -->
		<files srcpath="core">
		  *
		</files>
    <binary symlink="radiant">
      radiant
    </binary>
    <binary symlink="q3map2">
      q3map2
    </binary>
    <binary keepdirs="yes">
      radiant.ifdef(`M4_OSX', `ppc', `x86')
      q3map2.ifdef(`M4_OSX', `ppc', `x86')
      modules/archivepak.so
      modules/archivewad.so
      modules/archivezip.so
      modules/entity.so
      modules/image.so
      modules/imagehl.so
      modules/imageq2.so
      modules/imagepng.so
      modules/mapq3.so
      modules/mapxml.so
      modules/md3model.so
      modules/model.so
      modules/shaders.so
      modules/vfspk3.so
ifelse(M4_GAME_Q2, `1', `
      q2/q2map
      q2/qdata3
<!--      q2/modules/imagewal.so -->
<!--      q2/modules/surface_quake2.so -->
<!--      q2/modules/vfspak.so -->
	  ')
ifdef(`M4_OSX', `',`heretic2/qdata3
      heretic2/q2map
<!--      heretic2/modules/imagem8.so -->
<!--      heretic2/modules/surface_heretic2.so -->
<!--      heretic2/modules/vfspak.so -->
      libgcc_s.so.1
      M4_STDC')
    </binary>
    <!-- q3 game pack -->
    <files srcpath="core">
      q3.game/synapse.config
    </files>
    <binary keepdirs="yes">
ifdef(`M4_OSX', `',`      q3/bspc')
    </binary>
    <!-- wolf game pack -->
    <files srcpath="core">
      wolf.game/synapse.config
    </files>
    <binary keepdirs="yes">
ifdef(`M4_OSX', `',`      wolf/bspc')
    </binary>    
	</option>
	<!-- each of the subcomponent element can be enabled/disabled -->
	<!-- each option there can have it's own install path -->
	<subcomponent name="Game Packs" version="M4_VER_MAJOR">
    <option install="true" default_path="ifdef(`M4_OSX', `/Applications/Quake3/', `/usr/local/games/quake3')">
      Quake III Arena / Team Arena
      <files srcpath="q3">
        *
      </files>
			<!-- creates the appropriate .game file -->
      <script>
        sh setup.data/config.games.sh q3 $*
      </script>
    </option>
    <option install="true" default_path="ifdef(`M4_OSX', `/Applications/RTCW/', `/usr/local/games/wolfenstein')">
      Return to Castle Wolfenstein
      <files srcpath="wolf">
        *
      </files>
      <script>
        sh setup.data/config.games.sh wolf $*
      </script>
    </option>
    ifelse(M4_GAME_ET, `1', `
    <option install="true" default_path="/usr/local/games/enemy-territory">
      Wolfenstein: Enemy Territory
      <files srcpath="et">
        *
      </files>
      <script>
        sh setup.data/config.games.sh et $*
      </script>
    </option>
    ')
    ifelse(M4_GAME_DOOM3, `1', `
    <option install="true" default_path="/usr/local/games/doom3">
      Doom 3
<!--      <files srcpath="doom3">
        *
      </files> -->
      <script>
        sh setup.data/config.games.sh doom3 $*
      </script>
    </option>
    ')
	ifelse(M4_GAME_Q2, `1', `
    <option install="true" default_path="ifdef(`M4_OSX', `/Applications/Quake2/', `/usr/local/games/quake2')">
      Quake 2
      <files srcpath="q2">
        *
      </files>
      <script>
        sh setup.data/config.games.sh q2 $*
      </script>
    </option>
	')
    ifdef(`M4_OSX', `',`    <option install="true" default_path="ifdef(`M4_OSX', `/Applications/Heretic2/', `/usr/local/games/heretic2')">
      Heretic 2
      <files srcpath="heretic2">
        *
      </files>
      <script>
        sh setup.data/config.games.sh heretic2 $*
      </script>
    </option>')
	</subcomponent>
</install>
