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