diff options
author | Fahim | 2016-02-04 20:40:54 +0530 |
---|---|---|
committer | Fahim | 2016-02-04 20:40:54 +0530 |
commit | 4db6d2d6f6b9d017f0cd03ba92a018bace2c9224 (patch) | |
tree | 017f94aa2aa35939155405510d3d665d14bad381 | |
parent | e278966c739caa65b317102ee3a8e121d612e399 (diff) | |
download | eSim-4db6d2d6f6b9d017f0cd03ba92a018bace2c9224.tar.gz eSim-4db6d2d6f6b9d017f0cd03ba92a018bace2c9224.tar.bz2 eSim-4db6d2d6f6b9d017f0cd03ba92a018bace2c9224.zip |
Improved eSim installation script
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Examples/BJT_amplifier/plot_data_i.txt | 4 | ||||
-rw-r--r-- | Examples/BJT_amplifier/plot_data_v.txt | 14 | ||||
-rw-r--r-- | Examples/Halfwave_Rectifier/plot_data_i.txt | 2 | ||||
-rw-r--r-- | Examples/Halfwave_Rectifier/plot_data_v.txt | 2 | ||||
-rw-r--r-- | VERSION | 3 | ||||
-rwxr-xr-x | esim-start.sh | 5 | ||||
-rwxr-xr-x | esim.desktop | 15 | ||||
-rwxr-xr-x | install-linux.sh | 142 |
9 files changed, 108 insertions, 82 deletions
@@ -1,2 +1,3 @@ *.pyc - +esim-start.sh +esim.desktop diff --git a/Examples/BJT_amplifier/plot_data_i.txt b/Examples/BJT_amplifier/plot_data_i.txt index 0be4359b..b20147de 100644 --- a/Examples/BJT_amplifier/plot_data_i.txt +++ b/Examples/BJT_amplifier/plot_data_i.txt @@ -1,5 +1,5 @@ * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency v1#branch -------------------------------------------------------------------------------- @@ -215,7 +215,7 @@ Index frequency v1#branch 200 1.000000e+04 -5.02835e-03, -2.03142e-05 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency v2#branch -------------------------------------------------------------------------------- diff --git a/Examples/BJT_amplifier/plot_data_v.txt b/Examples/BJT_amplifier/plot_data_v.txt index 93449842..983c00f7 100644 --- a/Examples/BJT_amplifier/plot_data_v.txt +++ b/Examples/BJT_amplifier/plot_data_v.txt @@ -1,5 +1,5 @@ * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency net-_c1-pad1_ -------------------------------------------------------------------------------- @@ -215,7 +215,7 @@ Index frequency net-_c1-pad1_ 200 1.000000e+04 4.959885e-01, -2.02010e-04 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency net-_c1-pad2_ -------------------------------------------------------------------------------- @@ -431,7 +431,7 @@ Index frequency net-_c1-pad2_ 200 1.000000e+04 4.959869e-01, -1.70087e-04 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency net-_c2-pad2_ -------------------------------------------------------------------------------- @@ -647,7 +647,7 @@ Index frequency net-_c2-pad2_ 200 1.000000e+04 1.123580e-05, -2.41284e-03 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency net-_c3-pad2_ -------------------------------------------------------------------------------- @@ -863,7 +863,7 @@ Index frequency net-_c3-pad2_ 200 1.000000e+04 -1.00617e+01, -4.06268e-02 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency net-_r1-pad2_ -------------------------------------------------------------------------------- @@ -1079,7 +1079,7 @@ Index frequency net-_r1-pad2_ 200 1.000000e+04 5.000000e-01, 0.000000e+00 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency net-_r2-pad1_ -------------------------------------------------------------------------------- @@ -1295,7 +1295,7 @@ Index frequency net-_r2-pad1_ 200 1.000000e+04 0.000000e+00, 0.000000e+00 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Wed Aug 19 15:39:21 2015 + AC Analysis Thu Feb 4 15:28:47 2016 -------------------------------------------------------------------------------- Index frequency out -------------------------------------------------------------------------------- diff --git a/Examples/Halfwave_Rectifier/plot_data_i.txt b/Examples/Halfwave_Rectifier/plot_data_i.txt index 86c4c4ea..9664473f 100644 --- a/Examples/Halfwave_Rectifier/plot_data_i.txt +++ b/Examples/Halfwave_Rectifier/plot_data_i.txt @@ -1,5 +1,5 @@ * /home/fossee/downloads/esim-master/examples/halfwave_rectifier/halfwave_rectifier.cir -Transient Analysis Wed Aug 19 15:41:02 2015 +Transient Analysis Wed Feb 3 18:37:24 2016 -------------------------------------------------------------------------------- Index time alli -------------------------------------------------------------------------------- diff --git a/Examples/Halfwave_Rectifier/plot_data_v.txt b/Examples/Halfwave_Rectifier/plot_data_v.txt index 6e6c45b0..983ac3a3 100644 --- a/Examples/Halfwave_Rectifier/plot_data_v.txt +++ b/Examples/Halfwave_Rectifier/plot_data_v.txt @@ -1,5 +1,5 @@ * /home/fossee/downloads/esim-master/examples/halfwave_rectifier/halfwave_rectifier.cir -Transient Analysis Wed Aug 19 15:41:02 2015 +Transient Analysis Wed Feb 3 18:37:24 2016 -------------------------------------------------------------------------------- Index time in out -------------------------------------------------------------------------------- diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..879ef789 --- /dev/null +++ b/VERSION @@ -0,0 +1,3 @@ +1.0.0 +1.0.1 +1.0.2 diff --git a/esim-start.sh b/esim-start.sh deleted file mode 100755 index 6e2617e1..00000000 --- a/esim-start.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /opt/eSim/src/frontEnd - -exec python Application.py diff --git a/esim.desktop b/esim.desktop deleted file mode 100755 index 1fd5ec0c..00000000 --- a/esim.desktop +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Version=0.9 -Name=eSim -Comment=EDA Tools -GenericName=eSim -Keywords=eda-tools -Exec=esim %u -Terminal=false -X-MultipleArgs=false -Type=Application -Icon=/opt/eSim/images/logo.png -Categories=Development; -MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; -StartupNotify=true -Actions=NewWindow;NewPrivateWindow; diff --git a/install-linux.sh b/install-linux.sh index a3df3a28..913c4bcc 100755 --- a/install-linux.sh +++ b/install-linux.sh @@ -19,10 +19,36 @@ # REVISION: --- #=============================================================================== +#All variables goes here +config_dir="$HOME/.esim" +config_file="config.ini" +eSim_Home=`pwd` ngspiceFlag=0 ##All Functions goes here + +function createConfigFile +{ + #Creating config.ini file and adding configuration information + #Check if config file is present + if [ -d $config_dir ];then + rm $config_dir/$config_file && touch $config_dir/$config_file + else + mkdir $config_dir && touch $config_dir/$config_file + fi + + echo "[eSim]" >> $config_dir/$config_file + echo "eSim_HOME = $eSim_Home" >> $config_dir/$config_file + echo "LICENSE = %(eSim_HOME)s/LICENSE" >> $config_dir/$config_file + echo "KicadLib = %(eSim_HOME)s/kicadSchematicLibrary" >> $config_dir/$config_file + echo "IMAGES = %(eSim_HOME)s/images" >> $config_dir/$config_file + echo "VERSION = %(eSim_HOME)s/VERSION" >> $config_dir/$config_file + + +} + + function installNghdl { echo -n "Do you want to install nghdl? (y/n): " @@ -46,6 +72,13 @@ if [ $getNghdl == "y" -o $getNghdl == "Y" ];then ngspiceFlag=1 cd .. fi + #Creating empty eSim_kicad.lib in home directory + if [ -f $HOME/eSim_kicad.lib ];then + echo "eSim_kicad.lib is already available" + else + touch $HOME/eSim_kicad.lib + fi + elif [ $getNghdl == "n" -o $getNghdl == "N" ];then echo "Proceeding without installing nghdl" else @@ -56,12 +89,18 @@ fi function addKicadPPA { - echo "Adding Kicad PPA to install latest Kicad version" #sudo add-apt-repository ppa:js-reynaud/ppa-kicad - ##Updating to Kicad-4 - sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 - sudo apt-get update - + kicadppa="reynaud/kicad-4" + #Checking if ghdl ppa is already exist + grep -h "^deb.*$kicadppa*" /etc/apt/sources.list.d/* > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "Adding kicad-4 PPA to install latest ghdl version" + sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 + sudo apt-get update + else + echo "Kicad-4 is available in synaptic" + fi } function installDependency @@ -104,57 +143,53 @@ function copyKicadLibrary } -function copySourceCode +function createDesktopStartScript { + + #Generating new esim-start.sh + echo "#!/bin/bash" > esim-start.sh + echo "cd $eSim_Home/src/frontEnd" >> esim-start.sh + echo "python Application.py" >> esim-start.sh + + #Make it executable + sudo chmod 755 esim-start.sh + #Copy esim start script + sudo cp -vp esim-start.sh /usr/bin/esim - #Creating eSim directory - esim_loc="/opt/eSim" - - if [ -d "$esim_loc" ];then - #sudo rm -r "$esim_loc" - #sudo mkdir -v "$esim_loc" - - #Copy source code to eSim directory - sudo cp -rvp src/configuration/* "$esim_loc/src/configuration" - sudo cp -rvp src/modelParamXML/* "$esim_loc/src/modelParamXML" - sudo cp -rvp src/modelEditor/* "$esim_loc/src/modelEditor" - sudo cp -rvp src/projManagement/* "$esim_loc/src/projManagement" - sudo cp -rvp src/ngspiceSimulation/* "$esim_loc/src/ngspiceSimulation" - sudo cp -rvp src/kicadtoNgspice/* "$esim_loc/src/kicadtoNgspice" - sudo cp -rvp src/browser/* "$esim_loc/src/browser" - sudo cp -rvp src/frontEnd/* "$esim_loc/src/frontEnd" - sudo cp -rvp src/ngspicetoModelica/* "$esim_loc/src/ngspicetoModelica" - sudp cp -rvp src/pspicetoKicad/* "$esim_loc/src/pspicetoKicad" - sudo cp -rvp kicadSchematicLibrary "$esim_loc" - sudo cp -rvp images "$esim_loc" - else - sudo mkdir -v "$esim_loc" - #Copy source code to eSim directory - sudo cp -rvp src "$esim_loc" - sudo cp -rvp kicadSchematicLibrary "$esim_loc" - sudo cp -rvp images "$esim_loc" - fi - - if [ "$?" -eq 1 ];then - echo "Unable to create /opt/eSim " - exit 1; - else - echo "Created /opt/eSim" - fi + #Generating esim.desktop file + echo "[Desktop Entry]" > esim.desktop + ocopySourcsional Condenser Sound Microphone With Stand Code + getVersion=`tail -1 VERSION` + echo "Version=$getVersion" >> esim.desktop + echo "Name=eSim" >> esim.desktop + echo "Comment=EDA Tools" >> esim.desktop + echo "GenericName=eSim" >> esim.desktop + echo "Keywords=eda-tools" >> esim.desktop + echo "Exec=esim %u" >> esim.desktop + echo "Terminal=false" >> esim.desktop + echo "X-MultipleArgs=false" >> esim.desktop + echo "Type=Application" >> esim.desktop + getIcon="$config_dir/logo.png" + echo "Icon=$getIcon" >> esim.desktop + echo "Categories=Development;" >> esim.desktop + echo "MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;" >> esim.desktop + echo "StartupNotify=true" >> esim.desktop + echo "Actions=NewWindow;NewPrivateWindow;" >> esim.desktop + #Copy desktop icon file to Desktop - cp -vp esim.desktop $HOME/Desktop/ + cp -vp esim.desktop $HOME/Desktop/eSim - #Copy esim start script - sudo cp -vp esim-start.sh /usr/bin/esim - - #Change mode of eSim directory - sudo chmod -R 777 "$esim_loc" + #Copying logo.png to .esim directory to access as icon + cp images/logo.png $config_dir +} +#################################################################### +# MAIN START FROM HERE # +#################################################################### -} ###Checking if file is passsed as argument to script @@ -204,21 +239,23 @@ if [ $option == "--install" ];then echo "Install with proxy" #Calling functions + createConfigFile installNghdl addKicadPPA installDependency copyKicadLibrary - copySourceCode + createDesktopStartScript elif [ $getProxy == "n" -o $getProxy == "N" ];then echo "Install without proxy" #Calling functions + createConfigFile installNghdl addKicadPPA installDependency copyKicadLibrary - copySourceCode + createDesktopStartScript if [ $? -ne 0 ];then echo -e "\n\n\nFreeEDA ERROR: Unable to install required packages. Please check your internet connection.\n\n" @@ -235,7 +272,12 @@ elif [ $option == "--uninstall" ];then echo -n "Are you sure ? As it will remove complete eSim including your subcircuit and model library packages(y/n):" read getConfirmation if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then - sudo rm -rf /opt/eSim/ + sudo rm -rf $HOME/.esim $HOME/Desktop/eSim esim-start.sh esim.desktop /usr/bin/esim + if [ $? -eq 0 ];then + echo "Uninstalled successfully" + else + echo "Error while removing some file/directory.Please remove it manually" + fi elif [ $getConfirmation == "n" -o $getConfirmation == "N" ];then exit 0 else |