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.

68 lines
1.3 KiB

  1. #!/usr/bin/bash
  2. # JFLAP installer script for TigerOS
  3. # author: Josh Bicking <jhb2345@rit.edu>
  4. DEPS=java-1.8.0-openjdk
  5. PROG=JFLAP
  6. FILE=/usr/share/java/JFLAP.jar
  7. FILE_URL=http://www.jflap.org/jflaptmp/may15-2011/withoutSource/JFLAP.jar
  8. LINK=/usr/local/bin/jflap
  9. ICON_URL=http://jflap.org/jflapLogo2.jpg
  10. # Check that the current user is root
  11. if [ $EUID != 0 ]
  12. then
  13. echo "Please run this script as root (sudo $@$0)."
  14. exit
  15. fi
  16. ## Removal
  17. # Check if remove flag was passed
  18. if [ ! -z "$1" ] && [ "$1" = "--remove" ]
  19. then
  20. rm $LINK
  21. rm /usr/local/share/applications/$PROG.desktop
  22. rm $FILE
  23. rm /usr/local/share/icons/$PROG.jpg
  24. else
  25. ## Installation
  26. # Install dependencies
  27. dnf install $DEPS -y
  28. # Get the files
  29. curl -o $FILE $FILE_URL
  30. # Make a link
  31. cat > $LINK <<EOF
  32. #!/bin/sh
  33. cd \$HOME
  34. java -jar $FILE
  35. EOF
  36. chmod +x $LINK
  37. chmod +x $FILE
  38. # Make a desktop file
  39. cat > /usr/local/share/applications/$PROG.desktop <<EOF
  40. [Desktop Entry]
  41. Type=Application
  42. Version=7.0
  43. Name=$PROG
  44. Comment=Experiment with formal languages topics
  45. Path=
  46. Exec=$LINK
  47. Icon=/usr/local/share/icons/$PROG.jpg
  48. Terminal=false
  49. Categories=Education;Languages;Java;
  50. EOF
  51. # Get the icons
  52. mkdir -p /usr/local/share/icons
  53. curl -o /usr/local/share/icons/$PROG.jpg $ICON_URL
  54. fi