#!/bin/bash
set -e;
echo "Setting up symlinks ...";
mkdir -p /usr/local/bin;
ln -nsf /opt/OpenVSP/vsp /usr/local/bin/vsp;
ln -nsf /opt/OpenVSP/vspaero /usr/local/bin/vspaero;
ln -nsf /opt/OpenVSP/vspscript /usr/local/bin/vspscript;
ln -nsf /opt/OpenVSP/vspslicer /usr/local/bin/vspslicer;
ln -nsf /opt/OpenVSP/vspviewer /usr/local/bin/vspviewer;
echo "Setting up desktop entry ...";
ln -nsf /opt/OpenVSP/vspIcon.png /usr/share/pixmaps/vspIcon.png
cat >| /usr/share/applications/vsp.desktop <<EOL
[Desktop Entry]
Type=Application
Version=1.0
Name=OpenVSP
Comment=Parametric aircraft geometry tool
Icon=/usr/share/pixmaps/vspIcon.png
Exec=/usr/local/bin/vsp %u
Terminal=false
Categories=Education;Science;Physics;Engineering;
Keywords=airfoil;aircraft;model;design;
EOL
chmod +x /usr/share/applications/vsp.desktop;
desktop-file-install /usr/share/applications/vsp.desktop;
