File: uninstall.sh

package info (click to toggle)
gjots2 3.0.2-0.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,804 kB
  • sloc: python: 4,256; sh: 957; xml: 194; makefile: 11
file content (42 lines) | stat: -rwxr-xr-x 1,325 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash

# Use this if you installed with setup.py

# Python's setup.py provides no uninstallation method so here is
# something to help:

usage() {
	echo "Usage: $PROG [prefix]"
	echo
	echo "<prefix> is the location which was used to install with setup.py (default is /usr)"
	echo "eg $PROG /usr/local"
}

PROG=$(basename "$0")

TEMP=$(getopt -o h --long help -n '$PROG' -- "$@") || exit $?

eval set -- "$TEMP"
while true ; do
	case $1 in
		-h|--help) usage; exit 0;;
		--) shift; break;;
		*) echo "Internal error!" >&2 ; exit 1 ;;
	esac
done

prefix=${1:-"/usr"}

[[ -f $prefix/bin/gjots2 ]] || {
	echo "gjots2 was not found at $prefix/bin" >&2
	exit 1
}

rm -rf $prefix/lib/gjots2 $prefix/share/doc/gjots2-* $prefix/share/gjots2
rm -f $prefix/bin/gjots2html $prefix/bin/docbook2gjots $prefix/bin/gjots2 $prefix/bin/gjots2docbook $prefix/bin/gjots2lpr
rm -f $prefix/share/man/man1/gjots2html.1 $prefix/share/man/man1/docbook2gjots.1 $prefix/share/man/man1/gjots2.1 $prefix/share/man/man1/gjots2docbook.1
rm -f $prefix/share/pixmaps/gjots.png $prefix/share/applications/gjots2.desktop
rm -f $prefix/share/glib-2.0/schemas/org.gtk.gjots2.gschema.xml $prefix/share/appdata/gjots2.appdata.xml
for LOCALE in en_US fr no nb ru cs it es sl sv de_DE; do
	rm -f $prefix/share/locale/$LOCALE/LC_MESSAGES/gjots2.mo
done