1 cat << EOF > "$archname"
3 # This script was generated using Makeself $MS_VERSION
7 TMPROOT=\${TMPDIR:=/tmp}
11 scriptargs="$SCRIPTARGS"
12 targetdir="$archdirname"
13 filesizes="$filesizes"
17 if type printf > /dev/null; then
19 elif test -x /usr/ucb/echo; then
20 print_cmd="/usr/ucb/echo"
27 \$print_cmd \$print_cmd_arg "\$1"
39 blocks=\`expr \$3 / 1024\`
40 bytes=\`expr \$3 % 1024\`
41 dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\
42 { test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\
43 test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null
49 Makeself version $MS_VERSION
50 1) Getting help or info about \$0 :
51 \$0 --help Print this message
52 \$0 --info Print embedded info : title, default target directory, embedded script ...
53 \$0 --lsm Print embedded lsm entry (or no LSM)
54 \$0 --list Print the list of files in the archive
55 \$0 --check Checks integrity of the archive
58 \$0 [options] [--] [additional arguments to embedded script]
59 with following options (in that order)
60 --confirm Ask before running embedded script
61 --noexec Do not run embedded script
62 --keep Do not erase target directory after running
64 --nox11 Do not spawn an xterm
65 --nochown Do not give the extracted files to the current user
66 --target NewDirectory Extract in NewDirectory
67 --tar arg1 [arg2 ...] Access the contents of the archive through the tar command
68 -- Following arguments will be passed to the embedded script
75 PATH=\${GUESS_MD5_PATH:-"\$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"}
76 MD5_PATH=\`exec 2>&-; which md5sum || type md5sum\`
77 MD5_PATH=\${MD5_PATH:-\`exec 2>&-; which md5 || type md5\`}
79 MS_Printf "Verifying archive integrity..."
80 offset=\`head -n $SKIP "\$1" | wc -c | tr -d " "\`
85 crc=\`echo \$CRCsum | cut -d" " -f\$i\`
86 if test -x "\$MD5_PATH"; then
87 md5=\`echo \$MD5 | cut -d" " -f\$i\`
88 if test \$md5 = "00000000000000000000000000000000"; then
89 test x\$verb = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2
91 md5sum=\`MS_dd "\$1" \$offset \$s | "\$MD5_PATH" | cut -b-32\`;
92 if test "\$md5sum" != "\$md5"; then
93 echo "Error in MD5 checksums: \$md5sum is different from \$md5" >&2
96 test x\$verb = xy && MS_Printf " MD5 checksums are OK." >&2
98 crc="0000000000"; verb=n
101 if test \$crc = "0000000000"; then
102 test x\$verb = xy && echo " \$1 does not contain a CRC checksum." >&2
104 sum1=\`MS_dd "\$1" \$offset \$s | CMD_ENV=xpg4 cksum | awk '{print \$1}'\`
105 if test "\$sum1" = "\$crc"; then
106 test x\$verb = xy && MS_Printf " CRC checksums are OK." >&2
108 echo "Error in checksums: \$sum1 is different from \$crc"
113 offset=\`expr \$offset + \$s\`
120 tar \$1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; }
140 echo Identification: "\$label"
141 echo Target directory: "\$targetdir"
142 echo Uncompressed size: $USIZE KB
143 echo Compression: $COMPRESS
144 echo Date of packaging: $DATE
145 echo Built with Makeself version $MS_VERSION on $OSTYPE
146 echo Build command was: "$MS_COMMAND"
147 if test x\$script != x; then
148 echo Script run after extraction:
149 echo " " \$script \$scriptargs
151 if test x"$copy" = xcopy; then
152 echo "Archive will copy itself to a temporary location"
154 if test x"$KEEP" = xy; then
155 echo "directory \$targetdir is permanent"
157 echo "\$targetdir will be removed after extraction"
162 echo LABEL=\"\$label\"
163 echo SCRIPT=\"\$script\"
164 echo SCRIPTARGS=\"\$scriptargs\"
165 echo archdirname=\"$archdirname\"
167 echo COMPRESS=$COMPRESS
168 echo filesizes=\"\$filesizes\"
169 echo CRCsum=\"\$CRCsum\"
170 echo MD5sum=\"\$MD5\"
172 echo OLDSKIP=`expr $SKIP + 1`
179 cat << EOF >> "$archname"
184 echo Target directory: \$targetdir
185 offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
188 MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | UnTAR t
189 offset=\`expr \$offset + \$s\`
194 offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
199 MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | tar "\$arg1" - \$*
200 offset=\`expr \$offset + \$s\`
234 finish="echo Press Return to close this window...; read junk"
246 echo Unrecognized flag : "\$1" >&2
257 tmpdir=\$TMPROOT/makeself.\$RANDOM.\`date +"%y%m%d%H%M%S"\`.\$\$
258 mkdir "\$tmpdir" || {
259 echo "Could not create temporary directory \$tmpdir" >&2
262 SCRIPT_COPY="\$tmpdir/makeself"
263 echo "Copying to a temporary location..." >&2
264 cp "\$0" "\$SCRIPT_COPY"
265 chmod +x "\$SCRIPT_COPY"
267 exec "\$SCRIPT_COPY" --phase2
270 finish="\$finish ; rm -rf \`dirname \$0\`"
274 if test "\$nox11" = "n"; then
275 if tty -s; then # Do we have a terminal?
278 if test x"\$DISPLAY" != x -a x"\$xterm_loop" = x; then # No, but do we have X?
279 if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable
280 GUESS_XTERMS="xterm rxvt dtterm eterm Eterm kvt konsole aterm"
281 for a in \$GUESS_XTERMS; do
282 if type \$a >/dev/null 2>&1; then
287 chmod a+x \$0 || echo Please add execution rights on \$0
288 if test \`echo "\$0" | cut -c1\` = "/"; then # Spawn a terminal!
289 exec \$XTERM -title "\$label" -e "\$0" --xwin "\$initargs"
291 exec \$XTERM -title "\$label" -e "./\$0" --xwin "\$initargs"
298 if test "\$targetdir" = "."; then
301 if test "\$keep" = y; then
302 echo "Creating directory \$targetdir" >&2
306 tmpdir="\$TMPROOT/selfgz\$\$\$RANDOM"
309 mkdir \$dashp \$tmpdir || {
310 echo 'Cannot create target directory' \$tmpdir >&2
311 echo 'You should try option --target OtherDirectory' >&2
318 if test x\$SETUP_NOCHECK != x1; then
321 offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
323 if test x"\$verbose" = xy; then
324 MS_Printf "About to extract $USIZE KB in \$tmpdir ... Proceed ? [Y/n] "
326 if test x"\$yn" = xn; then
327 eval \$finish; exit 1
331 MS_Printf "Uncompressing \$label"
333 if test "\$keep" = n; then
334 trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf \$tmpdir; eval \$finish; exit 15' 1 2 3 15
339 if MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | ( cd "\$tmpdir"; UnTAR x ) | MS_Progress; then
340 if test x"\$ownership" = xy; then
341 (PATH=/usr/xpg4/bin:\$PATH; cd "\$tmpdir"; chown -R \`id -u\` .; chgrp -R \`id -g\` .)
345 echo "Unable to decompress \$0" >&2
346 eval \$finish; exit 1
348 offset=\`expr \$offset + \$s\`
354 if test x"\$script" != x; then
355 if test x"\$verbose" = xy; then
356 MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] "
358 if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then
359 eval \$script \$scriptargs \$*; res=\$?;
362 eval \$script \$scriptargs \$*; res=\$?
364 if test \$res -ne 0; then
365 test x"\$verbose" = xy && echo "The program '\$script' returned an error code (\$res)" >&2
368 if test "\$keep" = n; then
372 eval \$finish; exit \$res