Subject: [alpine-aports] [PATCH] testing/android-tools: new aport

From: Sören Tempel <[email-masked]>
Date: Sun, 16 Aug 2015 22:11:06 +0200

---
 testing/android-tools/APKBUILD |  73 +++++++++++++++++++++++++++++
 testing/android-tools/Makefile | 101 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+)
 create mode 100644 testing/android-tools/APKBUILD
 create mode 100644 testing/android-tools/Makefile

diff --git a/testing/android-tools/APKBUILD b/testing/android-tools/APKBUILD
new file mode 100644
index 0000000..756b5d3
--- /dev/null
+++ b/testing/android-tools/APKBUILD
@@ -0,0 +1,73 @@
+# Contributor: Sören Tempel <[email-masked]>
+# Maintainer: Sören Tempel <[email-masked]>
+pkgname=android-tools
+_realver=5.1.1_r13
+pkgver=${_realver/_/}
+pkgrel=0
+pkgdesc="Android platform tools"
+url="http://tools.android.com/"
+arch="all"
+license="Apache BSD"
+depends=""
+depends_dev="openssl-dev pcre-dev"
+makedepends="$depends_dev linux-headers bsd-compat-headers"
+install=""
+subpackages=""
+source="http://dev.alpinelinux.org/archive/$pkgname/core-$_realver.tar.gz
+	http://dev.alpinelinux.org/archive/$pkgname/extras-$_realver.tar.gz
+	http://dev.alpinelinux.org/archive/$pkgname/libselinux-$_realver.tar.gz
+	http://dev.alpinelinux.org/archive/$pkgname/f2fs-tools-$_realver.tar.gz
+	Makefile"
+
+_giturl="https://android.googlesource.com/platform"
+_gittag="android-$_realver"
+
+snapshot() {
+	mkdir -p "$srcdir" && cd "$srcdir"
+
+	local r=
+	for r in system/core system/extras external/libselinux external/f2fs-tools; do
+		local n="${r##*/}.git"
+		local f="${r##*/}"
+
+		if [ -d "$n" ]; then
+			git --git-dir $n fetch || return 1
+		else
+			git clone --bare $_giturl/$r || return 1
+		fi
+
+		git --git-dir $n archive --prefix $f/ -o "$srcdir"/$f-$_realver.tar.gz $_gittag
+		scp "$srcdir"/$f-$_realver.tar.gz dev.alpinelinux.org:/archive/$pkgname/
+	done
+}
+
+prepare() {
+	cd "$srcdir"
+	sed -e 's/f2fs_sparse_file = NULL/f2fs_sparse_file = 0/g' \
+		-i extras/f2fs_utils/f2fs_utils.c || return 1
+}
+
+build() {
+	make -C "$srcdir"
+}
+
+package() {
+	make DESTDIR="$pkgdir" \
+		-C "$srcdir" install
+}
+
+md5sums="e9946249028d9c03cd9d1b5ddce64115  core-5.1.1_r13.tar.gz
+e8da77f958f96c42f4d72dddf06cec80  extras-5.1.1_r13.tar.gz
+3eb04ef3f8ef96a4a9edd9bbde04354c  libselinux-5.1.1_r13.tar.gz
+e3436012ef8e572af0fbaddbed408928  f2fs-tools-5.1.1_r13.tar.gz
+fab5e5dda238b0658d241029894a2da7  Makefile"
+sha256sums="e76af99540fdbda228ed1e1653a66c37de62704e1927ded32257b480cec35063  core-5.1.1_r13.tar.gz
+ee7fd083a1cf1952bee3f0fd60a5345269b62634013ecb832113fb93283ed22d  extras-5.1.1_r13.tar.gz
+05426dd4b7597c2baae7bd59fafc1077eba98634389d4c32b19ead32c0e90b6e  libselinux-5.1.1_r13.tar.gz
+a520c6e52d82626081ff414d90121d73c02292e1a148ebf1ca3bd48b5d0af0bc  f2fs-tools-5.1.1_r13.tar.gz
+7913d8ba35873e8224e2efe38f035d2eaebfd24fcdf06c4ea6d0795a4010192d  Makefile"
+sha512sums="8791c63ee633de2bad72b6e6de256d05328f46d0fc5bb12cd57013b7fef47d80354a675457951e2bf2a6f07328f35c83d06f1023d4bc6274723cf6d0d97ca4db  core-5.1.1_r13.tar.gz
+f64d16227495a8861265b64744cf7999c39745b2d4bdbe0bd342afc8603623d949a2b2ab11b0d619e91b263848b5c912bd547d27ff020c925fc0f1d2f0f9d60c  extras-5.1.1_r13.tar.gz
+a61055c53afbeed356013e265cf5ef842a58f3e8d8f23450a74c53079f6efb4cfbcd4b53e8b0db1c95eb4339e7b04c65a82542692fb850d9bf5c6fd35b06f57f  libselinux-5.1.1_r13.tar.gz
+7025658b154065fb1659272f488d8415f5a325bdfab985c07a53097db6b5eed440f8f88a95a51a02a78bee0c657a0da13bbf6010cdba2cbadd0cc072e3fb163b  f2fs-tools-5.1.1_r13.tar.gz
+07aedfba9a401e329aa7790b696b43f4d6993cbaa9cd6f5022b4bcd79c55b7cf8394fd812c697d9837496d1d5bda0db8912f4d8f460b9f6a834ce590aab05476  Makefile"
diff --git a/testing/android-tools/Makefile b/testing/android-tools/Makefile
new file mode 100644
index 0000000..021975d
--- /dev/null
+++ b/testing/android-tools/Makefile
@@ -0,0 +1,101 @@
+all: mkbootimg fastboot adb
+
+install:
+	install -m755 -d $(DESTDIR)/usr/bin
+	install -m755 -t $(DESTDIR)/usr/bin mkbootimg fastboot adb
+
+clean:
+	rm -f **/*.o
+
+.PHONY: clean
+
+
+
+
+MKBOOTIMG_SRCS += $(wildcard core/libmincrypt/*.c)
+MKBOOTIMG_SRCS += core/mkbootimg/mkbootimg.c
+
+MKBOOTIMG_CFLAGS += -Icore/include
+
+mkbootimg: $(MKBOOTIMG_SRCS)
+	$(CC) -o $@ $(CFLAGS) $(MKBOOTIMG_CFLAGS) $(LDFLAGS) $(MKBOOTIMG_LIBS) $(MKBOOTIMG_SRCS)
+
+
+
+
+ADB_SRCS += core/adb/adb.c
+ADB_SRCS += core/adb/adb_auth_host.c
+ADB_SRCS += core/adb/adb_client.c
+ADB_SRCS += core/adb/commandline.c
+ADB_SRCS += core/adb/console.c
+ADB_SRCS += core/adb/fdevent.c
+ADB_SRCS += core/adb/file_sync_client.c
+ADB_SRCS += core/adb/get_my_path_linux.c
+ADB_SRCS += core/adb/services.c
+ADB_SRCS += core/adb/sockets.c
+ADB_SRCS += core/adb/transport.c
+ADB_SRCS += core/adb/transport_local.c
+ADB_SRCS += core/adb/transport_usb.c
+ADB_SRCS += core/adb/usb_linux.c
+ADB_SRCS += core/adb/usb_vendors.c
+ADB_SRCS += core/libcutils/load_file.c
+ADB_SRCS += core/libcutils/socket_inaddr_any_server.c
+ADB_SRCS += core/libcutils/socket_local_client.c
+ADB_SRCS += core/libcutils/socket_local_server.c
+ADB_SRCS += core/libcutils/socket_loopback_client.c
+ADB_SRCS += core/libcutils/socket_loopback_server.c
+ADB_SRCS += core/libcutils/socket_network_client.c
+ADB_SRCS += core/libzipfile/centraldir.c
+ADB_SRCS += core/libzipfile/zipfile.c
+
+ADB_CFLAGS  += -DADB_HOST=1 -DHAVE_FORKEXEC=1 -DHAVE_OFF64_T=1 -DHAVE_TERMIO_H -I core/include -I core/adb
+ADB_LIBS += -lcrypto -lpthread -lz
+
+adb: $(ADB_SRCS)
+	$(CC) -o $@ $(CFLAGS) $(ADB_CFLAGS) $(LDFLAGS) $(ADB_SRCS) $(ADB_LIBS)
+
+
+
+FASTBOOT_SRCS += core/fastboot/bootimg.c
+FASTBOOT_SRCS += core/fastboot/engine.c
+FASTBOOT_SRCS += core/fastboot/fastboot.c
+FASTBOOT_SRCS += core/fastboot/protocol.c
+FASTBOOT_SRCS += core/fastboot/usb_linux.c
+FASTBOOT_SRCS += core/fastboot/util_linux.c
+FASTBOOT_SRCS += core/fastboot/util.c
+FASTBOOT_SRCS += core/fastboot/fs.c
+FASTBOOT_SRCS += core/libsparse/backed_block.c
+FASTBOOT_SRCS += core/libsparse/output_file.c
+FASTBOOT_SRCS += core/libsparse/sparse.c
+FASTBOOT_SRCS += core/libsparse/sparse_crc32.c
+FASTBOOT_SRCS += core/libsparse/sparse_err.c
+FASTBOOT_SRCS += core/libsparse/sparse_read.c
+FASTBOOT_SRCS += core/libzipfile/centraldir.c
+FASTBOOT_SRCS += core/libzipfile/zipfile.c
+FASTBOOT_SRCS += extras/ext4_utils/allocate.c
+FASTBOOT_SRCS += extras/ext4_utils/contents.c
+FASTBOOT_SRCS += extras/ext4_utils/crc16.c
+FASTBOOT_SRCS += extras/ext4_utils/ext4_utils.c
+FASTBOOT_SRCS += extras/ext4_utils/ext4_sb.c
+FASTBOOT_SRCS += extras/ext4_utils/extent.c
+FASTBOOT_SRCS += extras/ext4_utils/indirect.c
+FASTBOOT_SRCS += extras/ext4_utils/make_ext4fs.c
+FASTBOOT_SRCS += extras/ext4_utils/sha1.c
+FASTBOOT_SRCS += extras/ext4_utils/uuid.c
+FASTBOOT_SRCS += extras/ext4_utils/wipe.c
+FASTBOOT_SRCS += extras/f2fs_utils/f2fs_utils.c
+FASTBOOT_SRCS += extras/f2fs_utils/f2fs_dlutils.c
+FASTBOOT_SRCS += extras/f2fs_utils/f2fs_ioutils.c
+FASTBOOT_SRCS += libselinux/src/callbacks.c
+FASTBOOT_SRCS += libselinux/src/check_context.c
+FASTBOOT_SRCS += libselinux/src/freecon.c
+FASTBOOT_SRCS += libselinux/src/init.c
+FASTBOOT_SRCS += libselinux/src/label.c
+FASTBOOT_SRCS += libselinux/src/label_android_property.c
+FASTBOOT_SRCS += libselinux/src/label_file.c
+
+FASTBOOT_CFLAGS  += -DHAVE_OFF64_T=1 -std=gnu99 -I core/mkbootimg -I core/libsparse/include -I core/include -I extras/ext4_utils -I extras/f2fs_utils -I libselinux/include -I f2fs-tools/include -I f2fs-tools/mkfs
+FASTBOOT_LIBS += -lz -ldl -lpcre
+
+fastboot: $(FASTBOOT_SRCS)
+	$(CC) -o $@ $(CFLAGS) $(FASTBOOT_CFLAGS) $(LDFLAGS) $(FASTBOOT_SRCS) $(FASTBOOT_LIBS)
-- 
2.5.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---