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.

86 lines
1.5 KiB

  1. #!/bin/sh -e
  2. ## JFLAP v7
  3. DEPS=java-1.8.0-openjdk
  4. PROG=JFLAP
  5. DIR=/usr/share/java/JFLAP
  6. FILE=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. # Install dependencies
  17. dnf install $DEPS -y
  18. # Make the dirs
  19. mkdir -p $DIR
  20. # Get the files
  21. curl -o $DIR/$FILE $FILE_URL
  22. # Make a link
  23. cat > $LINK <<EOF
  24. #!/bin/sh
  25. cd \$HOME
  26. java -jar $DIR/$FILE
  27. EOF
  28. chmod +x $LINK
  29. chmod +x $DIR/$FILE
  30. # Make a desktop file
  31. cat > /usr/local/share/applications/$PROG.desktop <<EOF
  32. [Desktop Entry]
  33. # The type as listed above
  34. Type=Application
  35. # The version of the desktop entry specification to which this file complies
  36. Version=7.0
  37. # The name of the application
  38. Name=$PROG
  39. # A comment which can/will be used as a tooltip
  40. Comment=Experiment with formal languages topics
  41. # The path to the folder in which the executable is run
  42. Path=
  43. # The executable of the application, possibly with arguments.
  44. Exec=$LINK
  45. # The name of the icon that will be used to display this entry
  46. Icon=/usr/local/share/icons/$PROG.jpg
  47. # Describes whether this application needs to be run in a terminal or not
  48. Terminal=false
  49. # Describes the categories in which this entry should be shown
  50. Categories=Education;Languages;Java;
  51. EOF
  52. # Get the icons
  53. mkdir -p /usr/local/share/icons
  54. curl -o /usr/local/share/icons/$PROG.jpg $ICON_URL