Integrate the legacy context-service into the agent service (2/2) 89/122089/2
authorMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 30 Mar 2017 07:05:37 +0000 (16:05 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 6 Apr 2017 07:41:39 +0000 (00:41 -0700)
This patch integrates the legacy contextd logic into contextd-agent.

Change-Id: I5a8c8372dcab37b6ee1f96dbdf6b28e12436f8fb
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
packaging/context-service.spec
src/agent/AgentMain.cpp
src/agent/CMakeLists.txt
src/agent/legacy/Server.cpp
src/agent/legacy/Server.h

index 14c6608..42a8c4f 100644 (file)
@@ -25,6 +25,19 @@ BuildRequires: pkgconfig(context-sensor-recorder-server)
 BuildRequires: pkgconfig(context-store-server)
 BuildRequires: pkgconfig(context-job-scheduler-server)
 
+# Legacy support. These dependencies will be removed.
+BuildRequires: pkgconfig(gmodule-2.0)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(capi-system-device)
+BuildRequires: pkgconfig(capi-appfw-app-manager)
+BuildRequires: pkgconfig(capi-appfw-package-manager)
+BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(cynara-creds-gdbus)
+BuildRequires: pkgconfig(cynara-client)
+BuildRequires: pkgconfig(cynara-session)
+BuildRequires: pkgconfig(context-common-legacy)
+# ---
+
 %description
 This is a systemd service that contains all features provided by the Tizen Contextual Service Framework.
 
index fc1dc8d..b1bfe89 100644 (file)
@@ -15,8 +15,9 @@
  */
 
 #include <cstdlib>
+#include "legacy/Server.h"
 
 int main(int argc, char* argv[])
 {
-       return EXIT_SUCCESS;
+       return mainLegacy();
 }
index a97f2b1..c476073 100644 (file)
@@ -4,7 +4,22 @@ SET(target "contextd-agent")
 
 SET(DEPS glib-2.0 gio-2.0 dlog capi-base-common)
 
-FILE(GLOB SRCS *.cpp)
+# Legacy support
+SET(DEPS ${DEPS}
+       gmodule-2.0
+       vconf
+       cynara-creds-gdbus
+       cynara-client
+       cynara-session
+       capi-system-device
+       capi-appfw-app-manager
+       capi-appfw-package-manager
+       notification
+       context-common-legacy
+)
+# ---
+
+FILE(GLOB_RECURSE SRCS *.cpp)
 MESSAGE("Sources: ${SRCS}")
 
 INCLUDE(FindPkgConfig)
@@ -14,6 +29,7 @@ FOREACH(flag ${DEPS_AGENT_PKG_CFLAGS})
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
 ENDFOREACH(flag)
 
+ADD_DEFINITIONS(-D_LIBDIR_="${CMAKE_INSTALL_LIBDIR}")
 ADD_EXECUTABLE(${target} ${SRCS})
 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-AGENT\"")
 TARGET_LINK_LIBRARIES(${target} ${DEPS_AGENT_PKG_LDFLAGS})
index 197b0d6..b6e1c50 100644 (file)
@@ -142,7 +142,7 @@ static void __signalHandler(int signo)
        QUIT(mainloop);
 }
 
-int main(int argc, char* argv[])
+int mainLegacy()
 {
        static struct sigaction signalAction;
        signalAction.sa_handler = __signalHandler;
index cd93bbf..621a6ea 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef _CONTEXT_SERVER_H_
 #define _CONTEXT_SERVER_H_
 
+int mainLegacy();
+
 namespace ctx {
 
        class RequestInfo;