Add linux install
This commit is contained in:
parent
9a508a53dd
commit
67530358a0
3 changed files with 90 additions and 0 deletions
12
install/SimplePanoramaViewer.desktop
Normal file
12
install/SimplePanoramaViewer.desktop
Normal 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
install/pjpg.xml
Normal file
10
install/pjpg.xml
Normal 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
utility.sh
Executable file
68
utility.sh
Executable 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…
Reference in a new issue