Browse Source

Fixed install

tags/1.0
Rémi BERTHO 10 months ago
parent
commit
35f33b2c64
Signed by: Rémi BERTHO <remi.bertho@dalan.fr> GPG Key ID: EE3B917931C07B64
1 changed files with 23 additions and 16 deletions
  1. 23
    16
      utility.sh

+ 23
- 16
utility.sh View File

@@ -23,23 +23,30 @@ check_dir()

install()
{
DIR=$1
check_dir "$DIR"
DESTDIR=$1
check_dir "$DESTDIR"
if [ -z "$2" ]; then
PREFIX=$DESTDIR
else
PREFIX="$2"
DESTDIR=$DESTDIR$PREFIX
echo $DESTDIR
fi
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"
mkdir -p "$DESTDIR/share/SimplePanoramaViewer/"
mkdir -p "$DESTDIR/bin/"
mkdir -p "$DESTDIR/share/applications"
mkdir -p "$DESTDIR/share/mime/image"
cp SimplePanoramaViewer "$DESTDIR/share/SimplePanoramaViewer"
cp -r css "$DESTDIR/share/SimplePanoramaViewer"
cp -r html "$DESTDIR/share/SimplePanoramaViewer"
cp -r js "$DESTDIR/share/SimplePanoramaViewer"
cp install/SimplePanoramaViewer.desktop "$DESTDIR/share/applications"
cp install/pjpg.xml "$DESTDIR/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"
$PREFIX/share/SimplePanoramaViewer/SimplePanoramaViewer \"\$@\"" > "$DESTDIR/bin/SimplePanoramaViewer"
chmod a+x "$DESTDIR/bin/SimplePanoramaViewer"
chmod -R a+r "$DESTDIR/share/SimplePanoramaViewer"
}

uninstall()
@@ -80,7 +87,7 @@ case "$1" in
print_help
;;
"-i" | "--install")
install "$2"
install "$2" "$3"
;;
"-u" | "--uninstall")
uninstall "$2"

Loading…
Cancel
Save