LINK_DIRECTORIES(${daemon_pkgs_LIBRARY_DIRS})
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--hash-style=both -pie")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--hash-style=both -pie")
ADD_DEFINITIONS("-DIOTCON_DBUS_INTERFACE=\"${DBUS_INTERFACE}\"")
ADD_EXECUTABLE(${DAEMON} ${DAEMON_SRCS})
}
-GVariant* icl_dbus_device_info_to_gvariant(iotcon_device_info_h device_info)
-{
- GVariant *value;
-
- value = g_variant_new("(s)", device_info->device_name);
-
- return value;
-}
-
-
-GVariant* icl_dbus_platform_info_to_gvariant(iotcon_platform_info_h platform_info)
-{
- GVariant *value;
-
- value = g_variant_new("(sssssssssss)",
- platform_info->platform_id,
- platform_info->manuf_name,
- platform_info->manuf_url,
- platform_info->model_number,
- platform_info->date_of_manuf,
- platform_info->platform_ver,
- platform_info->os_ver,
- platform_info->hardware_ver,
- platform_info->firmware_ver,
- platform_info->support_url,
- platform_info->system_time);
-
- return value;
-}
-
-
GVariant* icl_dbus_query_to_gvariant(iotcon_query_h query)
{
FN_CALL;
GVariant* icl_dbus_representation_to_gvariant(struct icl_representation_s *repr);
GVariant* icl_dbus_response_to_gvariant(struct icl_resource_response *response);
GVariant* icl_dbus_remote_resource_to_gvariant(struct icl_remote_resource *resource);
-GVariant* icl_dbus_device_info_to_gvariant(struct icl_device_info *device_info);
-GVariant* icl_dbus_platform_info_to_gvariant(struct icl_platform_info *platform_info);
GVariant* icl_dbus_query_to_gvariant(iotcon_query_h query);
GVariant* icl_dbus_options_to_gvariant(iotcon_options_h options);
GVariant* icl_dbus_observers_to_gvariant(iotcon_observers_h observers);
return IOTCON_ERROR_NONE;
}
-
-/* counting from 0 */
-const char* icl_resource_interfaces_get_nth_data(iotcon_resource_interfaces_h ifaces,
- int index)
-{
- return g_list_nth_data(ifaces->iface_list, index);
-}
-
-
-unsigned int icl_resource_interfaces_get_length(iotcon_resource_interfaces_h ifaces)
-{
- return g_list_length(ifaces->iface_list);
-}
iotcon_resource_interfaces_h icl_resource_interfaces_ref(
iotcon_resource_interfaces_h res_ifaces);
-const char* icl_resource_interfaces_get_nth_data(iotcon_resource_interfaces_h res_ifaces,
- int index);
-unsigned int icl_resource_interfaces_get_length(iotcon_resource_interfaces_h res_ifaces);
#endif /* __IOT_CONNECTIVITY_MANAGER_LIBRARY_RESOURCE_INTERFACES_H__ */
return IOTCON_ERROR_NONE;
}
-
-/* counting from 0 */
-const char* icl_resource_types_get_nth_data(iotcon_resource_types_h types, int index)
-{
- return g_list_nth_data(types->type_list, index);
-}
-
-
-unsigned int icl_resource_types_get_length(iotcon_resource_types_h types)
-{
- return g_list_length(types->type_list);
-}
};
iotcon_resource_types_h icl_resource_types_ref(iotcon_resource_types_h res_types);
-const char* icl_resource_types_get_nth_data(iotcon_resource_types_h res_types, int index);
-unsigned int icl_resource_types_get_length(iotcon_resource_types_h res_types);
#endif /* __IOT_CONNECTIVITY_MANAGER_LIBRARY_RESOURCE_TYPES_H__ */
--- /dev/null
+[Unit]
+Description=Tizen IoT Connectivity
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/iotcon-daemon
+Restart=always
+User=system
+Group=system
+SmackProcessLabel=iotcon
+
+[Install]
+WantedBy=multi-user.target
Type=simple
ExecStart=/usr/bin/iotcon-daemon
Restart=always
+User=iotcon
[Install]
WantedBy=multi-user.target
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1: %{name}.service
+Source2: %{name}-old.service
Source1001: %{name}.manifest
Source1002: %{name}-old.manifest
Source1003: %{name}-test-old.manifest
%if "%{tizen}" == "2.3"
BuildRequires: python-xml
%endif
+%if 0%{?tizen_version_major} >= 3
+Requires(post): /usr/bin/getent, /usr/bin/useradd, /usr/bin/groupadd
+%endif
Requires(post): /sbin/ldconfig, /usr/bin/systemctl
Requires(postun): /sbin/ldconfig, /usr/bin/systemctl
%setup -q
chmod g-w %_sourcedir/*
%if 0%{?tizen_version_major} < 3
+cp %{SOURCE2} ./%{name}.service
cp %{SOURCE1002} ./%{name}.manifest
cp %{SOURCE1003} ./%{name}-test.manifest
%else
+cp %{SOURCE1} ./%{name}.service
cp %{SOURCE1001} ./%{name}.manifest
cp %{SOURCE1001} ./%{name}-test.manifest
%endif
TZ_VER_3=1
%endif
+export LDFLAGS+="-Wl,--as-needed"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} \
-DTZ_VER_3=${TZ_VER_3} -DDBUS_INTERFACE=%{_dbus_interface}
%make_install
mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
-cp -af %{SOURCE1} %{buildroot}%{_unitdir}/
+cp -af %{name}.service %{buildroot}%{_unitdir}/
ln -s ../%{name}.service %{buildroot}%{_unitdir}/multi-user.target.wants/%{name}.service
%if 0%{?tizen_version_major} < 3
%post
+%if 0%{?tizen_version_major} >= 3
+getent group iotcon > /dev/null || groupadd -r iotcon
+getent passwd iotcon > /dev/null || useradd -r -g iotcon -d '/var/lib/empty' -s /sbin/nologin -c "iotcon daemon" iotcon
+%endif
+
systemctl daemon-reload
if [ $1 == 1 ]; then
systemctl restart %{name}.service