revise packaging and build scripts, fix dbus environment from system to 69/56769/4
authorYoungjae Shin <yj99.shin@samsung.com>
Tue, 12 Jan 2016 11:56:03 +0000 (20:56 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Fri, 15 Jan 2016 01:41:06 +0000 (10:41 +0900)
session.

Change-Id: I215edd346f15ff63c6aacad225f7324d5f4e2a5a

26 files changed:
CMakeLists.txt [changed mode: 0755->0644]
build-util/DB-schema-gen.c [changed mode: 0755->0644]
build-util/Makefile [changed mode: 0755->0644]
build-util/schema.sql [changed mode: 0755->0644]
client/CMakeLists.txt [changed mode: 0755->0644]
client/cal_client_dbus.c
common/CMakeLists.txt [changed mode: 0755->0644]
common/cal_vcalendar_parse.c
common/dbus/CMakeLists.txt [changed mode: 0755->0644]
common/dbus/cal_dbus.xml
common/dbus/cal_dbus_helper.h
doc/images/alarm_process.png [changed mode: 0755->0644]
doc/images/calendar_model.png [changed mode: 0755->0644]
doc/images/entities.png [changed mode: 0755->0644]
doc/images/properties.png [changed mode: 0755->0644]
doc/images/view_db.png [changed mode: 0755->0644]
doc/images/view_property.png [changed mode: 0755->0644]
packaging/calendar-service-alarm.service
packaging/calendar-service.conf.in [moved from packaging/org.tizen.calendar_service.dbus.conf.in with 94% similarity]
packaging/calendar-service.manifest [moved from calendar-service.manifest with 100% similarity]
packaging/calendar-service.spec
packaging/calendar-serviced.service
packaging/org.tizen.CalendarService.dbus.service [new file with mode: 0644]
packaging/org.tizen.calendar_service.dbus.service [deleted file]
server/CMakeLists.txt [changed mode: 0755->0644]
server/cal_server_dbus.c

old mode 100755 (executable)
new mode 100644 (file)
index 80d7b1a..88ff28b
@@ -6,18 +6,16 @@ INCLUDE(FindPkgConfig)
 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(INTERFACE_PREFIX "org.tizen.calendar_service")
-SET(DBUS_INTERFACE "${INTERFACE_PREFIX}.dbus")
 
 SET(CLIENT calendar-service2)
 SET(DAEMON calendar-serviced)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 
-EXECUTE_PROCESS(COMMAND build-util/generator.sh)
+IF(NOT DEFINED DBUS_INTERFACE)
+       MESSAGE("No DBUS_INTERFACE. Check build system")
+       SET(DBUS_INTERFACE "org.tizen.CalendarService.dbus")
+ENDIF(NOT DEFINED DBUS_INTERFACE)
 
-CONFIGURE_FILE(${DBUS_INTERFACE}.conf.in ${DBUS_INTERFACE}.conf @ONLY)
-INSTALL(FILES ${DBUS_INTERFACE}.conf DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
+EXECUTE_PROCESS(COMMAND build-util/generator.sh)
 
 ADD_SUBDIRECTORY(common)
 ADD_SUBDIRECTORY(client)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 0b10e9f..c4d427c
@@ -15,7 +15,6 @@ pkg_check_modules(client_pkgs REQUIRED
        glib-2.0
        db-util
        sqlite3
-       vconf
        alarm-service
        icu-i18n
        contacts-service2
index f8c3917..a1676cf 100644 (file)
@@ -171,7 +171,7 @@ int cal_dbus_start(void)
        }
 
        GError *error = NULL;
-       cal_dbus_object = cal_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
+       cal_dbus_object = cal_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION,
                        G_DBUS_PROXY_FLAGS_NONE,
                        CAL_DBUS_INTERFACE,
                        CAL_DBUS_OBJPATH,
@@ -225,7 +225,7 @@ int cal_dbus_recovery(void)
        }
 
        GError *error = NULL;
-       cal_dbus_object = cal_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
+       cal_dbus_object = cal_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION,
                        G_DBUS_PROXY_FLAGS_NONE,
                        CAL_DBUS_INTERFACE,
                        CAL_DBUS_OBJPATH,
old mode 100755 (executable)
new mode 100644 (file)
index c7ca22c..9e2879c 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <stdlib.h>
 #include <ctype.h>
-#include <vconf.h>
 
 #include "calendar_list.h"
 #include "cal_internal.h"
old mode 100755 (executable)
new mode 100644 (file)
index 64dbb2d..10bf004
@@ -1,15 +1,16 @@
 SET(CAL_DBUS "cal_dbus")
+STRING(REPLACE ".dbus" "." INTERFACE_PREFIX ${DBUS_INTERFACE})
 
 FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
 
 ADD_CUSTOM_COMMAND(
        OUTPUT dbus
        COMMAND ${GDBUS_CODEGEN} --generate-c-code ${CAL_DBUS}
-                       --interface-prefix ${INTERFACE_PREFIX}.
+                       --interface-prefix ${INTERFACE_PREFIX}
                        --c-namespace cal
                        ${CAL_DBUS}.xml
        DEPENDS ${CAL_DBUS}.xml
        COMMENT "Generated cal_dbus.c/h file")
 
 ADD_CUSTOM_TARGET(GENERATED_DBUS_CODE DEPENDS dbus)
-# gdbus-codegen  --generate-c-code cal_dbus --interface-prefix org.tizen.calendar_service. --c-namespace cal cal_dbus.xml
+# gdbus-codegen  --generate-c-code cal_dbus --interface-prefix org.tizen.CalendarService. --c-namespace cal cal_dbus.xml
index 9650d33..05776db 100644 (file)
@@ -1,5 +1,5 @@
 <node>
-       <interface name="org.tizen.calendar_service.dbus">
+       <interface name="org.tizen.CalendarService.dbus">
                <method name="register_resource">
                        <arg type="i" name="ret" direction="out"/>
                </method>
index 8293809..81d72f9 100644 (file)
@@ -25,7 +25,7 @@
  * Each element must only contain the ASCII characters "[A-Z][a-z][0-9]_" and must not begin with a digit.
  */
 #ifndef CAL_DBUS_INTERFACE
-#define CAL_DBUS_INTERFACE "org.tizen.calendar_service.dbus"
+#define CAL_DBUS_INTERFACE "org.tizen.CalendarService.dbus"
 #warning "CAL_DBUS_INTERFACE is redefined"
 #endif
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e2f908b..fded9c0 100644 (file)
@@ -2,10 +2,7 @@
 Description=Calendar Service Alarm
 
 [Service]
-Type=simple
+Type=dbus
 BusName=ALARM.acalendar-service
 Environment="TIMEOUT=0"
 ExecStart=/usr/bin/calendar-serviced $TIMEOUT
-
-[Install]
-WantedBy=default.target
similarity index 94%
rename from packaging/org.tizen.calendar_service.dbus.conf.in
rename to packaging/calendar-service.conf.in
index 7a8501f..5ef11fa 100644 (file)
@@ -3,24 +3,24 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
     <policy user="root">
-        <allow own="org.tizen.calendar_service.dbus"/>
+        <allow own="@DBUS_INTERFACE@"/>
                <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
                <allow receive_sender="@DBUS_INTERFACE@"/>
     </policy>
     <policy user="system">
-        <allow own="org.tizen.calendar_service.dbus"/>
+        <allow own="@DBUS_INTERFACE@"/>
                <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
                <allow receive_sender="@DBUS_INTERFACE@"/>
     </policy>
     <policy group="users">
-        <allow own="org.tizen.calendar_service.dbus"/>
+        <allow own="@DBUS_INTERFACE@"/>
                <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
     </policy>
        <policy at_console="true">
                <allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
        </policy>
     <policy context="default">
-        <allow send_destination="org.tizen.calendar_service.dbus"/>
+        <allow send_destination="@DBUS_INTERFACE@"/>
                <check send_destination="@DBUS_INTERFACE@"
                                send_interface="@DBUS_INTERFACE@" send_member="insert_record"
                                privilege="http://tizen.org/privilege/calendar.write"/>
index 6bd5614..81f0c8f 100644 (file)
@@ -1,25 +1,19 @@
 Name:       calendar-service
 Summary:    DB library for calendar
-Version:    0.1.156
+Version:    0.1.157
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}d.service
-Source2:       org.tizen.calendar_service.dbus.service
-Source3:    ALARM.a%{name}.service
-Source4:       org.tizen.calendar_service.dbus.conf.in
-Source5:       %{name}-alarm.service
-
+Source2:    org.tizen.CalendarService.dbus.service
+Source1001: %{name}.manifest
+Source1002: %{name}.conf.in
+Source2001: %{name}-alarm.service
+Source2002: ALARM.a%{name}.service
 %if "%{?tizen_profile_name}" == "wearable"
 ExcludeArch: %{arm} %ix86 x86_64
 %endif
