Fixed install

This commit is contained in:
Rémi BERTHO 2018-11-20 22:21:19 +01:00
parent 4bc4e44db7
commit 35f33b2c64
Signed by: dalan
GPG key ID: EE3B917931C07B64

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"