comparison packaging/linux-createpackage.sh.in @ 1150:a72d59f8c3ea

Create uninstaller.
author Sascha Wilde <wilde@intevation.de>
date Thu, 18 Sep 2014 13:27:57 +0200
parents 45de97d43e13
children e210ecc32d69
comparison
equal deleted inserted replaced
1149:96ecd345c961 1150:a72d59f8c3ea
37 echo "defaulting to x86_64" 37 echo "defaulting to x86_64"
38 ARCH=x86_64 38 ARCH=x86_64
39 fi 39 fi
40 40
41 INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh" 41 INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh"
42 UNINSTALLER="$TMPDIR/bin/trustbridge-deinstall.sh"
42 43
43 EXEFILES=("@CMAKE_BINARY_DIR@/cinst/cinst" 44 EXEFILES=("@CMAKE_BINARY_DIR@/cinst/cinst"
44 "@CMAKE_BINARY_DIR@/cinst/mozilla" 45 "@CMAKE_BINARY_DIR@/cinst/mozilla"
45 "@CMAKE_BINARY_DIR@/ui/trustbridge" 46 "@CMAKE_BINARY_DIR@/ui/trustbridge"
46 "@CMAKE_BINARY_DIR@/ui/trustbridge-tray-starter.sh") 47 "@CMAKE_BINARY_DIR@/ui/trustbridge-tray-starter.sh"
48 "$UNINSTALLER")
47 49
48 ICON="@CMAKE_SOURCE_DIR@/ui/img/logo-128.png" 50 ICON="@CMAKE_SOURCE_DIR@/ui/img/logo-128.png"
49 HELPFILES=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html \ 51 HELPFILES=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html \
50 -maxdepth 1 -type f -printf "%p \n") 52 -maxdepth 1 -type f -printf "%p \n")
51 HELPFILES_STATIC=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html/_static \ 53 HELPFILES_STATIC=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html/_static \
65 install -d "$TMPDIR/share/doc/trustbridge/_sources" 67 install -d "$TMPDIR/share/doc/trustbridge/_sources"
66 install -d "$TMPDIR/share/doc/trustbridge/_images" 68 install -d "$TMPDIR/share/doc/trustbridge/_images"
67 install "${EXEFILES[@]}" "$TMPDIR/bin" 69 install "${EXEFILES[@]}" "$TMPDIR/bin"
68 install "$ICON" "$TMPDIR/share/pixmaps/trustbridge/trustbridge.png" 70 install "$ICON" "$TMPDIR/share/pixmaps/trustbridge/trustbridge.png"
69 71
70 echo "Building $INSTALLER..."
71 cp "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" "$INSTALLER"
72 process_includes "$INSTALLER" "@CMAKE_BINARY_DIR@/packaging"
73
74 binnames="" 72 binnames=""
75 for file in "${EXEFILES[@]}" ; do 73 for file in "${EXEFILES[@]}" ; do
76 binnames="`basename $file` $binnames" 74 binnames="`basename $file` $binnames"
77 done 75 done
78 for file in ${HELPFILES} ; do 76 for file in ${HELPFILES} ; do
90 for file in ${HELPFILES_SOURCES}; do 88 for file in ${HELPFILES_SOURCES}; do
91 install "$file" "$TMPDIR/share/doc/trustbridge/_sources" 89 install "$file" "$TMPDIR/share/doc/trustbridge/_sources"
92 helpnames_sources="`basename $file` $helpnames_sources" 90 helpnames_sources="`basename $file` $helpnames_sources"
93 done 91 done
94 92
93 echo "Building $INSTALLER and $UNINSTALLER ..."
94
95 cp "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" "$INSTALLER"
96 cp "@CMAKE_BINARY_DIR@/packaging/linux-uninstaller.inc" "$UNINSTALLER"
97
98 declare -a INSTALLER_SCRIPTS
99 INSTALLER_SCRIPTS=("$INSTALLER" "$UNINSTALLER")
100
101 for script in "${INSTALLER_SCRIPTS[@]}" ; do
102 process_includes "$script" "@CMAKE_BINARY_DIR@/packaging"
103 sed -i "s/###BINNAMES###/${binnames}/" "$script"
104 sed -i "s/###ICONNAME###/trustbridge.png/" "$script"
105 sed -i "s/###HELPNAMES###/${helpnames}/" "$script"
106 sed -i "s/###HELPNAMES_SOURCES###/${helpnames_sources}/" "$script"
107 sed -i "s/###HELPNAMES_STATIC###/${helpnames_static}/" "$script"
108 sed -i "s/###HELPNAMES_IMG###/${helpnames_img}/" "$script"
109 sed -i "s/###ARCH###/${ARCH}/" "$script"
110 chmod +x "$script"
111 done
112
95 echo "Creating shar archive ..." 113 echo "Creating shar archive ..."
96 cd "$TMPDIR" 114 cd "$TMPDIR"
97 shar -z -B `find -type f` | sed 's/^exit 0//' >>"$TMPSHAR" 115 shar -z -B `find -type f` | sed 's/^exit 0//' >>"$TMPSHAR"
98 116
99 sed -i "s/###BINNAMES###/${binnames}/" "$INSTALLER"
100 sed -i "s/###ICONNAME###/trustbridge.png/" "$INSTALLER"
101 sed -i "/###SHAR###/r $TMPSHAR" "$INSTALLER" 117 sed -i "/###SHAR###/r $TMPSHAR" "$INSTALLER"
102 sed -i "s/###HELPNAMES###/${helpnames}/" "$INSTALLER"
103 sed -i "s/###HELPNAMES_SOURCES###/${helpnames_sources}/" "$INSTALLER"
104 sed -i "s/###HELPNAMES_STATIC###/${helpnames_static}/" "$INSTALLER"
105 sed -i "s/###HELPNAMES_IMG###/${helpnames_img}/" "$INSTALLER"
106 sed -i "s/###ARCH###/${ARCH}/" "$INSTALLER"
107 118
108 chmod +x "$INSTALLER"
109 echo "Signing" 119 echo "Signing"
110 "@CMAKE_SOURCE_DIR@/ui/tests/append-sig.sh" \ 120 "@CMAKE_SOURCE_DIR@/ui/tests/append-sig.sh" \
111 "@CMAKE_SOURCE_DIR@/ui/tests/data/codesign/codesigning.key" \ 121 "@CMAKE_SOURCE_DIR@/ui/tests/data/codesign/codesigning.key" \
112 "$INSTALLER" "${INSTALLER}_signed" 122 "$INSTALLER" "${INSTALLER}_signed"
113 mv "${INSTALLER}_signed" "$INSTALLER" 123 mv "${INSTALLER}_signed" "$INSTALLER"

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