desktop/android-sdk-platform-tools/PKGBUILD

58 lines
2.1 KiB
Bash

pkgname=android-sdk-platform-tools
pkgver=r28.0.1
pkgrel=1
pkgdesc='Platform-Tools for Google Android SDK (adb, aapt, aidl, dexdump, dx and fastboot) - works with Ubuntu Touch too'
arch=('x86_64')
url="https://developer.android.com/sdk/index.html"
license=('custom')
depends=('zlib' 'ncurses')
provides=('adb' 'fastboot' 'android-tools')
conflicts=('adb' 'fastboot' 'bash-completion-android')
_sdk=android-sdk
_tools=opt/$_sdk/tools
_ptools=opt/$_sdk/platform-tools
source=("https://dl.google.com/android/repository/platform-tools_${pkgver}-linux.zip"
"https://github.com/MikereDD/android-completion/archive/master.zip"
"adb.service"
"license.html")
sha1sums=('74ff83bc203f01c4f04bd9316ab5a2573f023fd1'
'53c079f9344d60d280c33b3bb4a05cdca20f2d39'
'49a40c129199844603afe71fce69c0908e062393'
'e91e23015f25aec78c03012b2f78f42a1c8392d6')
package() {
cd $srcdir
# instal the tools
install -d $pkgdir/$_ptools
cp -a $srcdir/platform-tools/* $pkgdir/$_ptools
chmod +Xr -R $pkgdir/$_ptools
# hack to use the tools like they were on /usr/bin
install -d $pkgdir/{etc/profile.d,opt/$_sdk}
echo 'export PATH=$PATH:/opt/android-sdk/platform-tools' > $pkgdir/etc/profile.d/$pkgname.sh
echo 'setenv PATH ${PATH}:/opt/android-sdk/platform-tools' > $pkgdir/etc/profile.d/$pkgname.csh
chmod 755 $pkgdir/etc/profile.d/$pkgname.{csh,sh}
# install bash-completion
# license
install -d ${pkgdir}/usr/share/licenses/$pkgname
sed -e :a -e '$q;N;30,$D;ba' android-completion-master/README.markdown > ${pkgdir}/usr/share/licenses/$pkgname/bash-completion-LICENSE
# fastboot
install -Dm 0755 android-completion-master/fastboot $pkgdir/usr/share/bash-completion/completions/fastboot
# install adb service
install -Dm644 $srcdir/adb.service $pkgdir/usr/lib/systemd/system/adb.service
# install license
install -Dm644 $srcdir/license.html $pkgdir/usr/share/licenses/$pkgname/LICENSE
install -d $pkgdir/usr/bin
ln -s /opt/$_sdk/platform-tools/adb $pkgdir/usr/bin/adb
ln -s /opt/$_sdk/platform-tools/fastboot $pkgdir/usr/bin/fastboot
}