Name: android-tools Version: 10.0.0_r2 Release: %mkrel 3 Summary: Android platform tools (adb, fastboot, mkbootimg) # The entire source code is Apache Software License except fastboot/ which is BSD License: Apache Software License and BSD Group: Development/Tools URL: https://developer.android.com/tools/ # http://developer.android.com/guide/developing/tools/ # see below for instructions on how to create the source bundles Source0: core-%{version}.tar.xz Source1: extras-%{version}.tar.xz Source4: mdnsresponder-%{version}.tar.xz Source5: 51-android.rules Source6: adb.service Source7: safe_iop.h # simple automake-based build system # may need updates on each new upstream version Source8: Makefile.am.txt Source9: configure.ac.txt Patch1: 0001-Add-string-h.patch Patch2: 0002-libusb-modifications.patch Patch3: 0003-atomic-fix.patch # Fix bug https://bugzilla.redhat.com/show_bug.cgi?id=1441234 # crash on openssl Patch6: 0004-bz1441234.patch # Fix remaining build problems with openssl 1.1 Patch7: android-tools-9.0.0-openssl.patch # Fix build for glibc, gcc, etc. Patch8: android-tools-9.0.0-glibc.patch # Fix build on aarch64 Patch9: android-tools-10.0.0-aarch64.patch BuildRequires: pkgconfig(libselinux) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(libusb-1.0) BuildRequires: gtest-devel Provides: adb = %{version}-%{release} Provides: fastboot = %{version}-%{release} Provides: mkbootimg = %{version}-%{release} # To create source bundles: # git clone the following repositories: # https://android.googlesource.com/platform/system/core # https://android.googlesource.com/platform/system/extras # https://android.googlesource.com/platform/external/mdnsresponder # # In each of the git dirs, create an archive for the current (android) version: # export ANDROID_VERSION=%%version # git archive --format=tar --prefix=core-${ANDROID_VERSION}/ android-${ANDROID_VERSION} adb base diagnose_usb fastboot fs_mgr libbacktrace libcrypto_utils libcutils liblog libprocessgroup libprocinfo libsparse libsystem libunwindstack libutils libziparchive mkbootimg include | xz > ../core-${ANDROID_VERSION}.tar.xz # git archive --format=tar --prefix=extras-${ANDROID_VERSION}/ android-${ANDROID_VERSION} ext4_utils f2fs_utils | xz > ../extras-${ANDROID_VERSION}.tar.xz # git archive --format=tar --prefix=mdnsresponder-${ANDROID_VERSION}/ android-${ANDROID_VERSION} mDNSShared | xz > ../mdnsresponder-${ANDROID_VERSION}.tar.xz # # Move the source bundles to the SOURCES directory of this package (if not already there). %description The Android Debug Bridge (ADB) is used to: - keep track of all Android devices and emulators instances connected to or running on a given host developer machine - implement various control commands (e.g. "adb shell", "adb pull", etc.) for the benefit of clients (command-line users, or helper programs like DDMS). These commands are what is called a 'service' in ADB. Fastboot is used to manipulate the flash partitions of the Android phone. It can also boot the phone using a kernel image or root filesystem image which reside on the host machine rather than in the phone flash. In order to use it, it is important to understand the flash partition layout for the phone. The fastboot program works in conjunction with firmware on the phone to read and write the flash partitions. It needs the same USB device setup between the host and the target phone as adb. For Mageia you must use the following commands: - adb - fastboot-android - mkbootimg %prep %setup -q -a 1 -a 4 -c %{name}-%{version} ln -s core-%{version} core ln -s extras-%{version} extras ln -s mdnsresponder-%{version} mdnsresponder cp %SOURCE7 core/libutils/include %autopatch -p1 sed -i -e '1s/python$/python3/' core-%{version}/mkbootimg/mkbootimg.py sed 's/@VERSION@/%{version}/' %SOURCE9 >configure.ac cat %SOURCE8 >Makefile.am mkdir build # hack up version strings for version 10 adb, not sure how this should work echo "#define PLATFORM_TOOLS_VERSION \"$(echo %{version} | sed -re s/\(.*\)_.*/\\1/)\"" >build/platform_tools_version.h cat >build/version.h <<EOF #include <string> namespace android { namespace build { static std::string GetBuildNumber() { return "$(echo %{version} | sed -re s/.*_\(.*\)/\\1/)"; } } } EOF %build aclocal autoconf automake -a -c pushd build export CONFIGURE_TOP=.. export PKGVER=android-%{version} %configure %make_build popd %install install -d -m 0755 %{buildroot}%{_bindir} install -d -m 0775 %{buildroot}%{_sharedstatedir}/adb install -m 0755 -t %{buildroot}%{_bindir} build/adb build/fastboot build/simg2img build/img2simg install -m 0755 core/mkbootimg/mkbootimg.py %{buildroot}%{_bindir}/mkbootimg #install -m 0755 core/mkbootimg/unpack_bootimg.py %{buildroot}%{_bindir}/unpack_bootimg mv %{buildroot}%{_bindir}/fastboot %{buildroot}%{_bindir}/fastboot-android # for 51-android.rules mkdir -p %{buildroot}%{_udevrulesdir} install -m 0644 %{SOURCE5} %{buildroot}%{_udevrulesdir}/51-android.rules # for adb.service mkdir -p %{buildroot}%{_unitdir} install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/adb.service %post %_post_service adb %preun %_preun_service adb %files %doc core/adb/OVERVIEW.TXT core/adb/SERVICES.TXT core/adb/NOTICE core/adb/protocol.txt %{_udevrulesdir}/51-android.rules %{_unitdir}/adb.service %attr(0755,root,root) %dir %{_sharedstatedir}/adb #Apache Software License %{_bindir}/adb %{_bindir}/simg2img %{_bindir}/img2simg %{_bindir}/mkbootimg #{_bindir}/unpack_bootimg #Apache Software License and BSD. %{_bindir}/fastboot-android %changelog * Wed May 13 2020 akien <akien> 10.0.0_r2-3.mga8 + Revision: 1583594 - Add udev rule for Oculus (Quest) * Fri Mar 27 2020 umeabot <umeabot> 10.0.0_r2-2.mga8 + Revision: 1561275 - Mageia 8 Mass Rebuild + wally <wally> - replace deprecated %%configure2_5x * Thu Sep 05 2019 cjw <cjw> 10.0.0_r2-1.mga8 + Revision: 1437670 - patch9: fix build on aarch64 - update to version 10.0.0-r2 o add required safe_iop.h as a separate source file o add several needed directories to the "core" source archive - replace ruby script by automake build script - compile and link with system openssl, instead of trying to use bundled boringssl while also linking against system openssl * Sat Sep 22 2018 daviddavid <daviddavid> 8.0.0_r4-3.mga7 + Revision: 1295952 - add patch to fix build with new glibc (thanks to Arusekk) + umeabot <umeabot> - Mageia 7 Mass Rebuild * Sun Jul 22 2018 joequant <joequant> 8.0.0_r4-2.mga7 + Revision: 1244884 - Fix crash with new libcrypto * Sat Sep 02 2017 cjw <cjw> 8.0.0_r4-1.mga7 + Revision: 1150879 - add BuildRequires: ruby - update to version 8.0.0_r4 - use patches, config files, and build scripts of current fedora package * Mon Feb 08 2016 umeabot <umeabot> 4.4.2_r2-5.mga6 + Revision: 945800 - Mageia 6 Mass Rebuild * Wed Oct 15 2014 umeabot <umeabot> 4.4.2_r2-4.mga5 + Revision: 745743 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 4.4.2_r2-3.mga5 + Revision: 677757 - Mageia 5 Mass Rebuild * Sat Apr 05 2014 daviddavid <daviddavid> 4.4.2_r2-2.mga5 + Revision: 612018 - add post and preun service to start or stop adb service (since he is a systemd unit file) * Fri Apr 04 2014 daviddavid <daviddavid> 4.4.2_r2-1.mga5 + Revision: 611768 - change fastboot to fastboot-android (name already use by lsb-core-noarch) - imported package android-tools