From 88e59dbe2ec1f4f40b6af8e6dad150b57c7d1c83 Mon Sep 17 00:00:00 2001 From: "kh5325.kim" Date: Thu, 10 Oct 2013 21:32:23 +0900 Subject: [PATCH] cp sdbd.service file & clean up build script files Change-Id: Icfdd8a59092e7dd51a71ab87324a7a4f0726b4b3 Signed-off-by: kh5325.kim --- Makefile | 95 +---------------------------------------- packaging/sdbd.changes | 10 +++++ packaging/sdbd.spec | 38 ++++++++--------- packaging/sdbd_device.service | 10 +++++ packaging/sdbd_emulator.service | 15 +++++++ sdk_launch => script/sdk_launch | 0 6 files changed, 56 insertions(+), 112 deletions(-) create mode 100644 packaging/sdbd.changes create mode 100644 packaging/sdbd_device.service create mode 100644 packaging/sdbd_emulator.service rename sdk_launch => script/sdk_launch (100%) diff --git a/Makefile b/Makefile index 240e1be..dc0eb36 100644 --- a/Makefile +++ b/Makefile @@ -1,67 +1,8 @@ # # -# Makefile for sdb +# Makefile for sdbd # -# -HOST_OS := $(shell uname -s | tr A-Z a-z) - -# sdb host tool -# ========================================================= - -# Default to a virtual (sockets) usb interface -USB_SRCS := -EXTRA_SRCS := - -ifeq ($(HOST_OS),linux) - USB_SRCS := usb_linux.c - EXTRA_SRCS := get_my_path_linux.c - LOCAL_LDLIBS += -lrt -lncurses -lpthread -endif - -ifeq ($(HOST_OS),darwin) - USB_SRCS := usb_osx.c - EXTRA_SRCS := get_my_path_darwin.c - LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon - SDB_EXTRA_CFLAGS := -mmacosx-version-min=10.4 -endif - -ifeq ($(HOST_OS),freebsd) - USB_SRCS := usb_libusb.c - EXTRA_SRCS := get_my_path_freebsd.c - LOCAL_LDLIBS += -lpthread -lusb -endif - - - -SDB_SRC_FILES := \ - src/sdb.c \ - src/console.c \ - src/transport.c \ - src/transport_local.c \ - src/transport_usb.c \ - src/commandline.c \ - src/sdb_client.c \ - src/sockets.c \ - src/services.c \ - src/file_sync_client.c \ - src/$(EXTRA_SRCS) \ - src/$(USB_SRCS) \ - src/utils.c \ - src/usb_vendors.c \ - src/fdevent.c \ - src/socket_inaddr_any_server.c \ - src/socket_local_client.c \ - src/socket_local_server.c \ - src/socket_loopback_client.c \ - src/socket_loopback_server.c \ - src/socket_network_client.c - -SDB_CFLAGS := -O2 -g -DSDB_HOST=1 -DSDB_HOST_ON_TARGET=1 -Wall -Wno-unused-parameter -SDB_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -SDB_CFLAGS += -DHAVE_FORKEXEC -DHAVE_TERMIO_H -DHAVE_SYMLINKS -SDB_LFLAGS := $(LOCAL_LDLIBS) - SDBD_SRC_FILES := \ src/sdb.c \ src/fdevent.c \ @@ -94,36 +35,11 @@ IFLAGS := -Iinclude -Isrc -I/usr/include/system OBJDIR := bin INSTALLDIR := usr/sbin INITSCRIPTDIR := etc/init.d -RCSCRIPTDIR := etc/rc.d/rc3.d -LAUNCH_SCRIPT := sdk_launch - -UNAME := $(shell uname -sm) -ifneq (,$(findstring 86,$(UNAME))) - HOST_ARCH := x86 -endif -TARGET_ARCH = $(HOST_ARCH) -ifeq ($(TARGET_ARCH),) - TARGET_ARCH := arm -endif - -ifeq ($(TARGET_ARCH),arm) - MODULE := sdbd - SDBD_CFLAGS += -DANDROID_GADGET=1 -else -ifeq ($(TARGET_HOST),true) - MODULE := sdb -else - MODULE := sdbd -endif -endif +MODULE := sdbd all : $(MODULE) -sdb : $(SDB_SRC_FILES) - mkdir -p $(OBJDIR) - $(CC) -pthread -o $(OBJDIR)/$(MODULE) $(SDB_CFLAGS) $(SDB_EXTRA_CFLAGS) $(SDB_LFLAGS) $(IFLAGS) $(SDB_SRC_FILES) - sdbd : $(SDBD_SRC_FILES) mkdir -p $(OBJDIR) $(CC) -pthread -o $(OBJDIR)/$(MODULE) $(SDBD_CFLAGS) $(IFLAGS) $(SDBD_SRC_FILES) $(SDBD_LFLAGS) @@ -131,15 +47,8 @@ sdbd : $(SDBD_SRC_FILES) install : mkdir -p $(DESTDIR)/$(INSTALLDIR) install $(OBJDIR)/$(MODULE) $(DESTDIR)/$(INSTALLDIR)/$(MODULE) - install $(LAUNCH_SCRIPT) $(DESTDIR)/$(INSTALLDIR)/$(LAUNCH_SCRIPT) -ifeq ($(MODULE),sdbd) mkdir -p $(DESTDIR)/$(INITSCRIPTDIR) install script/sdbd $(DESTDIR)/$(INITSCRIPTDIR)/sdbd -endif -ifeq ($(TARGET_ARCH),x86) - mkdir -p $(DESTDIR)/$(RCSCRIPTDIR) - install script/S06sdbd $(DESTDIR)/$(RCSCRIPTDIR)/S06sdbd -endif clean : rm -rf $(OBJDIR)/* diff --git a/packaging/sdbd.changes b/packaging/sdbd.changes new file mode 100644 index 0000000..89f04c3 --- /dev/null +++ b/packaging/sdbd.changes @@ -0,0 +1,10 @@ +* Wed Apr 04 2013 Ho Namkoong + - supports platform gdbserver +* Mon Dec 02 2012 Yoonki Park + - supports cs report service using inotify +* Mon Dec 02 2012 Yoonki Park + - sdb code dropped from adb (Ice Cream Samdwich 4.1.1) +* Wed Apr 18 2012 Yoonki Park + - set dir permission to 777 +* Sat Mar 31 2012 Yoonki Park + - let sshd be daemon and create sshd.pid file \ No newline at end of file diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 44b3fe4..049e4e9 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -1,10 +1,13 @@ Name: sdbd Summary: SDB daemon -Version: 2.2.8 -Release: 1 -Group: TO_BE/FILLED_IN -License: TO BE FILLED IN +Version: 2.2.13 +Release: 0 +License: Apache-2.0 +Summary: SDB daemon +Group: System/Utilities Source0: %{name}-%{version}.tar.gz +Source1001: sdbd_device.service +Source1002: sdbd_emulator.service BuildRequires: capi-system-info-devel Requires(post): pkgmgr @@ -17,7 +20,7 @@ Requires: debug-launchpad Requires: dbus %description -Description: SDB daemon +Description: SDB daemon. %prep @@ -32,7 +35,17 @@ rm -rf %{buildroot} mkdir -p %{buildroot}/usr/share/license cp LICENSE %{buildroot}/usr/share/license/%{name} + %make_install +mkdir -p %{buildroot}%{_libdir}/systemd/system +%if 0%{?simulator} +install -m 0644 %SOURCE1001 %{buildroot}%{_libdir}/systemd/system/sdbd.service +%else +install -m 0644 %SOURCE1002 %{buildroot}%{_libdir}/systemd/system/sdbd.service +%endif + +mkdir -p %{buildroot}%{_prefix}/sbin +install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/ %post chsmack -a sdbd::home /home/developer @@ -45,19 +58,6 @@ chsmack -t /home/developer %{_prefix}/sbin/sdk_launch %{_sysconfdir}/init.d/sdbd /usr/share/license/%{name} - -%ifarch %{ix86} - %{_sysconfdir}/rc.d/rc3.d -%endif +%{_libdir}/systemd/system/sdbd.service %changelog -* Wed Apr 04 2013 Ho Namkoong - - supports platform gdbserver -* Mon Dec 02 2012 Yoonki Park - - supports cs report service using inotify -* Mon Dec 02 2012 Yoonki Park - - sdb code dropped from adb (Ice Cream Samdwich 4.1.1) -* Wed Apr 18 2012 Yoonki Park - - set dir permission to 777 -* Sat Mar 31 2012 Yoonki Park - - let sshd be daemon and create sshd.pid file diff --git a/packaging/sdbd_device.service b/packaging/sdbd_device.service new file mode 100644 index 0000000..0b92d85 --- /dev/null +++ b/packaging/sdbd_device.service @@ -0,0 +1,10 @@ +[Unit] +Description=sdbd +After=default.target + +[Service] +Type=forking +Environment=DISPLAY=:0 +PIDFile=/tmp/.sdbd.pid +RemainAfterExit=yes +ExecStart=/usr/sbin/sdbd diff --git a/packaging/sdbd_emulator.service b/packaging/sdbd_emulator.service new file mode 100644 index 0000000..274c3e9 --- /dev/null +++ b/packaging/sdbd_emulator.service @@ -0,0 +1,15 @@ +[Unit] +Description=sdbd +Before=sensord.service + +[Service] +Type=forking +Environment=DISPLAY=:0 +PIDFile=/tmp/.sdbd.pid +RemainAfterExit=yes +ExecStartPre=/bin/bash -c "/bin/echo `/bin/sed 's/^.*sdb_port=\([^, ]*\).*$/\1/g' /proc/cmdline` > /opt/home/sdb_port.txt" +ExecStart=/usr/sbin/sdbd + +[Install] +WantedBy=emulator.target + diff --git a/sdk_launch b/script/sdk_launch similarity index 100% rename from sdk_launch rename to script/sdk_launch -- 2.7.4