]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/sys/linux/setup/image-demo/setup.data/postinstall.sh
hello world
[icculus/iodoom3.git] / neo / sys / linux / setup / image-demo / setup.data / postinstall.sh
1 #!/bin/sh
2 # create the wrapper
3
4 create_link()
5 {
6
7 echo "#!/bin/sh
8 # Needed to make symlinks/shortcuts work.
9 # the binaries must run with correct working directory
10 cd \"$1\"
11 export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:.
12 exec ./$BINARY \"\$@\"
13 " > "$1/$TARGET"
14   
15   chmod a+x "$1/$TARGET"
16   
17   # and then we must symlink to this
18   # can't be done from setup.xml because it would symlink the binary
19   if [ -n "$SETUP_SYMLINKSPATH" ] && [ -d "$SETUP_SYMLINKSPATH" ]
20   then
21     # the symlink might already exists, in case we will remove it
22     if [ -h "$SETUP_SYMLINKSPATH/$TARGET" ]
23     then
24       echo "Removing existing $TARGET symlink"
25       rm "$SETUP_SYMLINKSPATH/$TARGET"
26     fi
27   echo "Installing symlink $SETUP_SYMLINKSPATH/$TARGET -> $1/$TARGET"
28   ln -s "$1/$TARGET" "$SETUP_SYMLINKSPATH/$TARGET"
29   fi
30 }
31
32 BINARY=doom.x86
33 TARGET=doom3-demo
34 create_link "$1"