install.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #! /bin/bash
  2. # Yes, Bash, because we use features specific to it.
  3. # Make it possible to specify another location (DESTDIR=/usr/bin ./install.sh).
  4. if [ -z $DESTDIR ]; then
  5. DESTDIR=/usr/local/bin
  6. elif [ ! -e $DESTDIR ]; then
  7. echo "$DESTDIR does not exist, installing to /usr/local/bin"
  8. DESTDIR=/usr/local/bin
  9. fi
  10. echo "Give root's password:"
  11. # The version of su on Mac OS X requires the user name to be specified
  12. su root -c "
  13. echo Continuing installation.
  14. chown root ucon64
  15. chmod 4775 ucon64
  16. cp -p ucon64 $DESTDIR
  17. "
  18. if [ ! -e $HOME/.ucon64 ]; then
  19. mkdir $HOME/.ucon64
  20. fi
  21. if [ ! -e $HOME/.ucon64/dat ]; then
  22. mkdir $HOME/.ucon64/dat
  23. echo "You can copy/move your DAT file collection to $HOME/.ucon64/dat"
  24. fi
  25. if [ ${OSTYPE:0:6} == darwin ]; then
  26. LIBSUFFIX=.dylib
  27. elif [ $OSTYPE == cygwin ]; then
  28. LIBSUFFIX=.dll
  29. elif [ $OSTYPE == msys ]; then
  30. LIBSUFFIX=.dll
  31. else
  32. LIBSUFFIX=.so
  33. fi
  34. if [ -f libdiscmage/discmage$LIBSUFFIX ]; then
  35. cp libdiscmage/discmage$LIBSUFFIX $HOME/.ucon64
  36. elif [ -f discmage$LIBSUFFIX ]; then
  37. cp discmage$LIBSUFFIX $HOME/.ucon64
  38. fi
  39. echo "Be sure to check $HOME/.ucon64rc for some options after"
  40. echo "you've run uCON64 once."
  41. echo