Browse Source

Merge pull request #23 from Josh1147582/devel

Fix name in JFLAP, add IDEA & demo removal
website
Aidan Kahrs 7 years ago
committed by GitHub
parent
commit
9fff6f977b
3 changed files with 110 additions and 17 deletions
  1. +75
    -0
      scripts/cs/idea.sh
  2. +29
    -15
      scripts/cs/jflap.sh
  3. +6
    -2
      scripts/postinstall

+ 75
- 0
scripts/cs/idea.sh View File

@ -0,0 +1,75 @@
#!/bin/sh -e
# IntelliJ installer script for TigerOS
# author: Josh Bicking <jhb2345@rit.edu>
DEPS=java-1.8.0-openjdk
PROG="IntelliJ IDEA Community Edition"
PROG_SHORT=idea-ce
VERSION=idea-IC-171.4073.35
TEMP_FILE=/tmp/ideaIC-2017.1.1.tar.gz
FILE_DIR=/usr/local
FILE=$FILE_DIR/$VERSION/bin/idea.sh
FILE_URL=https://download.jetbrains.com/idea/ideaIC-2017.1.1.tar.gz
LINK=$FILE_DIR/bin/$PROG_SHORT
ICON=$FILE_DIR/$VERSION/bin/idea.png
# Check that the current user is root
if [ $EUID != 0 ]
then
echo "Please run this script as root (sudo $@$0)."
exit
fi
## Removal
# Check if remove flag was passed
if [ ! -z "$1" ] && [ "$1" = "--remove" ]
then
rm $LINK
rm /usr/local/share/applications/jetbrains-idea-ce.desktop
rm -rf $FILE_DIR/$VERSION
# Remove local links if they were created
for i in `ls /home/`
do
rm -f /home/$i/.local/share/applications/jetbrains-idea-ce.desktop
done
else
## Installation
# Install dependencies
dnf install $DEPS -y
# Get the files
wget -O $TEMP_FILE $FILE_URL
# Extract the files
tar -xf $TEMP_FILE -C $FILE_DIR
# Make a link
ln -s $FILE $LINK
chmod +x $LINK
chmod -R 755 $FILE_DIR/$VERSION
# Make a desktop file
# 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.
cat > /usr/local/share/applications/jetbrains-idea-ce.desktop <<EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=$PROG
Comment=The Drive to Develop
Exec=$LINK %f
Icon=$ICON
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=jetbrains-idea-ce
EOF
# Clean up
rm $TEMP_FILE
fi

+ 29
- 15
scripts/cs/jflap.sh View File

@ -4,7 +4,7 @@
# author: Josh Bicking <jhb2345@rit.edu>
DEPS=java-1.8.0-openjdk
PROG=Alloy
PROG=JFLAP
FILE=/usr/share/java/JFLAP.jar
FILE_URL=http://www.jflap.org/jflaptmp/may15-2011/withoutSource/JFLAP.jar
LINK=/usr/local/bin/jflap
@ -18,25 +18,38 @@ then
exit
fi
# Install dependencies
dnf install $DEPS -y
## Removal
# Check if remove flag was passed
if [ ! -z "$1" ] && [ "$1" = "--remove" ]
then
# Get the files
curl -o $FILE $FILE_URL
rm $LINK
rm /usr/local/share/applications/$PROG.desktop
rm $FILE
rm /usr/local/share/icons/$PROG.jpg
# Make a link
cat > $LINK <<EOF
else
## Installation
# Install dependencies
dnf install $DEPS -y
# Get the files
curl -o $FILE $FILE_URL
# Make a link
cat > $LINK <<EOF
#!/bin/sh
cd \$HOME
java -jar $FILE
EOF
chmod +x $LINK
chmod +x $FILE
chmod +x $LINK
chmod +x $FILE
# Make a desktop file
cat > /usr/local/share/applications/$PROG.desktop <<EOF
# Make a desktop file
cat > /usr/local/share/applications/$PROG.desktop <<EOF
[Desktop Entry]
Type=Application
Version=7.0
@ -48,7 +61,8 @@ Icon=/usr/local/share/icons/$PROG.jpg
Terminal=false
Categories=Education;Languages;Java;
EOF
# Get the icons
mkdir -p /usr/local/share/icons
curl -o /usr/local/share/icons/$PROG.jpg $ICON_URL
# Get the icons
mkdir -p /usr/local/share/icons
curl -o /usr/local/share/icons/$PROG.jpg $ICON_URL
fi

+ 6
- 2
scripts/postinstall View File

@ -21,7 +21,7 @@ do
case $opt in
"CS")
echo -e "Welcome to the TigerOS CS package installer script.\n
This script will install Intellij, PyCharm, prolog, racket and JFLAP on your machine."
This script will install Intellij IDEA, PyCharm, PROLOG, Racket and JFLAP on your machine."
while true; do
read -p "Do you wish to continue? [y/n] " yn
case $yn in
@ -29,7 +29,11 @@ do
[Nn]* ) exit;;
esac
done
#call/execute installer scripts here.
./cs/idea.sh
# TODO Pycharm
# TODO PROLOG
# TODO Racket
./cs/jflap.sh
;;
"IT/WMC")
echo -e "Welcome to the TigerOS IT/WMC package installer script.

Loading…
Cancel
Save