1 cat << EOF > "$archname"
3 # This script was generated using Makeself $MS_VERSION
6 TMPROOT=\${TMPDIR:=/tmp}
10 scriptargs="$SCRIPTARGS"
11 targetdir="$archdirname"
12 filesizes="$filesizes"
16 if type printf > /dev/null; then
18 elif test -x /usr/ucb/echo; then
19 print_cmd="/usr/ucb/echo"
26 \$print_cmd \$print_cmd_arg "\$1"
38 blocks=\`expr \$3 / 1024\`
39 bytes=\`expr \$3 % 1024\`
40 dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\
41 { test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\
42 test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null
48 Makeself version $MS_VERSION
49 1) Getting help or info about \$0 :
50 \$0 --help Print this message
51 \$0 --info Print embedded info : title, default target directory, embedded script ...
52 \$0 --lsm Print embedded lsm entry (or no LSM)
53 \$0 --list Print the list of files in the archive
54 \$0 --check Checks integrity of the archive
57 \$0 [options] [--] [additional arguments to embedded script]
58 with following options (in that order)
59 --confirm Ask before running embedded script
60 --keep Do not erase target directory after running
62 --nox11 Do not spawn an xterm
63 --nochown Do not give the extracted files to the current user
64 --target NewDirectory Extract in NewDirectory
65 --tar arg1 [arg2 ...] Access the contents of the archive through the tar command
66 -- Following arguments will be passed to the embedded script
73 PATH=\${GUESS_MD5_PATH:-"\$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"}
74 MD5_PATH=\`exec 2>&-; which md5sum || type md5sum\`
75 MD5_PATH=\${MD5_PATH:-\`exec 2>&-; which md5 || type md5\`}
77 MS_Printf "Verifying archive integrity..."
78 offset=\`head -n $SKIP "\$1" | wc -c | tr -d " "\`
83 crc=\`echo \$CRCsum | cut -d" " -f\$i\`
84 if test -x "\$MD5_PATH"; then
85 md5=\`echo \$MD5 | cut -d" " -f\$i\`
86 if test \$md5 = "00000000000000000000000000000000"; then
87 test x\$verb = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2
89 md5sum=\`MS_dd "\$1" \$offset \$s | "\$MD5_PATH" | cut -b-32\`;
90 if test "\$md5sum" != "\$md5"; then
91 echo "Error in MD5 checksums: \$md5sum is different from \$md5" >&2
94 test x\$verb = xy && MS_Printf " MD5 checksums are OK." >&2
96 crc="0000000000"; verb=n
99 if test \$crc = "0000000000"; then
100 test x\$verb = xy && echo " \$1 does not contain a CRC checksum." >&2
102 sum1=\`MS_dd "\$1" \$offset \$s | cksum | awk '{print \$1}'\`
103 if test "\$sum1" = "\$crc"; then
104 test x\$verb = xy && MS_Printf " CRC checksums are OK." >&2
106 echo "Error in checksums: \$sum1 is different from \$crc"
111 offset=\`expr \$offset + \$s\`
118 tar \$1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; }
138 echo Identification: "\$label"
139 echo Target directory: "\$targetdir"
140 echo Uncompressed size: $USIZE KB
141 echo Compression: $COMPRESS
142 echo Date of packaging: $DATE
143 echo Built with Makeself version $MS_VERSION on $OSTYPE
144 if test x\$script != x; then
145 echo Script run after extraction:
146 echo " " \$script \$scriptargs
148 if test x"$copy" = xcopy; then
149 echo "Archive will copy itself to a temporary location"
151 if test x"$KEEP" = xy; then
152 echo "directory \$targetdir is permanent"
154 echo "\$targetdir will be removed after extraction"
159 echo LABEL=\"\$label\"
160 echo SCRIPT=\"\$script\"
161 echo SCRIPTARGS=\"\$scriptargs\"
162 echo archdirname=\"$archdirname\"
164 echo COMPRESS=$COMPRESS
165 echo filesizes=\"\$filesizes\"
166 echo CRCsum=\"\$CRCsum\"
167 echo MD5sum=\"\$MD5\"
169 echo OLDSKIP=`expr $SKIP + 1`
176 cat << EOF >> "$archname"
181 echo Target directory: \$targetdir
182 offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
185 MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | UnTAR t
186 offset=\`expr \$offset + \$s\`
191 offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
196 MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | tar "\$arg1" - \$*
197 offset=\`expr \$offset + \$s\`
227 finish="echo Press Return to close this window...; read junk"
239 echo Unrecognized flag : "\$1" >&2
250 SCRIPT_COPY="\$TMPROOT/makeself\$\$"
251 echo "Copying to a temporary location..." >&2
252 cp "\$0" "\$SCRIPT_COPY"
253 chmod +x "\$SCRIPT_COPY"
255 exec "\$SCRIPT_COPY" --phase2
258 finish="\$finish ; rm -f \$0"
262 if test "\$nox11" = "n"; then
263 if tty -s; then # Do we have a terminal?
266 if test x"\$DISPLAY" != x -a x"\$xterm_loop" = x; then # No, but do we have X?
267 if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable
268 GUESS_XTERMS="xterm rxvt dtterm eterm Eterm kvt konsole aterm"
269 for a in \$GUESS_XTERMS; do
270 if type \$a >/dev/null 2>&1; then
275 chmod a+x \$0 || echo Please add execution rights on \$0
276 if test \`echo "\$0" | cut -c1\` = "/"; then # Spawn a terminal!
277 exec \$XTERM -title "\$label" -e "\$0" --xwin "\$initargs"
279 exec \$XTERM -title "\$label" -e "./\$0" --xwin "\$initargs"
286 if test "\$targetdir" = "."; then
289 if test "\$keep" = y; then
290 echo "Creating directory \$targetdir" >&2
293 tmpdir="\$TMPROOT/selfgz\$\$"
295 mkdir -p \$tmpdir || {
296 echo 'Cannot create target directory' \$tmpdir >&2
297 echo 'You should try option --target OtherDirectory' >&2
304 if test x\$SETUP_NOCHECK != x1; then
307 offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\`
309 if test x"\$verbose" = xy; then
310 MS_Printf "About to extract $USIZE KB in \$tmpdir ... Proceed ? [Y/n] "
312 if test x"\$yn" = xn; then
313 eval \$finish; exit 1
317 MS_Printf "Uncompressing \$label"
319 if test "\$keep" = n; then
320 trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf \$tmpdir; eval \$finish; exit 15' 1 2 3 15
325 if MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | ( cd "\$tmpdir"; UnTAR x ) | MS_Progress; then
326 if test x"\$ownership" = xy; then
327 (PATH=/usr/xpg4/bin:\$PATH; cd "\$tmpdir"; chown -R \`id -u\` .; chgrp -R \`id -g\` .)
331 echo "Unable to decompress \$0" >&2
332 eval \$finish; exit 1
334 offset=\`expr \$offset + \$s\`
340 if test x"\$script" != x; then
341 if test x"\$verbose" = xy; then
342 MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] "
344 if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then
345 \$script \$scriptargs \$*; res=\$?;
348 \$script \$scriptargs \$*; res=\$?
350 if test \$res -ne 0; then
351 test x"\$verbose" = xy && echo "The program '\$script' returned an error code (\$res)" >&2
354 if test "\$keep" = n; then
358 eval \$finish; exit \$res