Date: Thursday, April 24, 2014 @ 00:40:21 Author: anatolik Revision: 110085
android-tools: add the package Added: android-tools/ android-tools/repos/ android-tools/trunk/ android-tools/trunk/PKGBUILD android-tools/trunk/adbMakefile android-tools/trunk/bash_completion android-tools/trunk/fastbootMakefile ------------------+ PKGBUILD | 38 +++++++++ adbMakefile | 43 +++++++++++ bash_completion | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++++ fastbootMakefile | 54 ++++++++++++++ 4 files changed, 339 insertions(+) Added: android-tools/trunk/PKGBUILD =================================================================== --- android-tools/trunk/PKGBUILD (rev 0) +++ android-tools/trunk/PKGBUILD 2014-04-23 22:40:21 UTC (rev 110085) @@ -0,0 +1,38 @@ +# $Id$ +# Maintainer: Anatol Pomozov +# Contributor: 謝致邦 <yek...@red54.com> +# Contributor: Alucryd <alucryd at gmail dot com> + +pkgname=android-tools +pkgver=4.4.2_r2 +pkgrel=1 +pkgdesc='Android platform tools' +arch=(i686 x86_64) +url='http://tools.android.com/' +license=(Apache MIT) +depends=(openssl) +makedepends=(git) +source=(git+https://android.googlesource.com/platform/system/core#tag=android-$pkgver + git+https://android.googlesource.com/platform/system/extras#tag=android-$pkgver + git+https://android.googlesource.com/platform/external/libselinux#tag=android-$pkgver + adbMakefile + fastbootMakefile + bash_completion) # Bash completion file was taken from https://github.com/mbrubeck/android-completion +md5sums=('SKIP' + 'SKIP' + 'SKIP' + '887d868e544330ef850334961685cab3' + 'cd1a1a9d16b523119245bfe17120d73b' + '94ba9c753e9c3d2f29ffdef2eaf7888d') + +build() { + make -C core/adb -f "$srcdir"/adbMakefile + make -C core/fastboot -f "$srcdir"/fastbootMakefile +} + +package(){ + install -Dm 755 core/adb/adb "$pkgdir"/usr/bin/adb + install -Dm 755 core/fastboot/fastboot "$pkgdir"/usr/bin/fastboot + + install -Dm 644 bash_completion "$pkgdir"/etc/bash_completion.d/$pkgname +} Property changes on: android-tools/trunk/PKGBUILD ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: android-tools/trunk/adbMakefile =================================================================== --- android-tools/trunk/adbMakefile (rev 0) +++ android-tools/trunk/adbMakefile 2014-04-23 22:40:21 UTC (rev 110085) @@ -0,0 +1,43 @@ +SRCS+= adb.c +SRCS+= adb_auth_host.c +SRCS+= adb_client.c +SRCS+= commandline.c +SRCS+= console.c +SRCS+= fdevent.c +SRCS+= file_sync_client.c +SRCS+= get_my_path_linux.c +SRCS+= services.c +SRCS+= sockets.c +SRCS+= transport.c +SRCS+= transport_local.c +SRCS+= transport_usb.c +SRCS+= usb_linux.c +SRCS+= usb_vendors.c + +VPATH+= ../libcutils +SRCS+= list.c +SRCS+= load_file.c +SRCS+= socket_inaddr_any_server.c +SRCS+= socket_local_client.c +SRCS+= socket_local_server.c +SRCS+= socket_loopback_client.c +SRCS+= socket_loopback_server.c +SRCS+= socket_network_client.c + +VPATH+= ../libzipfile +SRCS+= centraldir.c +SRCS+= zipfile.c + +CPPFLAGS+= -DADB_HOST=1 +CPPFLAGS+= -DHAVE_FORKEXEC=1 +CPPFLAGS+= -I. +CPPFLAGS+= -I../include + +LIBS+= -lcrypto -lpthread -lz + +OBJS= $(SRCS:.c=.o) + +all: adb + +adb: $(OBJS) + cc -o $@ $(LDFLAGS) $(OBJS) $(LIBS) Added: android-tools/trunk/bash_completion =================================================================== --- android-tools/trunk/bash_completion (rev 0) +++ android-tools/trunk/bash_completion 2014-04-23 22:40:21 UTC (rev 110085) @@ -0,0 +1,204 @@ +## Bash completion for the Android SDK tools. +## +## Copyright (c) 2009 Matt Brubeck +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in +## all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +## THE SOFTWARE. + + +function _adb() +{ + local cur prev opts cmds c subcommand device_selected + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="-d -e -s -p" + cmds="devices push pull sync shell emu logcat forward jdwp install sideload \ + uninstall bugreport help version wait-for-device start-server \ + reboot reboot-bootloader \ + connect disconnect \ + kill-server get-state get-serialno status-window remount root ppp backup restore" + cmds_not_need_device="devices help version start-server kill-server connect disconnect" + subcommand="" + device_selected="" + + # Look for the subcommand. + c=1 + while [ $c -lt $COMP_CWORD ]; do + word="${COMP_WORDS[c]}" + if [ "$word" = "-d" -o "$word" = "-e" -o "$word" = "-s" ]; then + device_selected=true + opts="-p" + fi + for cmd in $cmds; do + if [ "$cmd" = "$word" ]; then + subcommand="$word" + fi + done + c=$((++c)) + done + + case "${subcommand}" in + '') + case "${prev}" in + -p) + return 0; + ;; + -s) + # Use 'adb devices' to list serial numbers. + COMPREPLY=( $(compgen -W "$(adb devices|grep 'device$'|cut -f1)" -- ${cur} ) ) + return 0 + ;; + esac + case "${cur}" in + -*) + COMPREPLY=( $(compgen -W "$opts" -- ${cur}) ) + return 0 + ;; + esac + if [ -z "$device_selected" ]; then + local num_devices=$(( $(adb devices 2>/dev/null|wc -l) - 2 )) + if [ "$num_devices" -gt "1" ]; then + # With multiple devices, you must choose a device first. + COMPREPLY=( $(compgen -W "${opts} ${cmds_not_need_device}" -- ${cur}) ) + return 0 + fi + fi + COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) ) + return 0 + ;; + install) + case "${cur}" in + -*) + COMPREPLY=( $(compgen -W "-l -r -s" -- ${cur}) ) + return 0 + ;; + esac + ;; + forward) + # Filename or installation option. + COMPREPLY=( $(compgen -W "tcp: localabstract: localreserved: localfilesystem: dev: jdwp:" -- ${cur}) ) + return 0 + ;; + uninstall) + case "${cur}" in + -*) + COMPREPLY=( $(compgen -W "-k" -- ${cur}) ) + return 0 + ;; + esac + ;; + logcat) + case "${cur}" in + -*) + COMPREPLY=( $(compgen -W "-v -b -c -d -f -g -n -r -s" -- ${cur}) ) + return 0 + ;; + esac + case "${prev}" in + -v) + COMPREPLY=( $(compgen -W "brief process tag thread raw time long" -- ${cur}) ) + return 0 + ;; + -b) + COMPREPLY=( $(compgen -W "radio events main" -- ${cur}) ) + return 0 + ;; + esac + ;; + backup) + case "${cur}" in + -*) + COMPREPLY=( $(compgen -W "-f -apk -noapk -obb -noobb -shared -noshared -all -system -nosystem" -- ${cur}) ) + return 0 + ;; + esac + ;; + esac +} +complete -o default -F _adb adb + + + +function _fastboot() +{ + local cur prev opts cmds c subcommand device_selected + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="-w -s -p -c -i -b -n" + cmds="update flashall flash erase getvar boot devices \ + reboot reboot-bootloader oem continue" + subcommand="" + partition_list="boot recovery system userdata bootloader radio" + device_selected="" + + # Look for the subcommand. + c=1 + while [ $c -lt $COMP_CWORD ]; do + word="${COMP_WORDS[c]}" + if [ "$word" = "-s" ]; then + device_selected=true + fi + for cmd in $cmds; do + if [ "$cmd" = "$word" ]; then + subcommand="$word" + fi + done + c=$((++c)) + done + + case "${subcommand}" in + '') + case "${prev}" in + -s) + # Use 'fastboot devices' to list serial numbers. + COMPREPLY=( $(compgen -W "$(fastboot devices|cut -f1)" -- ${cur} ) ) + return 0 + ;; + esac + case "${cur}" in + -*) + COMPREPLY=( $(compgen -W "$opts" -- ${cur}) ) + return 0 + ;; + esac + if [ -z "$device_selected" ]; then + local num_devices=$(( $(fastboot devices 2>/dev/null|wc -l) )) + if [ "$num_devices" -gt "1" ]; then + # With multiple devices, you must choose a device first. + COMPREPLY=( $(compgen -W "-s" -- ${cur}) ) + return 0 + fi + fi + COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) ) + return 0 + ;; + flash) + # partition name + COMPREPLY=( $(compgen -W "${partition_list}" -- ${cur}) ) + return 0 + ;; + erase) + # partition name + COMPREPLY=( $(compgen -W "${partition_list}" -- ${cur}) ) + return 0 + ;; + esac +} +complete -o default -F _fastboot fastboot Added: android-tools/trunk/fastbootMakefile =================================================================== --- android-tools/trunk/fastbootMakefile (rev 0) +++ android-tools/trunk/fastbootMakefile 2014-04-23 22:40:21 UTC (rev 110085) @@ -0,0 +1,54 @@ +SRCS+=bootimg.c +SRCS+=engine.c +SRCS+=fastboot.c +SRCS+=protocol.c +SRCS+=usb_linux.c +SRCS+=util_linux.c + +VPATH+= ../libsparse +SRCS+= backed_block.c +SRCS+= output_file.c +SRCS+= sparse.c +SRCS+= sparse_crc32.c +SRCS+= sparse_err.c +SRCS+= sparse_read.c + +VPATH+= ../libzipfile +SRCS+= centraldir.c +SRCS+= zipfile.c + +VPATH+= ../../extras/ext4_utils +SRCS+= allocate.c +SRCS+= contents.c +SRCS+= crc16.c +SRCS+= ext4_utils.c +SRCS+= extent.c +SRCS+= indirect.c +SRCS+= make_ext4fs.c +SRCS+= sha1.c +SRCS+= uuid.c +SRCS+= wipe.c + +VPATH+= ../../libselinux/src +SRCS+= callbacks.c +SRCS+= check_context.c +SRCS+= freecon.c +SRCS+= init.c +SRCS+= label.c +SRCS+= label_android_property.c +SRCS+= label_file.c + +CPPFLAGS+= -I../include +CPPFLAGS+= -I../libsparse/include +CPPFLAGS+= -I../mkbootimg +CPPFLAGS+= -I../../extras/ext4_utils +CPPFLAGS+= -I../../libselinux/include + +LIBS+= -lz + +OBJS= $(SRCS:.c=.o) + +all: fastboot + +fastboot: $(OBJS) + cc -o $@ $(OBJS) $(LIBS)