ReleaseEngineering/How To/Build An Android SDK rpm

From MozillaWiki
Jump to: navigation, search

This is the process I followed to create the new Android SDK r16 (bug 775720). We didn't have any instructions for this previously, so this is based on some steps in the previous spec file and lots of trial-and-error.

Spec files for this process can be found here: https://hg.mozilla.org/build/rpm-sources/file/default/android-sdk/centos5-i686

#cltbld@mv-moz2-linux-ix-slave01
cd $HOME
# Make sure java is in PATH
export PATH=$PATH:/tools/jdk6/bin
mv android-sdk-linux android-sdk-linux.old
cp -r /tools/android-sdk-r15 android-sdk-linux
wget http://dl.google.com/android/android-sdk_r16-linux.tgz
tar xzvf android-sdk_r16-linux.tgz
cd android-sdk-linux/
# You may not get everything you're expecting (platforms, esp.)
# if you don't clear the cache first.
tools/android --clear-cache
# Click-through extraneous packages that require logins.
# We don't need them.
tools/android update sdk --no-ui
ps auxww | grep adb
# Kill the adb server process returned by ps, just in case it
# is holding something open.
kill -9 ${adb_pid}
rm -rf add-ons/* docs extras/android/compatibility/samples \
  extras/android/compatibility/v7 extras/android/compatibility/v4 \
  extras/google samples system-images
cd ..
rm android-sdk_r16-linux.tgz
tar czvf android-sdk_r16-linux.tgz android-sdk-linux
cp android-sdk_r16-linux.tgz rpmbuild/SOURCES/
cd rpmbuild
rpmbuild -bb --define "_topdir $PWD" SPECS/android-sdk16.spec