aboutsummaryrefslogtreecommitdiffstats
path: root/distrib/make-distrib.sh
blob: 2580837f9d0cdb796604ec789d0dbaeef1ee3cce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#
# this script is used to build a source distribution package for the Android emulator
# the package includes:
#  - the sources of our patched SDL library
#  - the sources of our patched QEMU emulator
#  - appropriate scripts to rebuild the emulator binary
#

# get absolute path of source directory tree
CURDIR=`dirname $0`
TOPDIR=`cd $CURDIR/.. && pwd`

# create temporary directory
TMPROOT=/tmp/android-package
DATE=$(date +%Y%m%d)
PACKAGE=android-emulator-$DATE
TMPDIR=$TMPROOT/$PACKAGE
if ! ( rm -rf $TMPROOT && mkdir -p $TMPDIR ) then
    echo "could not create temporary directory $TMPDIR"
    exit 3
fi

# clone the current source tree to $TMPDIR/qemu
QEMUDIR=$TMPDIR/qemu
echo "Copying sources to $QEMUDIR"
cd $TMPDIR && git clone file://$TOPDIR $QEMUDIR && rm -rf $QEMUDIR/.git
if [ $? != 0 ] ; then
    echo "Could not clone sources"
fi

# move the SDL sources
SDLDIR=$TMPDIR/sdl
echo "Moving SDL sources to $SDLDIR"
mv $TMPDIR/qemu/distrib/sdl-1.2.12 $SDLDIR

echo "copying control scripts"
mv $QEMUDIR/distrib/build-emulator.sh $TMPDIR/build-emulator.sh
mv $QEMUDIR/distrib/README $TMPDIR/README

echo "packaging release into a tarball"
cd $TMPROOT
tar cjf $PACKAGE.tar.bz2 $PACKAGE

echo "cleaning up"
rm -rf $TMPDIR

echo "please grab $TMPROOT/$PACKAGE.tar.bz2"