Blob Blame History Raw
%global _hardened_build 1
%if 0%{?el8}
# Required to avoid conflicts between installed files and existing directories
# with the same name in the source tree
%undefine __cmake_in_source_build

Name:          android-tools
Version:       33.0.3p1
Release:       %autorelease
Epoch:         1
Summary:       Android platform tools(adb, fastboot)

# The entire source code is ASL 2.0 except boringssl which is BSD
License:       ASL 2.0 and (ASL 2.0 and BSD)

#  Sources with all needed patches and cmakelists live there now: 
Source1:       51-android.rules
Source2:       adb.service
# e2fsdroid doesn't build on ppc64le
# See
Patch0:        Disable-e2fsdroid-for-ppc64le.patch

BuildRequires: brotli-devel
BuildRequires: cmake
%if 0%{?el8}
# Uses C++20 features so we need a newer GCC
BuildRequires:  gcc-toolset-11-gcc-c++
BuildRequires:  gcc-toolset-11-annobin-plugin-gcc
BuildRequires:  gcc-toolset-11-binutils
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gtest-devel
BuildRequires: golang
BuildRequires: golang(
BuildRequires: golang(
BuildRequires: golang(
BuildRequires: golang(
BuildRequires: golang(
BuildRequires: libusbx-devel
BuildRequires: libzstd-devel
BuildRequires: lz4-devel
BuildRequires: multilib-rpm-config
BuildRequires: pcre2-devel
BuildRequires: perl
BuildRequires: protobuf-devel
BuildRequires: systemd-rpm-macros

Provides:      adb = %{epoch}:%{version}-%{release}
Provides:      fastboot = %{epoch}:%{version}-%{release}
Provides: = %{epoch}:%{version}-%{release}

# Bundled bits
Provides: bundled(boringssl)

# Bundled boringssl doesn't support the big endian architectures rhbz 1431379
ExcludeArch: ppc ppc64 s390x


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.

%setup -q
%ifarch ppc64le
%patch0 -p1
cp -p %{SOURCE1} 51-android.rules

%if 0%{?el8}
. /opt/rh/gcc-toolset-11/enable
export GO111MODULE=off

install -p -D -m 0644 %{SOURCE2} \
install -d -m 0775 ${RPM_BUILD_ROOT}%{_sharedstatedir}/adb

%systemd_post adb.service

%systemd_preun adb.service

%systemd_postun_with_restart adb.service

%doc 51-android.rules
%attr(0755,root,root) %dir %{_sharedstatedir}/adb
%attr(0755,root,root) %dir %{_datadir}/android-tools
#ASL2.0 and BSD
%ifnarch ppc64le