annotate packaging/linux-installer-common.inc.in @ 1200:7b24109c1a55

Added linebreak in header text of linux-installer.in
author Emanuel Schuetze <emanuel@intevation.de>
date Tue, 23 Sep 2014 09:21:01 +0200
parents bfe305e09e2d
children 014586ef8a84
rev   line source
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
1 #-*-sh-*-
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
2 ME=`basename "$0"`
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
3 DEFAULT_PREFIX="$HOME/TrustBridge"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
4 SYSDEFAULT_PREFIX="/usr/local"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
5 CFGPATH="${XDG_CONFIG_HOME:-$HOME/.config}/BSI"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
6 DATAPATH="${XDG_DATA_HOME:-$HOME/.local/share}/BSI/TrustBridge"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
7 SYSCFGPATH="/etc/TrustBridge"
1166
d824e6890a43 A more informative comment on the SYSDATAPATH fixme.
Sascha Wilde <wilde@intevation.de>
parents: 1150
diff changeset
8 # FIXME: a user independent data path would be nice for system wide
d824e6890a43 A more informative comment on the SYSDATAPATH fixme.
Sascha Wilde <wilde@intevation.de>
parents: 1150
diff changeset
9 # installations, but we wont open this can of worms for now.
d824e6890a43 A more informative comment on the SYSDATAPATH fixme.
Sascha Wilde <wilde@intevation.de>
parents: 1150
diff changeset
10 # So we assume the system wide installation is always used and
d824e6890a43 A more informative comment on the SYSDATAPATH fixme.
Sascha Wilde <wilde@intevation.de>
parents: 1150
diff changeset
11 # maintained by the same user.
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
12 SYSDATAPATH="$DATAPATH"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
13 INSTCFGNAME="TrustBridge-inst.cfg"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
14 FORCE=0
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
15 SYSINST=0
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
16 DEINSTALL=0
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
17 UPDATE=0
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
18 BINNAMES="###BINNAMES###"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
19 ICONNAME="###ICONNAME###"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
20 HELPNAMES="###HELPNAMES###"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
21 HELPNAMES_SOURCES="###HELPNAMES_SOURCES###"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
22 HELPNAMES_STATIC="###HELPNAMES_STATIC###"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
23 HELPNAMES_IMG="###HELPNAMES_IMG###"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
24 ARCH="###ARCH###"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
25
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
26 declare -A instcfg oldinstcfg
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
27 declare inst_default_prefix instdata_path instcfg_path instcfg_file
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
28 instcfg=(
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
29 [TIMESTMP]=`date -u +%Y%m%d%H%M%S`
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
30 [VERSION]='@PROJECT_VERSION@'
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
31 [PREFIX]=''
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
32 )
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
33 oldinstcfg=(
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
34 [TIMESTMP]=''
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
35 [VERSION]=''
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
36 [PREFIX]=''
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
37 )
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
38
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
39 declare -A L10N_DE
1149
96ecd345c961 Split up l10n matching the new split up installer files.
Sascha Wilde <wilde@intevation.de>
parents: 1139
diff changeset
40 ###INCLUDE:linux-installer-common.l10n-de
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
41
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
42 getxt()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
43 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
44 # Poor mans gettext for l10n completely self contained in one shell
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
45 # script.
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
46 MSGID="$1"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
47 shift
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
48 case ${LANGUAGE:-${LC_ALL:-${LC_MESSAGES:-$LANG}}} in
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
49 de*)
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
50 if [ "${L10N_DE[$MSGID]}" ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
51 MSG="${L10N_DE[$MSGID]}"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
52 else
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
53 MSG="$MSGID"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
54 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
55 ;;
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
56 *)
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
57 MSG="$MSGID"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
58 ;;
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
59 esac
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
60
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
61 printf "$MSG" "$@"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
62 }
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
63
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
64 version()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
65 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
66 cat <<EOF
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
67 TrustBridge ${instcfg[VERSION]} Installer
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
68
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
69 Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
70 Software engineering by Intevation GmbH
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
71
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
72 This file is Free Software under the GNU GPL (v>=2)
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
73 and comes with ABSOLUTELY NO WARRANTY!
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
74 See LICENSE.txt for details.
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
75 EOF
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
76 exit 0
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
77 }
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
78
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
79 fatal()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
80 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
81 getxt "$1" >&2
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
82 if [ $DEINSTALL -eq 1 ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
83 getxt "Deinstallation failed.\n" >&2
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
84 else
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
85 getxt "Installation failed.\n" >&2
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
86 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
87 exit 1
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
88 }
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
89
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
90 yorn()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
91 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
92 local c
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
93 while true ; do
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
94 read -n 1 c
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
95 echo
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
96 case "$c" in
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
97 y|Y|j|J)
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
98 return 0
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
99 ;;
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
100 n|N)
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
101 return 1
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
102 ;;
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
103 *)
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
104 getxt >&2 "Answer [Y]es or [N]o:\n"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
105 esac
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
106 done
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
107 }
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
108
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
109 check_priv()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
110 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
111 if [ $SYSINST -eq 1 -a "$UID" -ne 0 ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
112 fatal "System wide installation or deinstallation requires root privileges!\n"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
113 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
114 }
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
115
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
116 init_vars()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
117 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
118 if [ -n "${SUDO_USER-}" ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
119 # Default to system wide installation when running with sudo
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
120 SYSINST=1
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
121 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
122
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
123 if [ $SYSINST -eq 1 ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
124 inst_default_prefix="$SYSDEFAULT_PREFIX"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
125 instcfg_path="${SYSCFGPATH}"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
126 instdata_path="${SYSDATAPATH}"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
127 autostart_path="$(getent passwd "${SUDO_USER}" | cut -d ':' -f 6)/.config/autostart"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
128 startmenu_path="/usr/share/applications"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
129 else
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
130 inst_default_prefix="$DEFAULT_PREFIX"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
131 instcfg_path="${CFGPATH}"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
132 instdata_path="${DATAPATH}"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
133 autostart_path=${XDG_CONFIG_HOME:-~/.config/autostart}
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
134 startmenu_path=${XDG_DATA_HOME:-~/.local/share/applications}
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
135 if [ $DEINSTALL -eq 1 ] ; then
1197
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
136 if [ ! -r ${instcfg_path}/${INSTCFGNAME} ]; then
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
137 if [ -r ${SYSCFGPATH}/${INSTCFGNAME} ]; then
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
138 # Fall back to system uninstallation if no user config found
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
139 SYSINST=1
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
140 init_vars
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
141 check_priv
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
142 fi
1197
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
143 fi
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
144 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
145 fi
1197
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
146 if [ $DEINSTALL -eq 0 ]; then
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
147 # extra bin path not needed on deinstall:
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
148 extra_bin_path=`mktemp --tmpdir -d tmpbin.XXXXXXXXXX`
bfe305e09e2d (issue112) Create extra_bin_path also when system wide installing
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1166
diff changeset
149 fi
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
150 instcfg_file="${instcfg_path}/${INSTCFGNAME}"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
151 HOST_ARCH=$(uname -m)
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
152 }
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
153
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
154 read_oldinstcfg()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
155 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
156 if [ -r "$instcfg_file" ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
157 getxt "Reading '%s' ...\n" "$instcfg_file"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
158 for key in "${!oldinstcfg[@]}" ; do
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
159 oldinstcfg[$key]=`sed -n "/$key/s/[^=]*=\(.*\)/\1/p" "$instcfg_file"`
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
160 done
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
161 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
162 }
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
163
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
164
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
165 setup_cronjob()
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
166 {
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
167 local tmpcrontab=`mktemp`
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
168
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
169 if [ $SYSINST -eq 1 -a "${SUDO_USER+X}" ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
170 local crontabopt="-u $SUDO_USER"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
171 else
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
172 local crontabopt=''
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
173 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
174
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
175 if [ "$1" != "deinstall" ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
176 local trustbridge_tray_starter="${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
177 else
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
178 local trustbridge_tray_starter="${oldinstcfg[PREFIX]}/bin/trustbridge-tray-starter.sh"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
179 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
180
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
181 crontab $crontabopt -l | \
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
182 grep -vF "$trustbridge_tray_starter" \
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
183 >"$tmpcrontab"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
184 if [ "$1" != "deinstall" ] ; then
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
185 echo "$(( $RANDOM / 555 )) 12 * * * \"$trustbridge_tray_starter\"" \
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
186 >>"$tmpcrontab"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
187 fi
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
188 crontab $crontabopt "$tmpcrontab"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
189 rm "$tmpcrontab"
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
190 }

http://wald.intevation.org/projects/trustbridge/