1. Apply patches
apply_patchs()
{
cd $src
while read patch_file; do
[ -f done.$patch_file ] && continue
echo "Apply $patch_file..."
patch -p1 < $stuff/patches/$patch_file || return 1
touch done.$patch_file
done <<EOT
remove-selinux-android.patch
use-capability.patch
reboot-syscall.patch
env-props.patch
adbd-use-user-shell.patch
use-local-socket.patch
EOT
}
2. ls -1 done*
done.adbd-use-user-shell.patch
done.env-props.patch
done.reboot-syscall.patch
done.remove-selinux-android.patch
done.use-capability.patch
done.use-local-socket.patch
3. logfile
....
Apply remove-selinux-android.patch...
patching file extras/ext4_utils/make_ext4fs.c
patching file extras/ext4_utils/make_ext4fs_main.c
Apply use-capability.patch...
patching file core/include/private/android_filesystem_config.h
Apply reboot-syscall.patch...
patching file core/libcutils/android_reboot.c
Apply env-props.patch...
patching file core/adb/env-props.c
Apply adbd-use-user-shell.patch...
patching file core/adb/services.c
Apply use-local-socket.patch...
patching file core/adb/adb.c
patching file core/adb/adb_client.c
patching file core/adb/transport_local.c
----
# SliTaz package receipt.
PACKAGE="android-tools-adbd"
VERSION="4.2.2"
CATEGORY="development"
SHORT_DESC="Android Debug Bridge daemon"
MAINTAINER="alanyih"
WEB_SITE="http://developer.android.com/guide/developing/tools/adb.html"
TARBALL="android-tools_4.2.2+git20130529.orig.tar.xz"
WGET_URL="http://ftp.de.debian.org/debian/pool/main/a/android-tools/$TARBALL"
DEPENDS="libssl zlib libcap"
BUILD_DEPENDS="openssl-dev zlib-dev libcap-dev"
# Apply patches
apply_patchs()
{
cd $src
while read patch_file; do
[ -f done.$patch_file ] && continue
echo "Apply $patch_file..."
patch -p1 < $stuff/patches/$patch_file || return 1
touch done.$patch_file
done <<EOT
remove-selinux-android.patch
use-capability.patch
reboot-syscall.patch
env-props.patch
adbd-use-user-shell.patch
use-local-socket.patch
EOT
}
# Rules to configure and make the package.
compile_rules()
{
apply_patchs &&
cd core/adb
cp -a $stuff/adbdMakefile Makefile
make
}
# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
mkdir -p $fs/usr/bin
cp -a $src/core/adb/adbd $fs/usr/bin
}