From 7e0237722ab163d5a47bacb97feb0350ef81a5d2 Mon Sep 17 00:00:00 2001 From: Josh Bicking Date: Sat, 15 Apr 2017 19:17:53 -0400 Subject: [PATCH 1/5] Fix name in JFLAP, add IDEA & demo removal --- scripts/cs/idea.sh | 75 +++++++++++++++++++++++++++++++++++++++++++++ scripts/cs/jflap.sh | 2 +- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 scripts/cs/idea.sh diff --git a/scripts/cs/idea.sh b/scripts/cs/idea.sh new file mode 100644 index 0000000..af2ed86 --- /dev/null +++ b/scripts/cs/idea.sh @@ -0,0 +1,75 @@ +#!/bin/sh -e + +# IntelliJ installer script for TigerOS +# author: Josh Bicking + +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=/usr/share/java/$VERSION/bin/idea.sh +FILE_DIR=/usr/share/java/$VERSION/ +FILE_URL=https://download.jetbrains.com/idea/ideaIC-2017.1.1.tar.gz +LINK=/usr/local/bin/idea-ce +ICON=/usr/share/java/$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 + + # 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 /usr/share/java/ + + # Make a link + ln -s $FILE $LINK + + chmod +x $LINK + chmod -R 755 $FILE_DIR + + # 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 < 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 From e5e4bc915b27109f080171dbb14d548f8946b0c6 Mon Sep 17 00:00:00 2001 From: Aidan Kahrs Date: Sun, 16 Apr 2017 12:36:09 -0400 Subject: [PATCH 2/5] Update idea.sh --- scripts/cs/idea.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cs/idea.sh b/scripts/cs/idea.sh index af2ed86..1c6a3cf 100644 --- a/scripts/cs/idea.sh +++ b/scripts/cs/idea.sh @@ -8,11 +8,11 @@ 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=/usr/share/java/$VERSION/bin/idea.sh -FILE_DIR=/usr/share/java/$VERSION/ +FILE=/usr/local/$VERSION/bin/idea.sh +FILE_DIR=/usr/local/bin/$VERSION/ FILE_URL=https://download.jetbrains.com/idea/ideaIC-2017.1.1.tar.gz LINK=/usr/local/bin/idea-ce -ICON=/usr/share/java/$VERSION/bin/idea.png +ICON=/usr/local/$VERSION/bin/idea.png # Check that the current user is root @@ -24,7 +24,7 @@ fi ## Removal # Check if remove flag was passed -if [ ! -z "$1" ] && [ "$1" = "-remove" ] +if [ ! -z "$1" ] && [ "$1" = "--remove" ] then rm $LINK From e8c816dcc609cce2cfaaf953a78a96011d48ae78 Mon Sep 17 00:00:00 2001 From: Josh Bicking Date: Sun, 16 Apr 2017 13:19:17 -0400 Subject: [PATCH 3/5] Fixes & easier reading for IDEA, removal for JFLAP --- scripts/cs/idea.sh | 14 +++++++------- scripts/cs/jflap.sh | 42 ++++++++++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/scripts/cs/idea.sh b/scripts/cs/idea.sh index 1c6a3cf..69d75b1 100644 --- a/scripts/cs/idea.sh +++ b/scripts/cs/idea.sh @@ -8,11 +8,11 @@ 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=/usr/local/$VERSION/bin/idea.sh -FILE_DIR=/usr/local/bin/$VERSION/ +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=/usr/local/bin/idea-ce -ICON=/usr/local/$VERSION/bin/idea.png +LINK=$FILE_DIR/bin/$PROG_SHORT +ICON=$FILE_DIR/$VERSION/bin/idea.png # Check that the current user is root @@ -29,7 +29,7 @@ if [ ! -z "$1" ] && [ "$1" = "--remove" ] rm $LINK rm /usr/local/share/applications/jetbrains-idea-ce.desktop - rm -rf $FILE_DIR + rm -rf $FILE_DIR/$VERSION # Remove local links if they were created for i in `ls /home/` @@ -46,13 +46,13 @@ else # Get the files wget -O $TEMP_FILE $FILE_URL # Extract the files - tar -xf $TEMP_FILE -C /usr/share/java/ + tar -xf $TEMP_FILE -C $FILE_DIR # Make a link ln -s $FILE $LINK chmod +x $LINK - chmod -R 755 $FILE_DIR + 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. diff --git a/scripts/cs/jflap.sh b/scripts/cs/jflap.sh index 2147658..31ea917 100644 --- a/scripts/cs/jflap.sh +++ b/scripts/cs/jflap.sh @@ -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 < $LINK < /usr/local/share/applications/$PROG.desktop < /usr/local/share/applications/$PROG.desktop < Date: Sun, 16 Apr 2017 15:54:08 -0400 Subject: [PATCH 4/5] Add jFLAP and IDEA to postinstall --- scripts/postinstall | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/postinstall b/scripts/postinstall index 0700577..9fd580a 100644 --- a/scripts/postinstall +++ b/scripts/postinstall @@ -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 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,16 @@ do [Nn]* ) exit;; esac done - #call/execute installer scripts here. + # IDEA + ./cs/idea.sh + # Pycharm + # TODO Pycharm + # PROLOG + # TODO PROLOG + # Racket + # TODO Racket + # JFLAP + ./cs/jflap.sh ;; "IT/WMC") echo -e "Welcome to the TigerOS IT/WMC package installer script. From 763db6688e6d96eef57e58f629c59fe062c2c66e Mon Sep 17 00:00:00 2001 From: Aidan Kahrs Date: Sun, 16 Apr 2017 16:08:06 -0400 Subject: [PATCH 5/5] remove some comments --- scripts/postinstall | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/postinstall b/scripts/postinstall index 9fd580a..8fff7d8 100644 --- a/scripts/postinstall +++ b/scripts/postinstall @@ -21,7 +21,7 @@ do case $opt in "CS") echo -e "Welcome to the TigerOS CS package installer script.\n - This script will install IDEA, 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,15 +29,10 @@ do [Nn]* ) exit;; esac done - # IDEA ./cs/idea.sh - # Pycharm # TODO Pycharm - # PROLOG # TODO PROLOG - # Racket # TODO Racket - # JFLAP ./cs/jflap.sh ;; "IT/WMC") @@ -87,8 +82,8 @@ do [Nn]* ) exit;; esac done - dnf install -y eclipse-jdt ruby sqlite - ./se/spin.sh && ./se/alloy.sh + dnf install -y eclipse-jdt ruby sqlite + ./se/spin.sh && ./se/alloy.sh echo "Install finished" exit ;;