]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - setup/linux/setup_image/setup.data/postinstall.sh.in
git-svn-id: svn://svn.icculus.org/netradiant/trunk@55 61c419a2-8eb2-4b30-bcec-8cead03...
[xonotic/netradiant.git] / setup / linux / setup_image / setup.data / postinstall.sh.in
1 dnl `uname -m` quoting is a nightmare
2 dnl <sander> TTimo: You could do:  &#96;uname -a&#96;
3 changequote([, ])
4
5 #!/bin/sh
6 # post installation script, finalize everything
7
8 # The install path is the first argument of the script
9 install_path="$1"
10
11 # Return the appropriate architecture string
12 function DetectARCH {
13         status=1
14         case `uname -m` in
15                 i?86)  echo "x86"
16                         status=0;;
17                 *) case `uname -p` in
18                         powerpc) echo "ppc"
19                                 status=0;;
20                         *) echo "unknown"
21                                 status=0;;
22                 esac
23         esac
24         return $status
25 }
26 arch=`DetectARCH`
27
28 # Create a wrapper script
29 cat <<__EOF__ >"$install_path/radiant"
30 #!/bin/sh
31 # Needed to make symlinks/shortcuts work.
32 # Run map editor with some default arguments
33
34 cd "$install_path"
35 radiant="./radiant.$arch"
36 # gcc 3.x, trying to reduce ABI issues
37 export LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH
38 "\$radiant" \$*
39 exit \$?
40 __EOF__
41
42 chmod 755 "$install_path/radiant"
43
44 # Create a q3map2 wrapper script
45 cat <<__EOF__ >"$install_path/q3map2"
46 #!/bin/sh
47 # Needed to make symlinks/shortcuts work.
48
49 cd "$install_path"
50 q3map2="./q3map2.$arch"
51 # gcc 3.x, trying to reduce ABI issues
52 export LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH
53 "\$q3map2" \$*
54 exit \$?
55 __EOF__
56
57 chmod 755 "$install_path/q3map2"
58
59 # setup the safe guard
60 echo "M4_VER_MAJOR" > $install_path/RADIANT_MAJOR
61 echo "M4_VER_MINOR" > $install_path/RADIANT_MINOR
62
63 # why the fuck is openurl.sh not +x by default anyway
64 chmod 755 "$install_path/openurl.sh"