Fixed install
This commit is contained in:
parent
4bc4e44db7
commit
35f33b2c64
1 changed files with 23 additions and 16 deletions
39
utility.sh
39
utility.sh
|
@ -23,23 +23,30 @@ check_dir()
|
||||||
|
|
||||||
install()
|
install()
|
||||||
{
|
{
|
||||||
DIR=$1
|
DESTDIR=$1
|
||||||
check_dir "$DIR"
|
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 "$DESTDIR/share/SimplePanoramaViewer/"
|
||||||
mkdir -p "$DIR/bin/"
|
mkdir -p "$DESTDIR/bin/"
|
||||||
mkdir -p "$DIR/share/applications"
|
mkdir -p "$DESTDIR/share/applications"
|
||||||
mkdir -p "$DIR/share/mime/image"
|
mkdir -p "$DESTDIR/share/mime/image"
|
||||||
cp SimplePanoramaViewer "$DIR/share/SimplePanoramaViewer"
|
cp SimplePanoramaViewer "$DESTDIR/share/SimplePanoramaViewer"
|
||||||
cp -r css "$DIR/share/SimplePanoramaViewer"
|
cp -r css "$DESTDIR/share/SimplePanoramaViewer"
|
||||||
cp -r html "$DIR/share/SimplePanoramaViewer"
|
cp -r html "$DESTDIR/share/SimplePanoramaViewer"
|
||||||
cp -r js "$DIR/share/SimplePanoramaViewer"
|
cp -r js "$DESTDIR/share/SimplePanoramaViewer"
|
||||||
cp install/SimplePanoramaViewer.desktop "$DIR/share/applications"
|
cp install/SimplePanoramaViewer.desktop "$DESTDIR/share/applications"
|
||||||
cp install/pjpg.xml "$DIR/share/mime/image"
|
cp install/pjpg.xml "$DESTDIR/share/mime/image"
|
||||||
echo "#!/bin/bash
|
echo "#!/bin/bash
|
||||||
$DIR/share/SimplePanoramaViewer/SimplePanoramaViewer \"\$@\"" > "$DIR/bin/SimplePanoramaViewer"
|
$PREFIX/share/SimplePanoramaViewer/SimplePanoramaViewer \"\$@\"" > "$DESTDIR/bin/SimplePanoramaViewer"
|
||||||
chmod a+x "$DIR/bin/SimplePanoramaViewer"
|
chmod a+x "$DESTDIR/bin/SimplePanoramaViewer"
|
||||||
sudo chmod -R a+r "$DIR/share/SimplePanoramaViewer"
|
chmod -R a+r "$DESTDIR/share/SimplePanoramaViewer"
|
||||||
}
|
}
|
||||||
|
|
||||||
uninstall()
|
uninstall()
|
||||||
|
@ -80,7 +87,7 @@ case "$1" in
|
||||||
print_help
|
print_help
|
||||||
;;
|
;;
|
||||||
"-i" | "--install")
|
"-i" | "--install")
|
||||||
install "$2"
|
install "$2" "$3"
|
||||||
;;
|
;;
|
||||||
"-u" | "--uninstall")
|
"-u" | "--uninstall")
|
||||||
uninstall "$2"
|
uninstall "$2"
|
||||||
|
|
Loading…
Reference in a new issue