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.

85 lines
1.6 KiB

  1. #!/bin/sh -e
  2. ## JFLAP v7
  3. DEPS=java-1.8.0-openjdk
  4. PROG=JFLAP
  5. FILE=JFLAP.jar
  6. FILE_URL=http://www.jflap.org/jflaptmp/may15-2011/withoutSource/JFLAP.jar
  7. PROG_NAME=jflap
  8. ICON_URL=http://jflap.org/jflapLogo2.jpg
  9. # Check that the current user is root
  10. if [ $EUID != 0 ]
  11. then
  12. echo "Please run this script as root (sudo $@$0)."
  13. exit
  14. fi
  15. # Install dependencies
  16. dnf install $DEPS -y
  17. # Make the dirs
  18. mkdir -p /usr/local/$PROG
  19. # Get the files
  20. curl -o /usr/local/$PROG/$FILE $FILE_URL
  21. # Make a link
  22. cat > /usr/local/bin/$PROG_NAME <<EOF
  23. #!/bin/sh
  24. cd \$HOME
  25. java -jar /usr/local/$PROG/$FILE
  26. EOF
  27. chmod +x /usr/local/bin/$PROG_NAME
  28. chmod +x /usr/local/$PROG/$FILE
  29. # Make a desktop file
  30. cat > /usr/local/share/applications/$PROG.desktop <<EOF
  31. [Desktop Entry]
  32. # The type as listed above
  33. Type=Application
  34. # The version of the desktop entry specification to which this file complies
  35. Version=7.0
  36. # The name of the application
  37. Name=$PROG
  38. # A comment which can/will be used as a tooltip
  39. Comment=Experiment with formal languages topics
  40. # The path to the folder in which the executable is run
  41. Path=
  42. # The executable of the application, possibly with arguments.
  43. Exec=/usr/local/bin/jflap
  44. # The name of the icon that will be used to display this entry
  45. Icon=/usr/local/share/icons/$PROG.jpg
  46. # Describes whether this application needs to be run in a terminal or not
  47. Terminal=false
  48. # Describes the categories in which this entry should be shown
  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