2 %define git_date 20160327
3 %define git_commit 3761365735de
4 %define packdname core-%{git_commit}
5 %define extras_git_commit 7f5999a
6 %define extras_packdname extras-%{extras_git_commit}
7 Summary: Android platform tools(adb, fastboot)
9 # use platform version from git (git describe --tags)
10 # core: android-6.0.1_r21
11 # extras: android-6.0.1_r68
13 Release: 0.%{git_date}git%{git_commit}.%{rel}
14 Group: Applications/System
15 # The entire source code is ASL 2.0 except fastboot/ which is BSD
16 License: ASL 2.0 and (ASL 2.0 and BSD)
17 # using git archive since upstream hasn't created tarballs.
18 # git archive --format=tar --prefix=%%{packdname}/ %%{git_commit} adb fastboot libzipfile libcutils libmincrypt libsparse mkbootimg include/cutils include/zipfile include/mincrypt include/utils include/private | xz > %%{packdname}.tar.xz
19 # https://android.googlesource.com/platform/system/core.git
20 # git archive --format=tar --prefix=extras/ %%{extras_git_commit} ext4_utils f2fs_utils | xz > %%{extras_packdname}.tar.xz
21 # https://android.googlesource.com/platform/system/extras.git
22 Source0: http://pkgs.fedoraproject.org/repo/pkgs/android-tools/%{packdname}.tar.xz/bdccaa042b73d1f5a29630c69ae5df26/%{packdname}.tar.xz
23 # Source0-md5: bdccaa042b73d1f5a29630c69ae5df26
24 Source1: http://pkgs.fedoraproject.org/repo/pkgs/android-tools/%{extras_packdname}.tar.xz/2cd5ea576fdf35f5e9ee1c208f6d9fa5/%{extras_packdname}.tar.xz
25 # Source1-md5: 2cd5ea576fdf35f5e9ee1c208f6d9fa5
26 Source2: generate_build.rb
27 Source5: 51-android.rules
29 Patch1: 0001-Add-string-h.patch
30 URL: http://developer.android.com/guide/developing/tools/
31 BuildRequires: f2fs-tools
32 BuildRequires: gtest-devel
33 BuildRequires: libselinux-devel
34 BuildRequires: openssl-devel
35 BuildRequires: rpmbuild(macros) >= 1.671
37 BuildRequires: systemd-devel
38 BuildRequires: tar >= 1:1.22
40 BuildRequires: zlib-devel
41 Requires: systemd-units >= 38
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 The Android Debug Bridge (ADB) is used to:
48 - keep track of all Android devices and emulators instances connected
49 to or running on a given host developer machine
50 - implement various control commands (e.g. "adb shell", "adb pull",
51 etc.) for the benefit of clients (command-line users, or helper
52 programs like DDMS). These commands are what is called a 'service' in
55 Fastboot is used to manipulate the flash partitions of the Android
56 phone. It can also boot the phone using a kernel image or root
57 filesystem image which reside on the host machine rather than in the
58 phone flash. In order to use it, it is important to understand the
59 flash partition layout for the phone. The fastboot program works in
60 conjunction with firmware on the phone to read and write the flash
61 partitions. It needs the same USB device setup between the host and
62 the target phone as adb.
71 %{__ruby} %{SOURCE2} | tee build.sh
72 PKGVER=%{git_commit} \
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{_bindir},%{systemdunitdir},%{_sharedstatedir}/adb,/lib/udev/rules.d}
80 install -p adb/adb fastboot/fastboot libsparse/simg2img libsparse/img2simg $RPM_BUILD_ROOT%{_bindir}
82 cp -p %{SOURCE5} $RPM_BUILD_ROOT/lib/udev/rules.d/51-android.rules
83 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/adb.service
86 rm -rf $RPM_BUILD_ROOT
89 %systemd_post adb.service
92 %systemd_preun adb.service
98 %defattr(644,root,root,755)
99 %doc adb/OVERVIEW.TXT adb/SERVICES.TXT adb/NOTICE adb/protocol.txt
101 %attr(755,root,root) %{_bindir}/adb
102 %attr(755,root,root) %{_bindir}/img2simg
103 %attr(755,root,root) %{_bindir}/simg2img
105 %attr(755,root,root) %{_bindir}/fastboot
107 %{systemdunitdir}/adb.service
108 /lib/udev/rules.d/51-android.rules
109 %dir %{_sharedstatedir}/adb