| 1 | #!/bin/sh |
| 2 | # |
| 3 | # This script is used by the buildbot master to create a dmg, based |
| 4 | # on a 'template'. It populates the template using: |
| 5 | # 1- the content of the freedroidRPG.app transferred from the 1st step |
| 6 | # buildbot worker. |
| 7 | # 2- the game data from the local repo |
| 8 | # |
| 9 | # This 2 steps process is needed because the first step is executed |
| 10 | # on a MacMini with a low internet bandwidth, too low to transfer a whole |
| 11 | # dmg in a reasonable time. |
| 12 | |
| 13 | on_exit() { |
| 14 | findmnt $WORKDIR/wc >/dev/null && umount $WORKDIR/wc |
| 15 | rm -f $WORKDIR/wc.dmg |
| 16 | } |
| 17 | |
| 18 | trap on_exit 0 |
| 19 | set -e |
| 20 | set -x |
| 21 | |
| 22 | WORKDIR=dmg_tmp |
| 23 | [ -d ${WORKDIR} ] && rm -rf ${WORKDIR} |
| 24 | mkdir ${WORKDIR} |
| 25 | mkdir ${WORKDIR}/wc |
| 26 | |
| 27 | gunzip -c macosx/template.dmg.gz > ${WORKDIR}/wc.dmg |
| 28 | mount ${WORKDIR}/wc |
| 29 | |
| 30 | tar -C ${WORKDIR}/wc/FreedroidRPG -xzf lite-freedroidRPG.app.tgz |
| 31 | |
| 32 | tar -c -f - --exclude='.svn' --exclude='.git' --exclude='Makefile' --exclude='*~' --exclude='.#*' data locale lua_modules | (cd ${WORKDIR}/wc/FreedroidRPG/freedroidRPG.app/Contents; tar -xf -) |
| 33 | cp COPYING AUTHORS README ChangeLog ${WORKDIR}/wc/FreedroidRPG |
| 34 | |
| 35 | tar -czf freedroidRPG.app.tgz -C ${WORKDIR}/wc/FreedroidRPG freedroid.app |
| 36 | |
| 37 | umount ${WORKDIR}/wc |
| 38 | |
| 39 | /usr/local/bin/dmg dmg ${WORKDIR}/wc.dmg FreedroidRPG.dmg > /dev/null |
| 40 | |
| 41 | [ -d ${WORKDIR} ] && rm -rf ${WORKDIR} |
| 42 | |
| 43 | set +x |
| 44 | trap '' 0 |