Home | History | Annotate | Download | only in distrib
      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 
     10 # get absolute path of source directory tree
     11 CURDIR=`dirname $0`
     12 TOPDIR=`cd $CURDIR/.. && pwd`
     13 
     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 
     24 # clone the current source tree to $TMPDIR/qemu
     25 QEMUDIR=$TMPDIR/qemu
     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 
     32 echo "copying control scripts"
     33 mv $QEMUDIR/distrib/build-emulator.sh $TMPDIR/build-emulator.sh
     34 mv $QEMUDIR/distrib/README $TMPDIR/README
     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"
     44