From acf6d36ae085e6e9176e246502cf461ba994c826 Mon Sep 17 00:00:00 2001 From: youngman Date: Mon, 4 Jan 2016 11:04:18 +0900 Subject: Apply tizen common error in tizen 3.0 Change-Id: If637972aa189e3e1a505af92e8a3974fdb0a400f Signed-off-by: youngman --- CMakeLists.txt | 9 +++++---- daemon/CMakeLists.txt | 5 ++--- daemon/icd-cynara.c | 10 +++++----- lib/include/iotcon-errors.h | 4 ++-- packaging/iotcon.spec | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a6b4c4..6da4da0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,10 +10,11 @@ SET(CLIENT ${PROJECT_NAME}) SET(DAEMON "${PROJECT_NAME}-daemon") SET(DBUS_INTERFACE "org.tizen.${PROJECT_NAME}.dbus") -IF(NEW_SECURE) -CONFIGURE_FILE(${PROJECT_NAME}.conf.in ${PROJECT_NAME}.conf @ONLY) -INSTALL(FILES ${PROJECT_NAME}.conf DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/) -ENDIF(NEW_SECURE) +IF(TZ_VER_3) + ADD_DEFINITIONS("-DTZ_VER_3") + CONFIGURE_FILE(${PROJECT_NAME}.conf.in ${PROJECT_NAME}.conf @ONLY) + INSTALL(FILES ${PROJECT_NAME}.conf DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/) +ENDIF(TZ_VER_3) ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(lib) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index ae253cd..ab9c4e6 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -10,10 +10,9 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/common/ic-dbus.c SET(PKG_MODULES gio-2.0 dlog gio-unix-2.0 capi-system-info capi-system-system-settings iotivity) -IF(NEW_SECURE) +IF(TZ_VER_3) SET(PKG_MODULES ${PKG_MODULES} cynara-client cynara-session cynara-creds-gdbus) - ADD_DEFINITIONS("-DIOTCON_CYNARA") -ENDIF(NEW_SECURE) +ENDIF(TZ_VER_3) pkg_check_modules(daemon_pkgs REQUIRED ${PKG_MODULES}) diff --git a/daemon/icd-cynara.c b/daemon/icd-cynara.c index b015b49..e2ef6fb 100644 --- a/daemon/icd-cynara.c +++ b/daemon/icd-cynara.c @@ -17,7 +17,7 @@ #include #include #include -#ifdef IOTCON_CYNARA +#ifdef TZ_VER_3 #include #include #include @@ -36,13 +36,13 @@ static const char *_icd_privileges_network[] = { NULL, }; -#ifdef IOTCON_CYNARA +#ifdef TZ_VER_3 static cynara *_cynara; #endif int icd_cynara_init() { -#ifdef IOTCON_CYNARA +#ifdef TZ_VER_3 int ret; ret = cynara_initialize(&_cynara, NULL); @@ -57,7 +57,7 @@ int icd_cynara_init() void icd_cynara_deinit() { -#ifdef IOTCON_CYNARA +#ifdef TZ_VER_3 if (_cynara) cynara_finish(_cynara); @@ -68,7 +68,7 @@ void icd_cynara_deinit() static int _icd_cynara_check(GDBusMethodInvocation *invocation, const char **privileges) { -#ifdef IOTCON_CYNARA +#ifdef TZ_VER_3 FN_CALL; int i = 0; int ret; diff --git a/lib/include/iotcon-errors.h b/lib/include/iotcon-errors.h index a2f6f48..602ebee 100644 --- a/lib/include/iotcon-errors.h +++ b/lib/include/iotcon-errors.h @@ -18,8 +18,8 @@ #include -#ifndef TIZEN_ERROR_IOTCON -#define TIZEN_ERROR_IOTCON -0x09000000 +#ifndef TZ_VER_3 +#define TIZEN_ERROR_IOTCON -0x01C80000 #endif /** diff --git a/packaging/iotcon.spec b/packaging/iotcon.spec index 5159fc4..fc15986 100644 --- a/packaging/iotcon.spec +++ b/packaging/iotcon.spec @@ -66,14 +66,14 @@ cp %{SOURCE2001} . %build %if 0%{?tizen_version_major} < 3 -NEW_SECURE=0 +TZ_VER_3=0 %else -NEW_SECURE=1 +TZ_VER_3=1 %endif MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} \ - -DNEW_SECURE=${NEW_SECURE} + -DTZ_VER_3=${TZ_VER_3} %install -- cgit v1.2.3