summaryrefslogtreecommitdiff
path: root/tools/linux_packaging/uninstall.sh.in
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-02-07 21:16:24 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-02-07 21:16:24 +0000
commit1a7ef6b3da9db3d55977efa5471fec3dd0fc456e (patch)
treebb5fb8faac71c171476a5a6834dcb9433c431a6b /tools/linux_packaging/uninstall.sh.in
parent368e656e661cd3236a4bfdc319d9d45cca2be39e (diff)
add uninstaller from 2.0-ongoing
git-svn-id: svn://localhost/ardour2/branches/3.0@8759 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'tools/linux_packaging/uninstall.sh.in')
-rw-r--r--tools/linux_packaging/uninstall.sh.in83
1 files changed, 83 insertions, 0 deletions
diff --git a/tools/linux_packaging/uninstall.sh.in b/tools/linux_packaging/uninstall.sh.in
new file mode 100644
index 0000000000..700594b94c
--- /dev/null
+++ b/tools/linux_packaging/uninstall.sh.in
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+######################################
+#
+# Ardour/Mixbus bundle uninstaller
+# Todd Naugle
+#
+#####################################
+
+
+PGM_NAME="%REPLACE_PGM%"
+PGM_VENDOR="%REPLACE_VENDOR%"
+PGM_VERSION="%REPLACE_VERSION%"
+PGM_BUILD="%REPLACE_BUILD%"
+
+INSTALL_DEST_BASE=/opt
+
+
+#### Derived Variables ####
+PGM_PATH=${INSTALL_DEST_BASE}/${PGM_NAME}-${PGM_VERSION}_${PGM_BUILD}
+
+ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}" #no dash between name and version since seperates vendor from program
+MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}.desktop" #no dash between name and version since seperates vendor from program
+DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}.desktop"
+MENU_FILE_PATH="${PGM_PATH}/share/${MENU_FILE}"
+
+
+#######################
+# Check for xdg utils
+#######################
+HAS_XDG="T"
+
+XDG_MENU_VER=$(xdg-desktop-menu --version 2> /dev/null)
+if [ -z "$XDG_MENU_VER" ];
+then
+ echo "System does not have xdg-desktop-menu installed"
+ HAS_XDG="F"
+fi
+
+XDG_ICON_VER=$(xdg-icon-resource --version 2> /dev/null)
+if [ -z "$XDG_ICON_VER" ];
+then
+ echo "System does not have xdg-icon-resource installed"
+ HAS_XDG="F"
+fi
+
+
+#############
+# Uninstall
+#############
+
+if [ -d ${PGM_PATH} ];
+then
+ echo ""
+ echo "Removing existing ${PGM_NAME} installation at ${PGM_PATH}"
+ echo ""
+
+ if [ "T" = ${HAS_XDG} ];
+ then
+ sudo xdg-desktop-menu uninstall ${MENU_FILE_PATH}
+ sudo xdg-icon-resource uninstall --size 16 ${ICON_NAME}
+ sudo xdg-icon-resource uninstall --size 22 ${ICON_NAME}
+ sudo xdg-icon-resource uninstall --size 32 ${ICON_NAME}
+ sudo xdg-icon-resource uninstall --size 48 ${ICON_NAME}
+
+ if [ -e /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg ];
+ then
+ sudo rm -f /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg
+ fi
+ fi
+
+ if [ -e ~/Desktop/${DESKTOP_LINK_FILE} ];
+ then
+ sudo rm -f ~/Desktop/${DESKTOP_LINK_FILE}
+ fi
+
+ # delete the old package
+ sudo rm -rf ${PGM_PATH}
+else
+ echo ""
+ echo "!!! FAILURE !!! - install path ${PGM_PATH} does not exist."
+ echo ""
+fi