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.4 KiB

  1. #!/bin/bash
  2. # JFLAP installer script for TigerOS
  3. # author: Josh Bicking <jhb2345@rit.edu>
  4. DEPS=java-1.8.0-openjdk
  5. PROG=Logisim
  6. FILE=/usr/share/java/logisim.jar
  7. FILE_URL=https://sourceforge.net/projects/circuit/files/2.3.x/2.3.1/logisim-2.3.1.jar/download
  8. LINK=/usr/local/bin/logisim
  9. ICON_URL=https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Logisim-icon.svg/48px-Logisim-icon.svg.png
  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=2.3.1
  43. Name=$PROG
  44. Comment=A grahical tool for designing and simulating logic circuits.
  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.png $ICON_URL
  54. fi