#!/bin/bash # Slackware build script for adb (Android Debug Bridge) # # adb is NOT compiled here. Google publishes platform-tools only as a # prebuilt; building it from source means the whole AOSP build system. This # script repackages the official archive, and the binary it installs is # byte-identical to the one Google ships (verified 2026-09-23). # # Upstream is Apache-2.0 and the binary links nothing but libc, so there is # no GPL source obligation for it. set -e cd "$(dirname "$0")" ; CWD=$(pwd) PRGNAM=adb VERSION=${VERSION:-35.0.2} BUILD=${BUILD:-1} TAG=${TAG:-_pmagic} PKGTYPE=${PKGTYPE:-txz} ARCH=${ARCH:-x86_64} SRCZIP=platform-tools_r${VERSION}-linux.zip if [ -n "${PRINT_PACKAGE_NAME:-}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"; exit 0 fi TMP=${TMP:-/tmp/pm-build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-$TMP} rm -rf "$PKG" mkdir -p "$TMP" "$PKG/usr/bin" "$PKG/usr/doc/$PRGNAM-$VERSION" "$OUTPUT" rm -rf "$TMP/platform-tools" unzip -oq "$CWD/$SRCZIP" -d "$TMP" install -m 0755 "$TMP/platform-tools/adb" "$PKG/usr/bin/adb" install -m 0644 "$CWD/$PRGNAM.info" "$PKG/usr/doc/$PRGNAM-$VERSION/" install -m 0644 "$CWD/$PRGNAM.SlackBuild" "$PKG/usr/doc/$PRGNAM-$VERSION/" [ -f "$TMP/platform-tools/NOTICE.txt" ] && \ install -m 0644 "$TMP/platform-tools/NOTICE.txt" "$PKG/usr/doc/$PRGNAM-$VERSION/" mkdir -p "$PKG/install" cat > "$PKG/install/slack-desc" <<'EOD' adb: adb (Android Debug Bridge) adb: adb: adb is a command line tool that lets you communicate with an Android adb: device. It is the official prebuilt from Google's platform-tools adb: archive; it is not compiled from source here. adb: adb: Homepage: https://developer.android.com/tools/adb adb: adb: adb: adb: EOD cd "$PKG" /sbin/makepkg -l y -c n "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"