Fedora Remix maintained by the Rochester Institute of Technology (RIT) Linux Users Group, targeted at users new to Linux and RIT students, faculty, and staff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.6 KiB

7 years ago
  1. #!/bin/sh -e
  2. # IntelliJ installer script for TigerOS
  3. # author: Josh Bicking <jhb2345@rit.edu>
  4. DEPS=java-1.8.0-openjdk
  5. PROG="IntelliJ IDEA Community Edition"
  6. PROG_SHORT=idea-ce
  7. VERSION=idea-IC-171.4073.35
  8. TEMP_FILE=/tmp/ideaIC-2017.1.1.tar.gz
  9. FILE_DIR=/usr/local
  10. FILE=$FILE_DIR/$VERSION/bin/idea.sh
  11. FILE_URL=https://download.jetbrains.com/idea/ideaIC-2017.1.1.tar.gz
  12. LINK=$FILE_DIR/bin/$PROG_SHORT
  13. ICON=$FILE_DIR/$VERSION/bin/idea.png
  14. # Check that the current user is root
  15. if [ $EUID != 0 ]
  16. then
  17. echo "Please run this script as root (sudo $@$0)."
  18. exit
  19. fi
  20. ## Removal
  21. # Check if remove flag was passed
  22. if [ ! -z "$1" ] && [ "$1" = "--remove" ]
  23. then
  24. rm $LINK
  25. rm /usr/local/share/applications/jetbrains-idea-ce.desktop
  26. rm -rf $FILE_DIR/$VERSION
  27. # Remove local links if they were created
  28. for i in `ls /home/`
  29. do
  30. rm -f /home/$i/.local/share/applications/jetbrains-idea-ce.desktop
  31. done
  32. else
  33. ## Installation
  34. # Install dependencies
  35. dnf install $DEPS -y
  36. # Get the files
  37. wget -O $TEMP_FILE $FILE_URL
  38. # Extract the files
  39. tar -xf $TEMP_FILE -C $FILE_DIR
  40. # Make a link
  41. ln -s $FILE $LINK
  42. chmod +x $LINK
  43. chmod -R 755 $FILE_DIR/$VERSION
  44. # Make a desktop file
  45. # IDEA's first time setup allows the user to make this file. Naming it as such means the user won't get a duplicate entry.
  46. cat > /usr/local/share/applications/jetbrains-idea-ce.desktop <<EOF
  47. [Desktop Entry]
  48. Version=1.0
  49. Type=Application
  50. Name=$PROG
  51. Comment=The Drive to Develop
  52. Exec=$LINK %f
  53. Icon=$ICON
  54. Terminal=false
  55. Categories=Development;IDE;Java;
  56. StartupWMClass=jetbrains-idea-ce
  57. EOF
  58. # Clean up
  59. rm $TEMP_FILE
  60. fi