The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # this script is used to build a source distribution package for the Android emulator |
| 4 | # the package includes: |
| 5 | # - the sources of our patched SDL library |
| 6 | # - the sources of our patched QEMU emulator |
| 7 | # - appropriate scripts to rebuild the emulator binary |
| 8 | # |
| 9 | |
David 'Digit' Turner | 46be487 | 2009-06-04 16:07:01 +0200 | [diff] [blame] | 10 | # get absolute path of source directory tree |
| 11 | CURDIR=`dirname $0` |
| 12 | TOPDIR=`cd $CURDIR/.. && pwd` |
| 13 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 14 | # create temporary directory |
| 15 | TMPROOT=/tmp/android-package |
| 16 | DATE=$(date +%Y%m%d) |
| 17 | PACKAGE=android-emulator-$DATE |
| 18 | TMPDIR=$TMPROOT/$PACKAGE |
| 19 | if ! ( rm -rf $TMPROOT && mkdir -p $TMPDIR ) then |
| 20 | echo "could not create temporary directory $TMPDIR" |
| 21 | exit 3 |
| 22 | fi |
| 23 | |
David 'Digit' Turner | 46be487 | 2009-06-04 16:07:01 +0200 | [diff] [blame] | 24 | # clone the current source tree to $TMPDIR/qemu |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 25 | QEMUDIR=$TMPDIR/qemu |
David 'Digit' Turner | 46be487 | 2009-06-04 16:07:01 +0200 | [diff] [blame] | 26 | echo "Copying sources to $QEMUDIR" |
| 27 | cd $TMPDIR && git clone file://$TOPDIR $QEMUDIR && rm -rf $QEMUDIR/.git |
| 28 | if [ $? != 0 ] ; then |
| 29 | echo "Could not clone sources" |
| 30 | fi |
| 31 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 32 | echo "copying control scripts" |
David 'Digit' Turner | 46be487 | 2009-06-04 16:07:01 +0200 | [diff] [blame] | 33 | mv $QEMUDIR/distrib/build-emulator.sh $TMPDIR/build-emulator.sh |
| 34 | mv $QEMUDIR/distrib/README $TMPDIR/README |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 35 | |
| 36 | echo "packaging release into a tarball" |
| 37 | cd $TMPROOT |
| 38 | tar cjf $PACKAGE.tar.bz2 $PACKAGE |
| 39 | |
| 40 | echo "cleaning up" |
| 41 | rm -rf $TMPDIR |
| 42 | |
| 43 | echo "please grab $TMPROOT/$PACKAGE.tar.bz2" |