gtkradiant/setup/linux/setup_image/setup.data/postinstall.sh.in
TTimo 12b372f89c ok
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant@1 8a3a26a2-13c4-0310-b231-cf6edde360e5
2006-02-10 22:01:20 +00:00

64 lines
1.4 KiB
Bash

dnl `uname -m` quoting is a nightmare
dnl <sander> TTimo: You could do: &#96;uname -a&#96;
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"