-
-Requires(post): /sbin/ldconfig
-Requires(post): /usr/bin/sqlite3, /bin/chown
-Requires(post): contacts-service2
-Requires(postun): /sbin/ldconfig
-
 BuildRequires: cmake
 BuildRequires: pkgconfig(db-util)
 BuildRequires: pkgconfig(sqlite3)
@@ -35,9 +29,13 @@ BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(capi-appfw-package-manager)
 BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(libsmack)
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%define _dbus_interface org.tizen.CalendarService.dbus
 
 %description
-DB library for calendar
+Calendar Service for using Calendar DB
 
 %package devel
 Summary:    DB library for calendar
@@ -46,11 +44,14 @@ Requires:   %{name} = %{version}-%{release}
 Requires:   pkgconfig(alarm-service)
 
 %description devel
-DB library for calendar (developement files)
+Calendar Service for using Calendar DB(development Kit)
+
 
 %prep
 %setup -q
-cp %{SOURCE4} .
+chmod g-w %_sourcedir/*
+cp %{SOURCE1001} .
+
 
 %build
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
@@ -58,48 +59,51 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} \
+               -DDBUS_INTERFACE=%{_dbus_interface}
 
-%cmake . -DBIN_INSTALL_DIR:PATH=%{_bindir} \
-               -DMAJORVER=${MAJORVER} \
-               -DFULLVER=%{version}
 
 make %{?jobs:-j%jobs}
 
+
 %install
+rm -rf %{buildroot}
 %make_install
 
 mkdir -p %{buildroot}%{_unitdir_user}/default.target.wants
-install -m 0644 %SOURCE1 %{buildroot}%{_unitdir_user}/%{name}d.service
-ln -s ../%{name}d.service %{buildroot}%{_unitdir_user}/default.target.wants/%{name}d.service
-install -m 0644 %SOURCE5 %{buildroot}%{_unitdir_user}/%{name}-alarm.service
+install -m 0644 %SOURCE1 %{buildroot}%{_unitdir_user}
 
-mkdir -p %{buildroot}%{_datadir}/license
-cp LICENSE.APLv2 %{buildroot}%{_datadir}/license/%{name}
+mkdir -p %{buildroot}%{_datadir}/dbus-1/services
+install -m 0644 %SOURCE2 %{buildroot}%{_datadir}/dbus-1/services
 
-mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
-install -m 0644 %SOURCE2 %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.calendar_service.dbus.service
+mkdir -p %{buildroot}/%{_sysconfdir}/dbus-1/session.d
+sed -i 's/@DBUS_INTERFACE@/%{_dbus_interface}/g' %{SOURCE1002}
+install -m 0644 %{SOURCE1002} %{buildroot}%{_sysconfdir}/dbus-1/session.d/%{name}.conf
 
 # alarm dbus service file
+install -m 0644 %SOURCE2001 %{buildroot}%{_unitdir_user}
 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
-cp -a %SOURCE3 %{buildroot}%{_datadir}/dbus-1/system-services
+install -m 0644 %SOURCE2002 %{buildroot}%{_datadir}/dbus-1/system-services
+
+
+%post -p /sbin/ldconfig
 
-%post
-/sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
+
 %files
-%manifest calendar-service.manifest
+%manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_bindir}/calendar-serviced*
 %{_libdir}/lib%{name}2.so.*
-%{_unitdir_user}/default.target.wants/%{name}d.service
 %{_unitdir_user}/%{name}d.service
+%{_datadir}/dbus-1/services/%{_dbus_interface}.service
+%config %{_sysconfdir}/dbus-1/session.d/%{name}.conf
 %{_unitdir_user}/%{name}-alarm.service
-%{_datadir}/license/%{name}
 %{_datadir}/dbus-1/system-services/ALARM.acalendar-service.service
-%{_datadir}/dbus-1/system-services/org.tizen.calendar_service.dbus.service
-%config %{_sysconfdir}/dbus-1/system.d/org.tizen.calendar_service.dbus.conf
+%license LICENSE.APLv2
+
 
 %files devel
 %defattr(-,root,root,-)
index 9854223..172e4b5 100644 (file)
@@ -2,10 +2,7 @@
 Description=Calendar Service daemon
 
 [Service]
-Type=simple
-BusName=org.tizen.calendar_service.dbus
+Type=dbus
+BusName=org.tizen.CalendarService.dbus
 Environment="TIMEOUT=0"
 ExecStart=/usr/bin/calendar-serviced $TIMEOUT
-
-[Install]
-WantedBy=default.target
diff --git a/packaging/org.tizen.CalendarService.dbus.service b/packaging/org.tizen.CalendarService.dbus.service
new file mode 100644 (file)
index 0000000..e7f1e3c
--- /dev/null
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.tizen.CalendarService.dbus
+Exec=/usr/bin/false
+SystemdService=calendar-serviced.service
diff --git a/packaging/org.tizen.calendar_service.dbus.service b/packaging/org.tizen.calendar_service.dbus.service
deleted file mode 100644 (file)
index c6bdd6e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.tizen.calendar_service.dbus
-Exec=/bin/false
-User=root
-SystemdServier=calendar-serviced.service
old mode 100755 (executable)
new mode 100644 (file)
index cb66e09..cac186e 100644 (file)
@@ -704,7 +704,7 @@ static void _dbus_on_name_lost(GDBusConnection *conn, const gchar *name, gpointe
 unsigned int cal_server_dbus_init(void)
 {
        guint id = 0;
-       id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
+       id = g_bus_own_name(G_BUS_TYPE_SESSION,
                        CAL_DBUS_INTERFACE,
                        G_BUS_NAME_OWNER_FLAGS_REPLACE,
                        _dbus_on_bus_acquired,