cleanup cmacklists 16/51416/5
authorJeesun Kim <iamjs.kim@samsung.com>
Mon, 9 Nov 2015 10:20:31 +0000 (19:20 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Thu, 12 Nov 2015 02:29:47 +0000 (11:29 +0900)
Change-Id: Ib6b0583d35879190210500552fda44ec8d69f701

17 files changed:
CMakeLists.txt
client/CMakeLists.txt
client/cal_client_ipc.c
client/cal_client_reminder.c
client/cal_client_reminder.h
client/cal_client_service_helper.c
client/calendar-service2.pc.in
common/cal_vcalendar_parse.c
packaging/calendar-service.spec
server/CMakeLists.txt
server/cal_access_control.h
server/cal_server.c
server/cal_server_contacts.c
server/cal_server_ipc.c
server/cal_server_service.c
server/db/cal_db_instance.c
server/db/cal_db_util.c

index 126e1a1..7a8f14f 100755 (executable)
@@ -1,48 +1,18 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(calendar-service C CXX)
 
-SET(DEST_INCLUDE_DIR "include/calendar-service")
-SET(SRC_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
-
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(EXEC_PREFIX "\${prefix}")
-SET(LIBDIR ${LIB_INSTALL_DIR})
-SET(INCLUDEDIR "\${prefix}/${DEST_INCLUDE_DIR}")
-
-EXECUTE_PROCESS(COMMAND build-util/generator.sh)
-
-#INCLUDE_DIRECTORIES(${SRC_INCLUDE_DIR})
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -I${CMAKE_SOURCE_DIR}/include")
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED
-       glib-2.0
-       db-util
-       sqlite3
-       vconf
-       alarm-service
-       icu-i18n
-       contacts-service2
-       capi-appfw-package-manager
-       libtzplatform-config
-)
-
-FOREACH(flag ${pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections")
 
+SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
-#SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 
+SET(CLIENT calendar-service2)
+SET(DAEMON calendar-serviced)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 
-# Install header file
-FILE(GLOB HEADER_FILES ${SRC_INCLUDE_DIR}/calendar*.h)
-INSTALL(FILES ${HEADER_FILES} DESTINATION ${INCLUDEDIR}2)
+EXECUTE_PROCESS(COMMAND build-util/generator.sh)
 
-#ADD_SUBDIRECTORY(schema)
 ADD_SUBDIRECTORY(client)
 ADD_SUBDIRECTORY(server)
index 503cece..5b26e1d 100755 (executable)
@@ -1,93 +1,40 @@
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/ipc)
-LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
-
-SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
-
-SET(CALSVC2 calendar-service2)
-
-SET(SRCS
-       cal_client_ipc.c
-       cal_client_service.c
-       cal_client_service_helper.c
-       cal_client_db.c
-       cal_client_db_helper.c
-       cal_client_reminder.c
-       cal_client_handle.c
-       cal_client_utils.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_alarm.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_attendee.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_calendar.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_event.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_allday.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_allday_extended.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_normal.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_normal_extended.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_search.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_timezone.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_todo.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_updated_info.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_calendar.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_event.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_todo.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_attendee.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_alarm.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_search.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_timezone.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_updated_info.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_normal.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_allday.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_normal_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_allday_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_view.c
-       ${CMAKE_SOURCE_DIR}/common/cal_filter.c
-       ${CMAKE_SOURCE_DIR}/common/cal_query.c
-       ${CMAKE_SOURCE_DIR}/common/cal_inotify.c
-       ${CMAKE_SOURCE_DIR}/common/cal_list.c
-       ${CMAKE_SOURCE_DIR}/common/cal_time.cpp
-       ${CMAKE_SOURCE_DIR}/common/cal_vcalendar.c
-       ${CMAKE_SOURCE_DIR}/common/cal_vcalendar_make.c
-       ${CMAKE_SOURCE_DIR}/common/cal_vcalendar_parse.c
-       ${CMAKE_SOURCE_DIR}/common/cal_mutex.c
-       ${CMAKE_SOURCE_DIR}/common/cal_handle.c
-       ${CMAKE_SOURCE_DIR}/common/cal_utils.c
-       )
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/client)
 
-INCLUDE(FindPkgConfig)
-pkg_check_modules(service2_pkgs REQUIRED
+FILE(GLOB CLIENT_SRCS
+       ${CMAKE_SOURCE_DIR}/common/ipc/*.c
+       ${CMAKE_SOURCE_DIR}/common/*.c*
+       *.c)
+
+pkg_check_modules(client_pkgs REQUIRED
+       glib-2.0
+       db-util
+       sqlite3
+       vconf
+       alarm-service
+       icu-i18n
+       contacts-service2
+       libtzplatform-config
+       capi-appfw-package-manager
        pims-ipc
        dlog
-       capi-base-common
-       )
-
-FOREACH(flag ${service2_pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
-
-SET(service2_pkgs_LDFLAGS "${pkgs_LDFLAGS} ${service2_pkgs_LDFLAGS}")
+       capi-base-common)
+INCLUDE_DIRECTORIES(${client_pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${client_pkgs_LIBRARY_DIRS})
 
 ADD_DEFINITIONS("-DCAL_IPC_CLIENT")
-ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
-
-#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-
-ADD_LIBRARY(${CALSVC2} SHARED ${SRCS})
-SET_TARGET_PROPERTIES(${CALSVC2} PROPERTIES SOVERSION ${MAJORVER})
-SET_TARGET_PROPERTIES(${CALSVC2} PROPERTIES VERSION ${FULLVER})
-TARGET_LINK_LIBRARIES(${CALSVC2} ${service2_pkgs_LDFLAGS})
 
-INSTALL(TARGETS ${CALSVC2} DESTINATION ${LIB_INSTALL_DIR})
+ADD_LIBRARY(${CLIENT} SHARED ${CLIENT_SRCS})
+TARGET_LINK_LIBRARIES(${CLIENT} ${client_pkgs_LIBRARIES})
+SET_TARGET_PROPERTIES(${CLIENT} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
+INSTALL(TARGETS ${CLIENT} DESTINATION ${LIB_INSTALL_DIR})
 
-#pc
-CONFIGURE_FILE(${CALSVC2}.pc.in ${CALSVC2}.pc @ONLY)
-INSTALL(FILES ${CALSVC2}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+# pc
+CONFIGURE_FILE(${CLIENT}.pc.in ${CLIENT}.pc @ONLY)
+INSTALL(FILES ${CLIENT}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
+# header
+FILE(GLOB CLIENT_HEADER ${CMAKE_SOURCE_DIR}/include/*.h)
+INSTALL(FILES ${CLIENT_HEADER} DESTINATION ${INCLUDE_INSTALL_DIR}/${CLIENT})
index 035a26e..d579921 100644 (file)
@@ -22,6 +22,8 @@
 #include <glib-object.h>
 #include <errno.h>
 #include <pthread.h>
+#include <unistd.h>
+#include <sys/types.h>
 
 #include "calendar_db.h"
 #include "calendar_types.h"
@@ -38,6 +40,7 @@
 #include "cal_ipc_marshal.h"
 #include "cal_handle.h"
 #include "cal_utils.h"
+#include "cal_client_reminder.h"
 
 typedef struct {
        pims_ipc_h ipc;
@@ -369,6 +372,7 @@ int cal_client_ipc_client_check_permission(calendar_h handle, int permission, bo
                pims_ipc_data_destroy(outdata);
                return CALENDAR_ERROR_IPC;
        }
+       pims_ipc_data_destroy(outdata);
 
        return ipc_ret;
 }
index ca7599a..3189c64 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <stdlib.h>
 #include <pims-ipc.h>
+#include <unistd.h>
+#include <sys/types.h>
 
 #include "calendar.h"
 #include "cal_internal.h"
@@ -31,6 +33,7 @@
 #include "cal_ipc.h"
 #include "cal_ipc_marshal.h"
 #include "cal_client_ipc.h"
+#include "cal_client_handle.h"
 
 typedef struct {
        calendar_reminder_cb cb;
index 9a11097..871dd50 100644 (file)
@@ -22,5 +22,6 @@
 
 int cal_client_reminder_create_for_subscribe(void);
 int cal_client_reminder_destroy_for_subscribe(void);
+int cal_client_recovery_for_change_subscription(void);
 
 #endif /* __CAL_CLIENT_REMINDER_H__ */
index 7a288f9..ec0db3e 100644 (file)
@@ -17,6 +17,8 @@
  *
  */
 
+ #include <unistd.h>
+
 #include "calendar_types.h"
 #include "cal_internal.h"
 #include "cal_typedef.h"
@@ -27,6 +29,7 @@
 #include "cal_client_handle.h"
 #include "cal_client_ipc.h"
 #include "cal_client_utils.h"
+#include "cal_client_reminder.h"
 
 static void _cal_client_ipc_initialized_cb(void *user_data)
 {
@@ -58,7 +61,9 @@ int cal_client_connect(calendar_h handle, unsigned int id, int *connection_count
        DBG("[Connection count:handle] (%d)", h->connection_count);
 
        if (0 == *connection_count) { /* total connection */
+#if !GLIB_CHECK_VERSION(2,35,0)
                g_type_init(); /* for alarmmgr */
+#endif
                ret = cal_inotify_init();
                if (CALENDAR_ERROR_NONE != ret) {
                        ERR("cal_inotify_init() Fail(%d)", ret);
index 280a170..a463377 100644 (file)
@@ -1,13 +1,13 @@
 # Package Information for pkg-config
 
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}/bin
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
 
-Name: @CALSVC2@
-Description: @CALSVC2@ library
+Name: @CLIENT@
+Description: @CLIENT@ library
 Version: @FULLVER@
 Requires: glib-2.0 alarm-service capi-base-common
-Libs: -L${libdir} -l@CALSVC2@
-Cflags: -I${includedir}2
+Libs: -L${libdir} -l@CLIENT@
+Cflags: -I${includedir}/@CLIENT@
index c8392f6..5a78759 100644 (file)
@@ -29,6 +29,7 @@
 #include "cal_time.h"
 #include "cal_vcalendar.h"
 #include "cal_vcalendar_parse.h"
+#include "cal_utils.h"
 
 /*
  * LF | \n | 0x0A
@@ -742,13 +743,10 @@ static char* __decode_charset(char *p)
                return cal_strdup(p + 1);
        }
 
-       /* param start */
-       int len_param = strlen(t[0]);
-
        char **s = NULL;
        s = g_strsplit(t[0], ";", -1);
        if (NULL == s) {
-               ERR("g_strsplit() failed");
+               ERR("g_strsplit() Fail");
                g_strfreev(t);
                return NULL;
        }
@@ -829,7 +827,7 @@ static char* __decode_datetime(char *p, struct user_data *ud)
        /* param start */
        char **s = NULL;
        s = g_strsplit(p, ";", -1);
-       RETVM_IF(NULL == s, p + strlen(p) - len_param, "g_strsplit() failed");
+       RETVM_IF(NULL == s, p + strlen(p) - len_param, "g_strsplit() Fail");
 
        int count_param = g_strv_length(s);
        DBG("count_param(%d)", count_param);
index 31cc346..1280857 100644 (file)
@@ -1,6 +1,6 @@
 Name:       calendar-service
 Summary:    DB library for calendar
-Version:    0.1.152
+Version:    0.1.153
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
@@ -24,15 +24,15 @@ BuildRequires: pkgconfig(sqlite3)
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(alarm-service)
 BuildRequires: pkgconfig(icu-i18n)
-BuildRequires: pkgconfig(capi-base-common)
-BuildRequires: pkgconfig(contacts-service2)
 BuildRequires: pkgconfig(pims-ipc)
-BuildRequires: pkgconfig(capi-appfw-package-manager)
 BuildRequires: pkgconfig(accounts-svc)
-BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(contacts-service2)
+BuildRequires: pkgconfig(alarm-service)
 BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(capi-base-common)
+BuildRequires: pkgconfig(capi-appfw-package-manager)
+BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(libsmack)
 
 %description
@@ -57,9 +57,9 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-        -DMAJORVER=${MAJORVER} \
-        -DFULLVER=%{version}
+%cmake . -DBIN_INSTALL_DIR:PATH=%{_bindir} \
+               -DMAJORVER=${MAJORVER} \
+               -DFULLVER=%{version}
 
 
 make %{?jobs:-j%jobs}
index 392b09d..9cebd22 100755 (executable)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/db)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/ipc)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/db)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/schema)
-LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
-LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/server)
 
-SET(DAEMON calendar-serviced)
-SET(LIBNAME calendar-service-server)
+FILE(GLOB DAEMON_SRCS
+       ${CMAKE_SOURCE_DIR}/common/ipc/*.c
+       ${CMAKE_SOURCE_DIR}/common/*.c*
+       db/*.c
+       *.c)
 
-SET(LIBSRCS
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_alarm.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_attendee.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_calendar.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_event.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_allday.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_allday_extended.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_normal.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_instance_normal_extended.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_search.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_timezone.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_todo.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_updated_info.c
-       ${CMAKE_SOURCE_DIR}/common/ipc/cal_ipc_marshal_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_calendar.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_event.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_todo.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_attendee.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_alarm.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_search.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_timezone.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_updated_info.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_normal.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_allday.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_normal_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_instance_allday_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_record_extended.c
-       ${CMAKE_SOURCE_DIR}/common/cal_view.c
-       ${CMAKE_SOURCE_DIR}/common/cal_filter.c
-       ${CMAKE_SOURCE_DIR}/common/cal_query.c
-       ${CMAKE_SOURCE_DIR}/common/cal_list.c
-       ${CMAKE_SOURCE_DIR}/common/cal_time.cpp
-       ${CMAKE_SOURCE_DIR}/common/cal_inotify.c
-    ${CMAKE_SOURCE_DIR}/common/cal_vcalendar.c
-    ${CMAKE_SOURCE_DIR}/common/cal_vcalendar_make.c
-    ${CMAKE_SOURCE_DIR}/common/cal_vcalendar_parse.c
-       ${CMAKE_SOURCE_DIR}/common/cal_mutex.c
-       ${CMAKE_SOURCE_DIR}/common/cal_handle.c
-       ${CMAKE_SOURCE_DIR}/common/cal_utils.c
-       cal_access_control.c
-       cal_server_service.c
-       cal_server_ipc.c
-       cal_server_ondemand.c
-       db/cal_db.c
-       db/cal_db_util.c
-       db/cal_db_rrule.c
-       db/cal_db_query.c
-       db/cal_db_plugin_todo.c
-       db/cal_db_plugin_search.c
-       db/cal_db_plugin_calendar.c
-       db/cal_db_plugin_calendar_helper.c
-       db/cal_db_plugin_event.c
-       db/cal_db_plugin_event_helper.c
-       db/cal_db_plugin_alarm.c
-       db/cal_db_plugin_alarm_helper.c
-       db/cal_db_plugin_attendee.c
-       db/cal_db_plugin_attendee_helper.c
-       db/cal_db_plugin_timezone.c
-       db/cal_db_plugin_timezone_helper.c
-       db/cal_db_plugin_instance_normal.c
-       db/cal_db_plugin_instance_normal_extended.c
-       db/cal_db_plugin_instance_allday.c
-       db/cal_db_plugin_instance_allday_extended.c
-       db/cal_db_plugin_extended.c
-       db/cal_db_plugin_extended_helper.c
-       db/cal_db_instance.c
-       db/cal_db_instance_helper.c
-)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(calserver_pkgs REQUIRED
-       dlog
-       pims-ipc
+pkg_check_modules(daemon_pkgs REQUIRED
+       glib-2.0
        db-util
+       sqlite3
+       vconf
        alarm-service
-       capi-base-common
        icu-i18n
+       contacts-service2
+       libtzplatform-config
+       capi-appfw-package-manager
+       pims-ipc
+       dlog
+       capi-base-common
        accounts-svc
        capi-appfw-application
-       libtzplatform-config
-       libsmack
-)
-
-FOREACH(flag ${calserver_pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIE")
-SET(calserver_pkgs_LDFLAGS "${pkgs_LDFLAGS} ${calserver_pkgs_LDFLAGS}")
+       libsmack)
+INCLUDE_DIRECTORIES(${daemon_pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${daemon_pkgs_LIBRARY_DIRS})
 
 ADD_DEFINITIONS("-DCAL_IPC_SERVER")
-ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 
-ADD_LIBRARY(${LIBNAME} STATIC ${LIBSRCS})
-TARGET_LINK_LIBRARIES(${LIBNAME} ${calserver_pkgs_LDFLAGS})
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--hash-style=both -pie")
 
-#cmake_policy(SET CMP0002 OLD)
-ADD_EXECUTABLE(${DAEMON}
-       cal_server.c
-       cal_server_contacts.c
-       cal_server_alarm.c
-       cal_server_calendar_delete.c
-       cal_server_reminder.c
-       cal_server_schema.c
-       cal_server_update.c
-       )
+ADD_EXECUTABLE(${DAEMON} ${DAEMON_SRCS})
 SET_TARGET_PROPERTIES(${DAEMON} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
-TARGET_LINK_LIBRARIES(${DAEMON} ${calserver_pkgs_LDFLAGS} ${LIBNAME} -pie)
+TARGET_LINK_LIBRARIES(${DAEMON} ${daemon_pkgs_LIBRARIES})
 
-INSTALL(TARGETS ${DAEMON} DESTINATION bin)
+INSTALL(TARGETS ${DAEMON} DESTINATION ${BIN_INSTALL_DIR})
index 4ba8583..20795e5 100644 (file)
@@ -32,5 +32,7 @@ char* cal_access_control_get_label(void);
 void cal_access_control_reset(void);  // reset read_list, write_list..
 bool cal_access_control_have_write_permission(int book_id);
 int cal_is_owner(int book_id);
+bool cal_access_control_have_permission(pims_ipc_h ipc, cal_permission_e permission);
+
 
 #endif /*  __CALENDAR_SVC_ACCESS_CONTROL_H__ */
index 67d3bef..de520a1 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
-#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <glib-object.h>
+#include <glib.h>
+#include <glib/gstdio.h>
+#include <grp.h>
+#include <sys/param.h>
+#include <unistd.h>
 #include <alarm.h>
 #include <contacts.h>
 #include <account.h>
 
 #include "calendar.h"
-#include "cal_internal.h" // DBG
+#include "cal_typedef.h"
+#include "cal_internal.h"
 #include "cal_ipc.h"
 #include "cal_server_ipc.h"
 #include "cal_inotify.h"
@@ -38,6 +45,7 @@
 #include "cal_server_calendar_delete.h"
 #include "cal_server_schema.h"
 #include "cal_server_update.h"
+#include "cal_server_service.h"
 #include "cal_access_control.h"
 #include "cal_db_plugin_calendar_helper.h"
 #include "cal_time.h"
@@ -99,7 +107,9 @@ static void _cal_server_init(void)
        int ret;
        int on_contact = 0;
        int try_count = 0;
+#if !GLIB_CHECK_VERSION(2,35,0)
        g_type_init();
+#endif
 
 
        //loop = g_main_loop_new(NULL, FALSE);
index bcf7807..a2e9b30 100644 (file)
@@ -585,7 +585,7 @@ static gpointer _cal_server_contacts_sync_main(gpointer user_data)
                }
                cal_access_control_unset_client_info();
 
-               calendar_disconnect();
+               cal_disconnect();
 
                g_mutex_lock(&_cal_server_contacts_sync_mutex);
                DBG("wait");
index fff4a5b..4379ed8 100644 (file)
@@ -20,6 +20,8 @@
 #include <stdlib.h>
 #include <malloc.h>
 #include <glib.h>
+#include <unistd.h>
+#include <sys/types.h>
 #include <pims-ipc-data.h>
 #include <pims-ipc-svc.h>
 
@@ -1581,7 +1583,9 @@ DATA_FREE:
 
 int cal_server_ipc_init(void)
 {
+#if !GLIB_CHECK_VERSION(2,35,0)
        g_type_init();
+#endif
 
        char sock_file[CAL_STR_MIDDLE_LEN] = {0};
        snprintf(sock_file, sizeof(sock_file), CAL_SOCK_PATH"/.%s", getuid(), CAL_IPC_SERVICE);
index cc52bd9..a01584d 100644 (file)
 
 #include "cal_internal.h"
 #include "cal_typedef.h"
-#include "cal_db_util.h"
 #include "cal_view.h"
-#include "cal_mutex.h"
+#include "cal_db_util.h"
 #include "cal_utils.h"
 #include "cal_mutex.h"
+#include "cal_inotify.h"
 
 static int cal_total_connection = 0;
 static TLS int cal_thread_connection = 0;
@@ -37,7 +37,9 @@ int cal_connect(void)
 
        cal_mutex_lock(CAL_MUTEX_CONNECTION);
        if (0 == cal_total_connection) {
+#if !GLIB_CHECK_VERSION(2,35,0)
                g_type_init();  // added for alarmmgr
+#endif
                cal_view_initialize();
                ret = cal_inotify_init();
                if (CALENDAR_ERROR_NONE != ret) {
index 14b776f..569d1f8 100644 (file)
 
 #include "calendar_db.h"
 #include "calendar_types.h"
-
 #include "cal_internal.h"
 #include "cal_typedef.h"
 #include "cal_view.h"
 #include "cal_time.h"
 #include "cal_record.h"
-
-#include "cal_db_util.h"
-#include "cal_db.h"
 #include "cal_db_instance_helper.h"
+#include "cal_db.h"
+#include "cal_db_util.h"
+#include "cal_db_plugin_timezone_helper.h"
 
 #define ms2sec(ms) (long long int)(ms / 1000.0)
 #define sec2ms(s) (s * 1000.0)
index d3ea9e8..02bfc96 100644 (file)
@@ -21,6 +21,8 @@
 #include <stdbool.h>
 #include <db-util.h>
 #include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include "cal_internal.h"
 #include "cal_typedef.h"