source: branches/1.1.9/makeLinuxDist.sh @ 177

Revision 177, 1.6 KB checked in by mmamonski, 12 years ago (diff)

Resubmit from checkpoint only for finished jobs, improved installation scripts, increased default proxy lifetime, MouseEvent? logging, Fixed typo in documentation

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3fail() {
4  echo -e '\033[01;41m'"$@"'\033[00m'
5  exit 1
6}
7
8TARGET='QCG-Icon-LinuxInstaller.sh'
9
10echo "ant clean"
11ant clean > /dev/null || fail "clean failed"
12echo "ant jar"
13ant jar > /dev/null || fail "jar failed"
14echo "Building script"
15
16cat << eof > "$TARGET"
17#!/bin/bash
18echo "Welcome to QCG-Icon 'installer'"
19echo -n " please specify target dir (or press return for default [qcg-icon]): "
20read tgt
21tgt="\${tgt:-qcg-icon}"
22tgt=\`eval echo \${tgt}\`
23echo "Installing QCG-Icon into \$tgt"
24if [[ ! -d "\${tgt}" ]]
25then
26        if mkdir -p "\${tgt}" ; then :; else echo "Cannot create target dir"; exit 1 ; fi
27else
28        ans=
29        until [[ "\$ans" = y || "\$ans" = n || "\$ans" = Y || "\$ans" = N ]]
30        do
31                ans=
32                echo -n " dir exists, continue? [y/N]: "
33                read ans
34                ans="\${ans:-n}"
35        done
36        if [[ "\$ans" = n || "\$ans" = N ]]
37        then
38                echo "Cancelling instalation"
39                exit 1
40        fi
41fi
42
43ARCHIVE=\`awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' "\$0"\`
44tail -n+"\$ARCHIVE" "\$0" | tar xj -C "\${tgt}"
45
46if (( "\$?" == 0 ))
47then
48  chmod a+x  "\${tgt}/qcg-icon"
49        echo "Installation finished."
50else
51        echo "Installation failed!"
52        exit 1
53fi
54
55ans=
56until [[ "\$ans" = y || "\$ans" = n || "\$ans" = Y || "\$ans" = N ]]
57do
58        ans=
59        echo -n " Run qcg-icon? [Y/n]: "
60        read ans
61        ans="\${ans:-y}"
62done
63if [[ "\$ans" = y || "\$ans" = Y ]]
64then
65        ( cd "\${tgt}" && ./qcg-icon & disown )
66        exit 1
67fi
68
69exit 0
70
71__ARCHIVE__
72eof
73
74echo "adding tar payload"
75tar cj --exclude-vcs -C dist lib QCG-Icon.jar -C ../dist_static logging.properties urls.properties certs resources -C ../dist_linux config.properties qcg-icon >> ${TARGET} || fail "packing failed"
76
77chmod +x ${TARGET}
78echo "finished!"
79
80
Note: See TracBrowser for help on using the repository browser.