# $Id: PKGBUILD 117947 2014-08-27 06:23:21Z anatolik $
# Maintainer: Anatol Pomozov
# Contributor: 謝致邦 <Yeking@Red54.com>
# Contributor: Alucryd <alucryd at gmail dot com>

pkgname=android-tools
pkgver=4.4.4_r2.0.1
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'
         '421f8640d7b4ec156f1d37167f3e7a45')

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
}
