Browse Source

Add linux install

master
Rémi BERTHO 7 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 @@
1
+[Desktop Entry]
2
+Version=1.0
3
+Type=Application
4
+Name=SimplePanoramaViewer
5
+Comment=Simple web based panoram viewer
6
+Icon=emblem-photos
7
+Exec=SimplePanoramaViewer
8
+NoDisplay=false
9
+Categories=Graphics;Viewer
10
+StartupNotify=false
11
+Terminal=false
12
+MimeType=image/jpeg;image/pjpg

+ 10
- 0
install/pjpg.xml View File

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

+ 68
- 0
utility.sh View File

@@ -0,0 +1,68 @@
1
+#!/bin/bash
2
+
3
+print_help()
4
+{
5
+	echo "SimplePanoramaViewer utility script"
6
+	echo
7
+	echo "Use:"
8
+	echo "  bash utility.sh OPTION [PATH_TO_INSTALL_DIR]"
9
+	echo
10
+	echo "Options:"
11
+	echo "  -i, --install          Install SimplePanoramaViewer in PATH_TO_INSTALL_DIR"
12
+	echo "  -u, --uninstall        Uninstall SimplePanoramaViewer frome PATH_TO_INSTALL_DIR"
13
+}
14
+
15
+check_dir()
16
+{
17
+	if [ -z "$1" ]; then
18
+	   echo "You need to pass a directory"
19
+	   exit
20
+	fi
21
+}
22
+
23
+install()
24
+{
25
+	DIR=$1
26
+	check_dir "$DIR"
27
+	
28
+	mkdir -p "$DIR/share/SimplePanoramaViewer/"
29
+	mkdir -p "$DIR/bin/"
30
+	mkdir -p "$DIR/share/applications"
31
+	mkdir -p "$DIR/share/mime/image"
32
+	cp SimplePanoramaViewer "$DIR/share/SimplePanoramaViewer"
33
+	cp -r css "$DIR/share/SimplePanoramaViewer"
34
+	cp -r html "$DIR/share/SimplePanoramaViewer"
35
+	cp -r js "$DIR/share/SimplePanoramaViewer"
36
+	cp install/SimplePanoramaViewer.desktop "$DIR/share/applications"
37
+	cp install/pjpg.xml "$DIR/share/mime/image"
38
+	echo "#!/bin/bash
39
+	$DIR/share/SimplePanoramaViewer/SimplePanoramaViewer \"\$@\"" > "$DIR/bin/SimplePanoramaViewer"
40
+	chmod a+x "$DIR/bin/SimplePanoramaViewer"
41
+	sudo chmod -R a+r "$DIR/share/SimplePanoramaViewer"
42
+}
43
+
44
+uninstall()
45
+{
46
+	DIR=$1
47
+	check_dir "$DIR"
48
+	
49
+	rm "$DIR/bin/SimplePanoramaViewer"
50
+	rm -r "$DIR/share/SimplePanoramaViewer/"
51
+	rm "$DIR/share/applications/SimplePanoramaViewer.desktop"
52
+	rm "$DIR/share/mime/image/pjpg.xml"
53
+}
54
+
55
+case "$1" in
56
+	"-h" | "--help")
57
+		print_help
58
+		;;
59
+	"-i" | "--install")
60
+		install "$2"
61
+		;;
62
+	"-u" | "--uninstall")
63
+		uninstall "$2"
64
+		;;
65
+	*)
66
+		print_help
67
+		;;
68
+esac

Loading…
Cancel
Save