]>
Commit | Line | Data |
---|---|---|
c13285da | 1 | %define rel 1 |
b4bc8a71 ER |
2 | %define git_date 20160327 |
3 | %define git_commit 3761365735de | |
c13285da | 4 | %define packdname core-%{git_commit} |
b4bc8a71 | 5 | %define extras_git_commit 7f5999a |
c13285da ER |
6 | %define extras_packdname extras-%{extras_git_commit} |
7 | Summary: Android platform tools(adb, fastboot) | |
8 | Name: android-tools | |
7fe0fcf4 | 9 | # use platform version from git (git describe --tags) |
b4bc8a71 ER |
10 | # core: android-6.0.1_r21 |
11 | # extras: android-6.0.1_r68 | |
12 | Version: 6.0.1 | |
c13285da ER |
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. | |
b4bc8a71 | 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 |
c13285da | 19 | # https://android.googlesource.com/platform/system/core.git |
b4bc8a71 | 20 | # git archive --format=tar --prefix=extras/ %%{extras_git_commit} ext4_utils f2fs_utils | xz > %%{extras_packdname}.tar.xz |
c13285da | 21 | # https://android.googlesource.com/platform/system/extras.git |
b4bc8a71 ER |
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 | |
c13285da ER |
27 | Source5: 51-android.rules |
28 | Source6: adb.service | |
b4bc8a71 | 29 | Patch1: 0001-Add-string-h.patch |
c13285da | 30 | URL: http://developer.android.com/guide/developing/tools/ |
b4bc8a71 ER |
31 | BuildRequires: f2fs-tools |
32 | BuildRequires: gtest-devel | |
c13285da ER |
33 | BuildRequires: libselinux-devel |
34 | BuildRequires: openssl-devel | |
35 | BuildRequires: rpmbuild(macros) >= 1.671 | |
b4bc8a71 | 36 | BuildRequires: ruby |
c13285da ER |
37 | BuildRequires: systemd-devel |
38 | BuildRequires: tar >= 1:1.22 | |
39 | BuildRequires: xz | |
40 | BuildRequires: zlib-devel | |
41 | Requires: systemd-units >= 38 | |
42 | Provides: adb | |
43 | Provides: fastboot | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
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 | |
53 | ADB. | |
54 | ||
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. | |
63 | ||
64 | %prep | |
65 | %setup -qc -a1 | |
66 | mv %{packdname}/* . | |
67 | ||
b4bc8a71 | 68 | %patch1 -p1 |
c13285da ER |
69 | cp -p %{SOURCE5} 51-android.rules |
70 | ||
71 | %build | |
b4bc8a71 ER |
72 | %{__ruby} %{SOURCE2} | tee build.sh |
73 | PKGVER=%{git_commit} sh -xe build.sh | |
c13285da ER |
74 | |
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
b4bc8a71 ER |
77 | install -d $RPM_BUILD_ROOT{%{_bindir},%{systemdunitdir},%{_sharedstatedir}/adb} |
78 | install -p adb/adb fastboot/fastboot libsparse/simg2img libsparse/img2simg $RPM_BUILD_ROOT%{_bindir} | |
c13285da ER |
79 | |
80 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/adb.service | |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %post | |
86 | %systemd_post adb.service | |
87 | ||
88 | %preun | |
89 | %systemd_preun adb.service | |
90 | ||
91 | %postun | |
92 | %systemd_reload | |
93 | ||
94 | %files | |
95 | %defattr(644,root,root,755) | |
96 | %doc adb/OVERVIEW.TXT adb/SERVICES.TXT adb/NOTICE adb/protocol.txt 51-android.rules | |
97 | # ASL2.0 | |
98 | %attr(755,root,root) %{_bindir}/adb | |
b4bc8a71 ER |
99 | %attr(755,root,root) %{_bindir}/img2simg |
100 | %attr(755,root,root) %{_bindir}/simg2img | |
c13285da ER |
101 | # ASL2.0 and BSD. |
102 | %attr(755,root,root) %{_bindir}/fastboot | |
b4bc8a71 | 103 | |
c13285da | 104 | %{systemdunitdir}/adb.service |
b4bc8a71 | 105 | %dir %{_sharedstatedir}/adb |