blob: e05117fb6151eb2ca1f7ceb53acddfbae2c3869e [file] [log] [blame]
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -08001#!/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' Turner46be4872009-06-04 16:07:01 +020010# get absolute path of source directory tree
11CURDIR=`dirname $0`
12TOPDIR=`cd $CURDIR/.. && pwd`
13
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080014# create temporary directory
15TMPROOT=/tmp/android-package
16DATE=$(date +%Y%m%d)
17PACKAGE=android-emulator-$DATE
18TMPDIR=$TMPROOT/$PACKAGE
19if ! ( rm -rf $TMPROOT && mkdir -p $TMPDIR ) then
20 echo "could not create temporary directory $TMPDIR"
21 exit 3
22fi
23
David 'Digit' Turner46be4872009-06-04 16:07:01 +020024# clone the current source tree to $TMPDIR/qemu
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080025QEMUDIR=$TMPDIR/qemu
David 'Digit' Turner46be4872009-06-04 16:07:01 +020026echo "Copying sources to $QEMUDIR"
27cd $TMPDIR && git clone file://$TOPDIR $QEMUDIR && rm -rf $QEMUDIR/.git
28if [ $? != 0 ] ; then
29 echo "Could not clone sources"
30fi
31
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080032echo "copying control scripts"
David 'Digit' Turner46be4872009-06-04 16:07:01 +020033mv $QEMUDIR/distrib/build-emulator.sh $TMPDIR/build-emulator.sh
34mv $QEMUDIR/distrib/README $TMPDIR/README
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080035
36echo "packaging release into a tarball"
37cd $TMPROOT
38tar cjf $PACKAGE.tar.bz2 $PACKAGE
39
40echo "cleaning up"
41rm -rf $TMPDIR
42
43echo "please grab $TMPROOT/$PACKAGE.tar.bz2"