mirror of
https://github.com/id-Software/GtkRadiant.git
synced 2026-03-20 17:09:39 +01:00
The GtkRadiant sources as originally released under the GPL license.
This commit is contained in:
38
setup/linux/setup_image/setup.data/config.games.sh
Normal file
38
setup/linux/setup_image/setup.data/config.games.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Script for generating .game files
|
||||
|
||||
# generate game support files
|
||||
# Expects params (game, game path_prefix)
|
||||
|
||||
exec >/dev/tty
|
||||
|
||||
if [ $# -lt 2 ] ; then
|
||||
echo "Incorrect number of params to GenGameFiles";
|
||||
return;
|
||||
fi
|
||||
|
||||
# NOTE: the naming of the vars here doesn't follow attributes names in XML, it can be confusing
|
||||
game=$1;
|
||||
INPUT_FILE="games/$game.game";
|
||||
game_engine=`grep "enginepath_linux=" $INPUT_FILE | awk -F"\"" '{print $2 }'`
|
||||
game_engine_path=$SETUP_COMPONENT_PATH;
|
||||
game_tools=$2;
|
||||
OUT_FILE="$game_tools/games/$game.game";
|
||||
|
||||
echo -e "Generating game file '$OUT_FILE' from '$INPUT_FILE' with the following values...";
|
||||
echo -e "\tGame :\t $game";
|
||||
echo -e "\tGame Engine :\t $game_engine_path/$game_engine";
|
||||
echo -e "\tGame Tools :\t $game_tools";
|
||||
|
||||
if [ -f "$OUT_FILE" ] ; then
|
||||
rm -f $OUT_FILE;
|
||||
fi
|
||||
|
||||
if [ ! -d "$game_tools/games" ] ; then
|
||||
mkdir "$game_tools/games";
|
||||
fi
|
||||
|
||||
sed -e 's!enginepath_linux=\".*.\"!enginepath_linux=\"'$game_engine_path'\"\n gametools=\"'$game_tools/$game'\"!g' <$INPUT_FILE >$OUT_FILE
|
||||
|
||||
exit 0;
|
||||
15
setup/linux/setup_image/setup.data/config.sh.in
Normal file
15
setup/linux/setup_image/setup.data/config.sh.in
Normal file
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Use this script to customize the installer bootstrap script
|
||||
#
|
||||
|
||||
# override some defaults
|
||||
|
||||
# try to get root prior to running setup?
|
||||
# 0: no
|
||||
# 1: prompt, but run anyway if fails
|
||||
# 2: require, abort if root fails
|
||||
ifdef(`M4_OSX', `GET_ROOT=2')
|
||||
|
||||
FATAL_ERROR="Please report to http://zerowing.idsoftware.com/bugzilla/"
|
||||
|
||||
#XSU_ICON="-i icon.xpm"
|
||||
64
setup/linux/setup_image/setup.data/postinstall.sh.in
Normal file
64
setup/linux/setup_image/setup.data/postinstall.sh.in
Normal file
@@ -0,0 +1,64 @@
|
||||
dnl `uname -m` quoting is a nightmare
|
||||
dnl <sander> TTimo: You could do: `uname -a`
|
||||
changequote([, ])
|
||||
|
||||
#!/bin/sh
|
||||
# post installation script, finalize everything
|
||||
|
||||
# The install path is the first argument of the script
|
||||
install_path="$1"
|
||||
|
||||
# Return the appropriate architecture string
|
||||
function DetectARCH {
|
||||
status=1
|
||||
case `uname -m` in
|
||||
i?86) echo "x86"
|
||||
status=0;;
|
||||
*) case `uname -p` in
|
||||
powerpc) echo "ppc"
|
||||
status=0;;
|
||||
*) echo "unknown"
|
||||
status=0;;
|
||||
esac
|
||||
esac
|
||||
return $status
|
||||
}
|
||||
arch=`DetectARCH`
|
||||
|
||||
# Create a wrapper script
|
||||
cat <<__EOF__ >"$install_path/radiant"
|
||||
#!/bin/sh
|
||||
# Needed to make symlinks/shortcuts work.
|
||||
# Run map editor with some default arguments
|
||||
|
||||
cd "$install_path"
|
||||
radiant="./radiant.$arch"
|
||||
# gcc 3.x, trying to reduce ABI issues
|
||||
export LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH
|
||||
"\$radiant" \$*
|
||||
exit \$?
|
||||
__EOF__
|
||||
|
||||
chmod 755 "$install_path/radiant"
|
||||
|
||||
# Create a q3map2 wrapper script
|
||||
cat <<__EOF__ >"$install_path/q3map2"
|
||||
#!/bin/sh
|
||||
# Needed to make symlinks/shortcuts work.
|
||||
|
||||
cd "$install_path"
|
||||
q3map2="./q3map2.$arch"
|
||||
# gcc 3.x, trying to reduce ABI issues
|
||||
export LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH
|
||||
"\$q3map2" \$*
|
||||
exit \$?
|
||||
__EOF__
|
||||
|
||||
chmod 755 "$install_path/q3map2"
|
||||
|
||||
# setup the safe guard
|
||||
echo "M4_VER_MAJOR" > $install_path/RADIANT_MAJOR
|
||||
echo "M4_VER_MINOR" > $install_path/RADIANT_MINOR
|
||||
|
||||
# why the fuck is openurl.sh not +x by default anyway
|
||||
chmod 755 "$install_path/openurl.sh"
|
||||
2192
setup/linux/setup_image/setup.data/setup.glade
Normal file
2192
setup/linux/setup_image/setup.data/setup.glade
Normal file
File diff suppressed because it is too large
Load Diff
139
setup/linux/setup_image/setup.data/setup.xml.in
Normal file
139
setup/linux/setup_image/setup.data/setup.xml.in
Normal file
@@ -0,0 +1,139 @@
|
||||
<?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>
|
||||
23719
setup/linux/setup_image/setup.data/splash.xpm
Normal file
23719
setup/linux/setup_image/setup.data/splash.xpm
Normal file
File diff suppressed because it is too large
Load Diff
276
setup/linux/setup_image/setup.sh.in
Normal file
276
setup/linux/setup_image/setup.sh.in
Normal file
@@ -0,0 +1,276 @@
|
||||
dnl `uname -m` quoting is a nightmare
|
||||
dnl <sander> TTimo: You could do: `uname -a`
|
||||
changequote([[, ]])
|
||||
|
||||
#! /bin/sh
|
||||
#
|
||||
# Product setup script
|
||||
#
|
||||
# TTimo - run in fink environement
|
||||
# I am not entirely sure this is needed
|
||||
# but in any case, it doesn't hurt
|
||||
ifdef([[M4_OSX]], [[source /sw/bin/init.sh]])
|
||||
# Go to the proper setup directory (if not already there)
|
||||
cd `dirname $0`
|
||||
|
||||
# defaults
|
||||
FATAL_ERROR="Fatal error, no tech support email configured in this setup"
|
||||
# try to get root prior to running setup?
|
||||
# 0: no
|
||||
# 1: prompt, but run anyway if fails
|
||||
# 2: require, abort if root fails
|
||||
GET_ROOT=0
|
||||
XSU_ICON=""
|
||||
# You may want to set USE_XHOST to 1 if you want an X11 application to
|
||||
# be launched with root privileges right after installation
|
||||
USE_XHOST=0
|
||||
# this is the message for su call, printf
|
||||
SU_MESSAGE="You need to run this installation as the super user.\nPlease enter the root password."
|
||||
|
||||
NULL=/dev/null
|
||||
# See if we have the XPG4 utilities (Solaris)
|
||||
if test -d /usr/xpg4/bin; then
|
||||
PATH=/usr/xpg4/bin:$PATH
|
||||
fi
|
||||
|
||||
# Return the appropriate architecture string
|
||||
DetectARCH()
|
||||
{
|
||||
status=1
|
||||
case `uname -m` in
|
||||
i?86)
|
||||
echo "x86"
|
||||
status=0;;
|
||||
90*/*)
|
||||
echo "hppa"
|
||||
status=0;;
|
||||
*)
|
||||
case `uname -s` in
|
||||
IRIX*)
|
||||
echo "mips"
|
||||
status=0;;
|
||||
*)
|
||||
arch=`uname -p 2> /dev/null || uname -m`
|
||||
if test "$arch" = powerpc; then
|
||||
echo "ppc"
|
||||
else
|
||||
echo $arch
|
||||
fi
|
||||
status=0;;
|
||||
esac
|
||||
esac
|
||||
return $status
|
||||
}
|
||||
|
||||
# Return the appropriate version string
|
||||
DetectLIBC()
|
||||
{
|
||||
status=1
|
||||
if [ `uname -s` != Linux ]; then
|
||||
echo "glibc-2.1"
|
||||
return $status
|
||||
fi
|
||||
if [ -f `echo /lib/libc.so.6* | tail -1` ]; then
|
||||
if fgrep GLIBC_2.1 /lib/libc.so.6* 2> $NULL >> $NULL; then
|
||||
echo "glibc-2.1"
|
||||
status=0
|
||||
else
|
||||
echo "glibc-2.0"
|
||||
status=0
|
||||
fi
|
||||
elif [ -f /lib/libc.so.5 ]; then
|
||||
echo "libc5"
|
||||
status=0
|
||||
else
|
||||
echo "unknown"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
DetectOS()
|
||||
{
|
||||
os=`uname -s`
|
||||
if test "$os" = "OpenUNIX"; then
|
||||
echo SCO_SV
|
||||
else
|
||||
echo $os
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Detect the environment
|
||||
arch=`DetectARCH`
|
||||
libc=`DetectLIBC`
|
||||
os=`DetectOS`
|
||||
|
||||
# Import preferences from a secondary script
|
||||
if [ -f setup.data/config.sh ]; then
|
||||
. setup.data/config.sh
|
||||
elif [ -f SETUP.DAT/CONFIG.SH\;1 ]; then
|
||||
# HP-UX and other systems unable to get LFN correctly
|
||||
. SETUP.DAT/CONFIG.SH\;1
|
||||
fi
|
||||
|
||||
# Add some standard paths for compatibility
|
||||
PATH=$PATH:/usr/ucb
|
||||
|
||||
# call setup with -auth when ran through su/xsu
|
||||
auth=0
|
||||
if [ "$1" = "-auth" ]
|
||||
then
|
||||
auth=1
|
||||
[[shift]]
|
||||
fi
|
||||
|
||||
if [ "$auth" -eq 1 ]
|
||||
then
|
||||
# if root is absolutely required
|
||||
# this happens if xsu/su execs setup.sh but it still doesn't have root rights
|
||||
if [ "$GET_ROOT" -eq 2 ]
|
||||
then
|
||||
# NOTE TTimo: this causes the following error message in some cases:
|
||||
# return: can only `return' from a function or sourced script
|
||||
# BUT: in other cases, the return is legit, if you replace by an exit call, it's broken
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Feel free to add some additional command-line arguments for setup here.
|
||||
args=""
|
||||
|
||||
# Find the installation program
|
||||
# try_run [-absolute] [-fatal] INSTALLER_NAME [PARAMETERS_PASSED]
|
||||
# -absolute option: if what you are trying to execute has an absolute path
|
||||
# NOTE: maybe try_run_absolute would be easier
|
||||
# -fatal option: if you want verbose messages in case
|
||||
# - the script could not be found
|
||||
# - it's execution would fail
|
||||
# INSTALLER_NAME: setup.gtk or setup
|
||||
# PARAMETERS_PASSED: additional arguments passed to the setup script
|
||||
try_run()
|
||||
{
|
||||
absolute=0
|
||||
if [ "$1" = "-absolute" ]; then
|
||||
absolute=1
|
||||
[[shift]]
|
||||
fi
|
||||
|
||||
fatal=0
|
||||
# older bash < 2.* don't like == operator, using =
|
||||
if [ "$1" = "-fatal" ]; then
|
||||
# got fatal
|
||||
fatal=1
|
||||
[[shift]]
|
||||
fi
|
||||
|
||||
setup=$1
|
||||
[[shift]]
|
||||
|
||||
# First find the binary we want to run
|
||||
failed=0
|
||||
if [ "$absolute" -eq 0 ]
|
||||
then
|
||||
setup_bin="setup.data/bin/$os/$arch/$libc/$setup"
|
||||
# trying $setup_bin
|
||||
if [ ! -f "$setup_bin" ]; then
|
||||
setup_bin="setup.data/bin/$os/$arch/$setup"
|
||||
# libc dependant version failed, trying again
|
||||
if [ ! -f "$setup_bin" ]; then
|
||||
failed=1
|
||||
fi
|
||||
fi
|
||||
if [ "$failed" -eq 1 ]; then
|
||||
if [ "$fatal" -eq 1 ]; then
|
||||
cat <<__EOF__
|
||||
This installation doesn't support $libc on $os / $arch
|
||||
(tried to run $setup)
|
||||
$FATAL_ERROR
|
||||
__EOF__
|
||||
fi
|
||||
return $failed
|
||||
fi
|
||||
|
||||
# Try to run the binary ($setup_bin)
|
||||
# The executable is here but we can't execute it from CD
|
||||
# NOTE TTimo: this is dangerous, we also use $setup to store the name of the try_run
|
||||
setup="$HOME/.setup$$"
|
||||
rm -f "$setup"
|
||||
cp "$setup_bin" "$setup"
|
||||
chmod 700 "$setup"
|
||||
fi
|
||||
# echo Running "$setup" "$@"
|
||||
if [ "$fatal" -eq 0 ]; then
|
||||
"$setup" "$@"
|
||||
failed="$?"
|
||||
else
|
||||
"$setup" "$@" 2>> $NULL
|
||||
failed="$?"
|
||||
fi
|
||||
if [ "$absolute" -eq 0 ]
|
||||
then
|
||||
# don't attempt removal when we are passed an absolute path
|
||||
# no, I don't want to imagine a faulty try_run as root on /bin/su
|
||||
rm -f "$setup"
|
||||
fi
|
||||
return "$failed"
|
||||
}
|
||||
|
||||
# if we have not been through the auth yet, and if we need to get root, then prompt
|
||||
if [ "$auth" -eq 0 ] && [ "$GET_ROOT" -ne 0 ]
|
||||
then
|
||||
GOT_ROOT=`id -u`
|
||||
if [ "$GOT_ROOT" != "0" ]
|
||||
then
|
||||
|
||||
if [ "$USE_XHOST" -eq 1 ]; then
|
||||
xhost +127.0.0.1 2> $NULL > $NULL
|
||||
fi
|
||||
try_run xsu -e -a -u root -c "sh `pwd`/setup.sh -auth" $XSU_ICON
|
||||
status="$?"
|
||||
# echo "got $status"
|
||||
# if try_run successfully executed xsu, it will return xsu's exit code
|
||||
# xsu returns 2 if ran and cancelled (i.e. the user 'doesn't want' to auth)
|
||||
# it will return 0 if the command was executed correctly
|
||||
# summing up, if we get 1, something failed
|
||||
if [ "$status" -eq 0 ]
|
||||
then
|
||||
# the auth command was properly executed
|
||||
exit 0
|
||||
elif [ "$status" -eq 1 ]
|
||||
then
|
||||
ifdef([[M4_OSX]], [[echo "You need to run the installer as root" ; exit 1]])
|
||||
# xsu wasn't found, or failed to run
|
||||
# if xsu actually ran and the auth was cancelled, $status is 2
|
||||
# try with su
|
||||
printf "$SU_MESSAGE\n"
|
||||
try_run -absolute /bin/su root -c "export DISPLAY=$DISPLAY;sh `pwd`/setup.sh -auth"
|
||||
status="$?"
|
||||
elif [ "$status" -eq 3 ]
|
||||
then
|
||||
# the auth failed or was canceled
|
||||
# we don't want to even start the setup if not root
|
||||
echo "Please run this installation as the super user"
|
||||
exit 1
|
||||
fi
|
||||
# continue running as is
|
||||
fi
|
||||
fi
|
||||
|
||||
# Try to run the setup program
|
||||
# TTimo - setup.gtk only
|
||||
# try_run setup.gtk $args $*
|
||||
# status=$?
|
||||
# if [ $status -eq 2 ]; then # setup.gtk couldn't connect to X11 server - ignore
|
||||
try_run -fatal setup.gtk $args $* || {
|
||||
# TTimo
|
||||
echo "setup.gtk failed to start?"
|
||||
echo "DISPLAY: $DISPLAY"
|
||||
echo "Do you need to issue an xhost + command to let root access X11?"
|
||||
ifdef([[M4_OSX]], [[echo "See http://www.qeradiant.com/wikifaq/index.php?OSX%20fink%20installer%20known%20issues for details"]])
|
||||
echo "The setup program seems to have failed on $arch/$libc"
|
||||
echo
|
||||
echo $FATAL_ERROR
|
||||
status=1
|
||||
}
|
||||
#fi
|
||||
exit $status
|
||||
Reference in New Issue
Block a user