From 6983b558e08d6ef89506506de05ed2680955d446 Mon Sep 17 00:00:00 2001 From: Ivan Afonichev Date: Wed, 18 May 2011 01:19:50 +0400 Subject: [PATCH] first commit --- .gitignore | 1 + adb-Makefile | 56 ++++++++++++++++++++++++++++++++++++ android-tools.spec | 72 ++++++++++++++++++++++++++++++++++++++++++++++ core-Makefile | 11 +++++++ fastboot-Makefile | 40 ++++++++++++++++++++++++++ sources | 1 + 6 files changed, 181 insertions(+) create mode 100644 .gitignore create mode 100644 adb-Makefile create mode 100644 android-tools.spec create mode 100644 core-Makefile create mode 100644 fastboot-Makefile create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..335ec95 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.tar.gz diff --git a/adb-Makefile b/adb-Makefile new file mode 100644 index 0000000..dedef98 --- /dev/null +++ b/adb-Makefile @@ -0,0 +1,56 @@ +SRCS+= adb.c +SRCS+= adb_client.c +SRCS+= commandline.c +SRCS+= console.c +SRCS+= file_sync_client.c +SRCS+= fdevent.c +SRCS+= get_my_path_linux.c +SRCS+= services.c +SRCS+= sockets.c +SRCS+= transport.c +SRCS+= transport_local.c +SRCS+= transport_usb.c +SRCS+= usb_linux.c +SRCS+= usb_vendors.c +SRCS+= utils.c + +VPATH+= ../libcutils +SRCS+= abort_socket.c +SRCS+= socket_inaddr_any_server.c +SRCS+= socket_local_client.c +SRCS+= socket_local_server.c +SRCS+= socket_loopback_client.c +SRCS+= socket_loopback_server.c +SRCS+= socket_network_client.c + +VPATH+= ../libzipfile +SRCS+= centraldir.c +SRCS+= zipfile.c + +CPPFLAGS+= -DADB_HOST=1 +CPPFLAGS+= -DHAVE_FORKEXEC=1 +CPPFLAGS+= -DHAVE_SYMLINKS +CPPFLAGS+= -DHAVE_TERMIO_H +CPPFLAGS+= -D_GNU_SOURCE +CPPFLAGS+= -D_XOPEN_SOURCE +CPPFLAGS+= -I. +CPPFLAGS+= -I../include + +CFLAGS+= -O2 -Wall -Wno-unused-parameter +LIBS= -lrt -lpthread -lz + +CC= $(TOOLCHAIN)gcc +LD= $(TOOLCHAIN)gcc + +OBJS= $(SRCS:.c=.o) + +all: adb + +adb: $(OBJS) + $(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) + +install: adb + install adb $(DESTDIR)$(BINDIR) + +clean: + rm -rf $(OBJS) diff --git a/android-tools.spec b/android-tools.spec new file mode 100644 index 0000000..8e218ce --- /dev/null +++ b/android-tools.spec @@ -0,0 +1,72 @@ +%global date 20110516 +%global git_commit 327b2b7 +%global packdname core-%{git_commit} + +# FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/ +%global basedir %{_var}/lib/%{name} +%global appdir %{basedir}/webapps +%global bindir %{_datadir}/%{name}/bin +%global confdir %{_sysconfdir}/%{name} +%global homedir %{_datadir}/%{name} +%global libdir %{_javadir}/%{name} +%global logdir %{_var}/log/%{name} +%global cachedir %{_var}/cache/%{name} +%global tempdir %{cachedir}/temp +%global workdir %{cachedir}/work +%global _initrddir %{_sysconfdir}/init.d + +Name: android-tools +Epoch: 0 +Version: %{date}.%{git_commit} +Release: 1%{?dist} +Summary: Android platform tools (adb, fastboot, etc) + +Group: Applications/System +License: ASL 2.0 +URL: http://www.android.com/ +Source0: http://android.git.kernel.org/?p=platform/system/core.git;a=snapshot;h=327b2b7;sf=tgz;/%{packdname}.tar.gz +Source1: core-Makefile +Source2: adb-Makefile +Source3: fastboot-Makefile + +BuildRequires: zlib-devel + +%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. + +%prep +%setup -q -n %{packdname} +cp -p %{SOURCE1} Makefile +cp -p %{SOURCE2} adb/Makefile +cp -p %{SOURCE3} fastboot/Makefile + + + +%build +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_bindir} +make install DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} + +%files +%defattr(-,root,root,-) +%doc adb/OVERVIEW.TXT adb/SERVICES.TXT adb/protocol.txt +%{_bindir}/adb +%{_bindir}/fastboot + + +%changelog +* Wed May 18 2011 Ivan Afonichev - 20110516.327b2b7-1 +- Initial spec +- Initial makefiles + diff --git a/core-Makefile b/core-Makefile new file mode 100644 index 0000000..17f7152 --- /dev/null +++ b/core-Makefile @@ -0,0 +1,11 @@ +all: + $(MAKE) -C adb all + $(MAKE) -C fastboot all + +install: + $(MAKE) -C adb install + $(MAKE) -C fastboot install + +clean: + $(MAKE) -C adb clean + $(MAKE) -C fastboot clean diff --git a/fastboot-Makefile b/fastboot-Makefile new file mode 100644 index 0000000..1ba4f2d --- /dev/null +++ b/fastboot-Makefile @@ -0,0 +1,40 @@ +SRCS+= protocol.c +SRCS+= engine.c +SRCS+= bootimg.c +SRCS+= fastboot.c +SRCS+= usb_linux.c +SRCS+= util_linux.c + +VPATH+= ../libzipfile +SRCS+= centraldir.c +SRCS+= zipfile.c + +CPPFLAGS+= -DADB_HOST=1 +CPPFLAGS+= -DHAVE_FORKEXEC=1 +CPPFLAGS+= -DHAVE_SYMLINKS +CPPFLAGS+= -DHAVE_TERMIO_H +CPPFLAGS+= -D_GNU_SOURCE +CPPFLAGS+= -D_XOPEN_SOURCE +CPPFLAGS+= -I. +CPPFLAGS+= -I../include +CPPFLAGS+= -I../mkbootimg + + +CFLAGS+= -O2 -Wall -Wno-unused-parameter +LIBS= -lrt -lpthread -lz + +CC= $(TOOLCHAIN)gcc +LD= $(TOOLCHAIN)gcc + +OBJS= $(SRCS:.c=.o) + +all: fastboot + +fastboot: $(OBJS) + $(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) + +install: fastboot + install fastboot $(DESTDIR)$(BINDIR) + +clean: + rm -rf $(OBJS) diff --git a/sources b/sources new file mode 100644 index 0000000..f7f29ae --- /dev/null +++ b/sources @@ -0,0 +1 @@ +780220db9ac4216f82e82ff30fd6e2fa core-327b2b7.tar.gz