OLD | NEW |
---|---|
1 #!/bin/bash -e | 1 #!/bin/bash -e |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script to install everything needed to build chromium on android that | 7 # Script to install everything needed to build chromium on android that |
8 # requires sudo privileges. | 8 # requires sudo privileges. |
9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions | 9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions |
10 | 10 |
11 DOWNLOAD_URL="http://ftp.us.debian.org/debian/pool/non-free/s/sun-java6" | |
12 | |
13 BIN_FILE_NAME="sun-java6-bin_6.26-0squeeze1_amd64.deb" | |
14 JRE_FILE_NAME="sun-java6-jre_6.26-0squeeze1_all.deb" | |
15 JDK_FILE_NAME="sun-java6-jdk_6.26-0squeeze1_amd64.deb" | |
16 | |
17 if ! uname -m | egrep -q "i686|x86_64"; then | 11 if ! uname -m | egrep -q "i686|x86_64"; then |
18 echo "Only x86 architectures are currently supported" >&2 | 12 echo "Only x86 architectures are currently supported" >&2 |
19 exit | 13 exit |
20 fi | 14 fi |
21 | 15 |
22 if [ "x$(id -u)" != x0 ]; then | 16 if [ "x$(id -u)" != x0 ]; then |
23 echo "Running as non-root user." | 17 echo "Running as non-root user." |
24 echo "You might have to enter your password one or more times for 'sudo'." | 18 echo "You might have to enter your password one or more times for 'sudo'." |
25 echo | 19 echo |
26 fi | 20 fi |
27 | 21 |
28 sudo apt-get update | 22 sudo apt-get update |
29 | 23 |
30 # The temporary directory used to store the downloaded file. | 24 # Fix deps |
31 TEMPDIR=$(mktemp -d) | 25 sudo apt-get -f install |
32 cleanup() { | |
33 local status=${?} | |
34 trap - EXIT | |
35 rm -rf "${TEMPDIR}" | |
36 exit ${status} | |
37 } | |
38 trap cleanup EXIT | |
39 | 26 |
40 ########################################################## | 27 # Install python-pexpect |
41 # Download (i.e. wget) and install debian package. | 28 sudo apt-get install python-pexpect |
42 # The current directory is changed in this function. | |
43 # Arguments: | |
44 # file_name | |
45 # Returns: | |
46 # None | |
47 ########################################################## | |
48 install_deb_pkg() { | |
49 local file_name="${1}" | |
50 local download_url="${DOWNLOAD_URL}/${file_name}" | |
51 | 29 |
52 cd "${TEMPDIR}" | 30 # Install sun-java6 stuff |
53 wget "${download_url}" | 31 sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk |
John Grabowski
2012/03/09 00:06:09
At the top of this file, mention that TAB <ret> TA
navabi
2012/03/09 19:40:39
Done.
| |
54 | |
55 echo "Install ${file_name}" | |
56 sudo dpkg -i "${file_name}" | |
57 } | |
58 | |
59 | |
60 # Install ant | |
61 sudo apt-get install python-pexpect ant | |
62 | |
63 # Install sun-java6-bin | |
64 install_deb_pkg "${BIN_FILE_NAME}" | |
65 | |
66 # Install sun-java6-jre | |
67 install_deb_pkg "${JRE_FILE_NAME}" | |
68 | |
69 # Install sun-java6-jdk | |
70 install_deb_pkg "${JDK_FILE_NAME}" | |
71 | 32 |
72 # Switch version of Java to java-6-sun | 33 # Switch version of Java to java-6-sun |
73 sudo update-java-alternatives -s java-6-sun | 34 sudo update-java-alternatives -s java-6-sun |
John Grabowski
2012/03/09 00:06:09
Either this (or the one previous? Not sure) error
| |
74 | 35 |
36 # Install ant | |
37 sudo apt-get install ant | |
38 | |
75 echo "install-build-deps-android.sh complete." | 39 echo "install-build-deps-android.sh complete." |
OLD | NEW |