From f45517b22ffcdb4f53560c5112dcd2dc11bf97e0 Mon Sep 17 00:00:00 2001
From: David Jezek <david.jezek@@vsb.cz>
Date: Mon, 2 Sep 2024 11:42:28 +0200
Subject: [PATCH] feat: add squirrel

---
 swi-install.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 57 insertions(+), 7 deletions(-)

diff --git a/swi-install.sh b/swi-install.sh
index fc75de2..2b6b7ce 100755
--- a/swi-install.sh
+++ b/swi-install.sh
@@ -182,6 +182,7 @@ function installEclipseInstance(){
     local iconUrl=$8
     local altSrcDirName=${9:-eclipse}
     local altRunName=${10:-eclipse}
+    local wmClass=${11:-Eclipse}
 
  	echo '============>Installing eclipse '$suffix' .....==========================================================================================================='
     downloadAndExtractEclipse $suffix $url $altSrcDirName
@@ -207,7 +208,7 @@ EOF
 			sudo chmod +x /opt/eclipse-$suffix/$altRunName
 		fi
 	fi
-    createLauncher eclipse-$suffix "$niceName" /opt/eclipse-$suffix/$altRunName /opt/eclipse-$suffix/$icon "$description" false Eclipse
+    createLauncher eclipse-$suffix "$niceName" /opt/eclipse-$suffix/$altRunName /opt/eclipse-$suffix/$icon "$description" false $wmClass
  	echo '============>Eclipse '$suffix' installed.==========================================================================================================='
 }
 
@@ -616,12 +617,19 @@ org.sf.feeling.decompiler.vineflower.feature.group" \
 "Eclipse Java" icon.xpm "Eclipse for Java Developers"
 }
 
+function uninstallEclipsePapyrus(){
+	sudo rm -R  /opt/eclipse-papyrus
+	sudo rm /usr/share/applications/papyrus-designer.desktop
+}
+
 function installEclipsePapyrus(){
-	######Install Eclipse for JAVA development packages
-    installEclipseInstance papyrus https://mirror.leitecastro.com/eclipse/modeling/mdt/papyrus/rcp/2024-06/6.7.0/papyrus-2024-06-6.7.0-linux64.tar.gz \
-"https://download.eclipse.org/modeling/mdt/papyrus/updates/releases/2024-06/" \
-"org.eclipse.papyrus.sdk.feature.feature.group" \
-"Eclipse Papyrus" icon.xpm "Eclipse Papyrus" - Papyrus papyrus
+	
+	echo '============>Installing eclipse papyrus designer .....==========================================================================================================='
+    downloadAndExtract /opt eclipse-papyrus.tar.gz papyrus-designer eclipse-papyrus https://eclipse.mirror.liteserver.nl/modeling/mdt/papyrus/components/designer/releases/3.1.0/rcps/products/org.eclipse.papyrus.designer.product-linux.gtk.x86_64.tar.gz
+    doConfig papyrus papyrus-designer
+    createLauncher papyrus-designer "Papyrus Designer" /opt/eclipse-papyrus/papyrus-designer /opt/eclipse-papyrus/icon.xpm "Eclipse Papyrus Designer - UML tool" false Papyrus
+ 	echo '============>Eclipse '$suffix' installed.==========================================================================================================='
+
 }
 
 function installEclipseEE(){
@@ -648,7 +656,7 @@ org.sf.feeling.decompiler.vineflower.feature.group,\
 org.thymeleaf.extras.eclipse.contentassist.feature.feature.group,\
 org.thymeleaf.extras.eclipse.contentassist.feature.source.feature.group,\
 de.jcup.yamleditor.feature.group" \
-"Eclipse EE" eclipse-ee.png "Eclipse for EE Developers" https://www.eclipse.org/webtools/images/wtp_logo_2010.png
+"Eclipse EE" icon.xpm "Eclipse for EE Developers" https://www.eclipse.org/webtools/images/wtp_logo_2010.png
 }
 
 function installVagrant(){
@@ -762,6 +770,48 @@ EOF
 sudo dconf update
 }
 
+function uninstallSquirreL(){
+	echo '============>Uninstalling SquirreL .....==========================================================================================================='
+	sudo rm -R /opt/squirrel*
+	removeLauncher squirrel
+	echo '============>SquirreL uninstalled.==========================================================================================================='
+}
+
+function installSquirreL(){
+	echo '============>Installing SquirreL .....==========================================================================================================='
+	wget -O squirrelsql-4.7.1-optional.zip https://github.com/squirrel-sql-client/squirrel-sql-stable-releases/releases/download/4.7.1-a_plainzip/squirrelsql-4.7.1-optional.zip
+	sudo unzip -d /opt squirrelsql-4.7.1-optional.zip
+    rm squirrelsql-4.7.1-optional.zip
+	sudo chmod +x /opt/squirrelsql-4.7.1-optional/squirrel-sql.sh
+	
+	
+	wget -O derby.tar.gz https://dlcdn.apache.org//db/derby/db-derby-10.17.1.0/db-derby-10.17.1.0-lib.tar.gz
+	tar --warning=no-unknown-keyword -xz -f derby.tar.gz
+	rm derby.tar.gz
+	sudo mv db-derby*/lib/derbyclient.jar db-derby*/lib/derbyLocale* db-derby*/lib/derbyshared.jar db-derby*/lib/derbytools.jar /opt/squirrelsql-4.7.1-optional/lib/
+	rm -R db-derby*
+	
+	sudo wget -O /opt/squirrelsql-4.7.1-optional/lib/h2-2.3.232.jar https://search.maven.org/remotecontent?filepath=com/h2database/h2/2.3.232/h2-2.3.232.jar
+	
+	wget -O mysql.tar.gz https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-j-9.0.0.tar.gz
+	tar --warning=no-unknown-keyword -xz -f mysql.tar.gz
+	rm mysql.tar.gz
+	sudo mv mysql-connector*/mysql-connector-j*.jar /opt/squirrelsql-4.7.1-optional/lib/
+	rm -R mysql*
+	
+	wget -O oracle.tar.gz https://download.oracle.com/otn-pub/otn_software/jdbc/235/ojdbc11-full.tar.gz
+	mkdir ojdbc
+	tar --warning=no-unknown-keyword -xz -C ojdbc -f oracle.tar.gz
+	rm oracle.tar.gz
+	sudo mv ojdbc/*.jar /opt/squirrelsql-4.7.1-optional/lib/
+	rm -Rf ojdbc
+	
+	sudo wget -O /opt/squirrelsql-4.7.1-optional/lib/postgresql-42.7.4.jar https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.4/postgresql-42.7.4.jar
+	
+	createLauncher squirrel "SQuirreL SQL client" /opt/squirrelsql-4.7.1-optional/squirrel-sql.sh /opt/squirrelsql-4.7.1-optional/icons/acorn.icns "SQuirreL SQL client in Java" false net-sourceforge-squirrel_sql-client-Main
+	echo '============>SquirreL installed.==========================================================================================================='
+}
+
 function installAll() {
 	sudo apt -y install geany
 	sudo apt -y install git gitk git-gui kdiff3 krusader unrar rar 7zip
-- 
GitLab