diff options
Diffstat (limited to 'development/android-tools/android-tools.SlackBuild')
-rw-r--r-- | development/android-tools/android-tools.SlackBuild | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/development/android-tools/android-tools.SlackBuild b/development/android-tools/android-tools.SlackBuild new file mode 100644 index 0000000000000..3e3551f8d0543 --- /dev/null +++ b/development/android-tools/android-tools.SlackBuild @@ -0,0 +1,111 @@ +#!/bin/sh + +# Slackware build script for android-tools +# Thanks to the Arch linux maintainers for the makefiles + +# Copyright 2014 Philip van der Hoeven, Almere, NL +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PRGNAM=android-tools +VERSION=${VERSION:-5.0.2_r1} + +SRCVERSION1=8032f3b5a501dabc1e28925cca834d2a39efbdee +SRCVERSION2=ba2a23604727e5b333dd16a9287556d799d6d39e +SRCVERSION3=3946f9119bf4eadfcfb17bd15661515328cbbc86 +SRCVERSION4=fc24ac8347630a14d62ffafa93a27ec3b81cc44b + +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $TMP/$PRGNAM $PKG +mkdir -p $TMP/$PRGNAM $PKG $OUTPUT + +cd $TMP/$PRGNAM + +mkdir core extras libselinux f2fs-tools +tar xvf $CWD/$SRCVERSION1.tar.gz -C core +tar xvf $CWD/$SRCVERSION2.tar.gz -C extras +tar xvf $CWD/$SRCVERSION3.tar.gz -C libselinux +tar xvf $CWD/$SRCVERSION4.tar.gz -C f2fs-tools + +#git clone --branch android-$VERSION --depth 1 https://android.googlesource.com/platform/system/core +#git clone --branch android-$VERSION --depth 1 https://android.googlesource.com/platform/system/extras +#git clone --branch android-$VERSION --depth 1 https://android.googlesource.com/platform/external/libselinux +#git clone --branch android-$VERSION --depth 1 https://android.googlesource.com/platform/external/f2fs-tools + +cp -p $CWD/adbMakefile $CWD/fastbootMakefile . + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +sed -e 's/f2fs_sparse_file = NULL/f2fs_sparse_file = 0/g' -i extras/f2fs_utils/f2fs_utils.c + +make -C core/adb -f $TMP/android-tools/adbMakefile +make -C core/fastboot -f $TMP/android-tools/fastbootMakefile + +mkdir -p $PKG/usr/bin +install -Dm 0755 core/adb/adb $PKG/usr/bin/adb +install -Dm 0755 core/fastboot/fastboot $PKG/usr/bin/fastboot + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |