Browse Source

Add linux install

tags/1.0
Rémi BERTHO 10 months ago
parent
commit
67530358a0
Signed by: Rémi BERTHO <remi.bertho@dalan.fr> GPG Key ID: EE3B917931C07B64
3 changed files with 90 additions and 0 deletions
  1. 12
    0
      install/SimplePanoramaViewer.desktop
  2. 10
    0
      install/pjpg.xml
  3. 68
    0
      utility.sh

+ 12
- 0
install/SimplePanoramaViewer.desktop View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=SimplePanoramaViewer
Comment=Simple web based panoram viewer
Icon=emblem-photos
Exec=SimplePanoramaViewer
NoDisplay=false
Categories=Graphics;Viewer
StartupNotify=false
Terminal=false
MimeType=image/jpeg;image/pjpg

+ 10
- 0
install/pjpg.xml View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="image/pjpg">
<comment>Panoramic JPEG image</comment>
<comment xml:lang="fr">Image JPEG panoramique</comment>
<glob pattern="*.pjpeg"/>
<glob pattern="*.pjpg"/>
<glob pattern="*.pjpe"/>
</mime-type>
</mime-info>

+ 68
- 0
utility.sh View File

@@ -0,0 +1,68 @@
#!/bin/bash

print_help()
{
echo "SimplePanoramaViewer utility script"
echo
echo "Use:"
echo " bash utility.sh OPTION [PATH_TO_INSTALL_DIR]"
echo
echo "Options:"
echo " -i, --install Install SimplePanoramaViewer in PATH_TO_INSTALL_DIR"
echo " -u, --uninstall Uninstall SimplePanoramaViewer frome PATH_TO_INSTALL_DIR"
}

check_dir()
{
if [ -z "$1" ]; then
echo "You need to pass a directory"
exit
fi
}

install()
{
DIR=$1
check_dir "$DIR"
mkdir -p "$DIR/share/SimplePanoramaViewer/"
mkdir -p "$DIR/bin/"
mkdir -p "$DIR/share/applications"
mkdir -p "$DIR/share/mime/image"
cp SimplePanoramaViewer "$DIR/share/SimplePanoramaViewer"
cp -r css "$DIR/share/SimplePanoramaViewer"
cp -r html "$DIR/share/SimplePanoramaViewer"
cp -r js "$DIR/share/SimplePanoramaViewer"
cp install/SimplePanoramaViewer.desktop "$DIR/share/applications"
cp install/pjpg.xml "$DIR/share/mime/image"
echo "#!/bin/bash
$DIR/share/SimplePanoramaViewer/SimplePanoramaViewer \"\$@\"" > "$DIR/bin/SimplePanoramaViewer"
chmod a+x "$DIR/bin/SimplePanoramaViewer"
sudo chmod -R a+r "$DIR/share/SimplePanoramaViewer"
}

uninstall()
{
DIR=$1
check_dir "$DIR"
rm "$DIR/bin/SimplePanoramaViewer"
rm -r "$DIR/share/SimplePanoramaViewer/"
rm "$DIR/share/applications/SimplePanoramaViewer.desktop"
rm "$DIR/share/mime/image/pjpg.xml"
}

case "$1" in
"-h" | "--help")
print_help
;;
"-i" | "--install")
install "$2"
;;
"-u" | "--uninstall")
uninstall "$2"
;;
*)
print_help
;;
esac

Loading…
Cancel
Save