#define __UAM_API_H__
#include <gmodule.h>
+#include <tizen_error.h>
+
+#ifndef TIZEN_ERROR_UA
+#define TIZEN_ERROR_UA 0x10000000 /**< To-Do: This should move to tizen_error.h */
+#endif
#ifdef __cplusplus
extern "C" {
} uam_event_e;
#define FOREACH_ERROR(ERROR) \
- ERROR(UAM_ERROR_NONE, 0x00) \
- ERROR(UAM_ERROR_INTERNAL, 0x01) \
- ERROR(UAM_ERROR_TIMEOUT, 0x02) \
- ERROR(UAM_ERROR_ALREADY_REGISTERED, 0x03) \
- ERROR(UAM_ERROR_NOT_REGISTERED, 0x04) \
- ERROR(UAM_ERROR_NOT_SUPPORTED, 0x05) \
- ERROR(UAM_ERROR_NOT_IN_OPERATION, 0x06) \
- ERROR(UAM_ERROR_INVALID_PARAM, 0x07) \
- ERROR(UAM_ERROR_NOW_IN_PROGRESS, 0x08) \
- ERROR(UAM_ERROR_ALREADY_DONE, 0x09) \
- ERROR(UAM_ERROR_NOT_FOUND, 0x0A) \
- ERROR(UAM_ERROR_DB_FAILED, 0x0B) \
+ ERROR(UAM_ERROR_NONE, TIZEN_ERROR_NONE) \
+ ERROR(UAM_ERROR_INVALID_PARAM, TIZEN_ERROR_INVALID_PARAMETER) \
+ ERROR(UAM_ERROR_TIMEOUT, TIZEN_ERROR_TIMED_OUT) \
+ ERROR(UAM_ERROR_NOW_IN_PROGRESS, TIZEN_ERROR_NOW_IN_PROGRESS) \
+ ERROR(UAM_ERROR_NOT_SUPPORTED, TIZEN_ERROR_NOT_SUPPORTED) \
+ ERROR(UAM_ERROR_NOT_REGISTERED, TIZEN_ERROR_UA | 0x0) \
+ ERROR(UAM_ERROR_NOT_IN_OPERATION, TIZEN_ERROR_UA | 0x02) \
+ ERROR(UAM_ERROR_ALREADY_DONE, TIZEN_ERROR_UA | 0x03) \
+ ERROR(UAM_ERROR_INTERNAL, TIZEN_ERROR_UA | 0x04) \
+ ERROR(UAM_ERROR_NOT_FOUND, TIZEN_ERROR_UA | 0x10) \
+ ERROR(UAM_ERROR_ALREADY_REGISTERED, TIZEN_ERROR_UA | 0x11) \
+ ERROR(UAM_ERROR_DB_FAILED, TIZEN_ERROR_UA | 0x12) \
#define GENERATE_ERROR_ENUM(ENUM, offset) ENUM = -offset,
#define GENERATE_ERROR_STRING(STRING, offset) #STRING,
%define database_full_path /opt/usr/dbspace/.ua-manager-data.db
%define config_file_path /opt/usr/data/ua
-%define vd_req ENABLED
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(json-c)
-%if %{vd_req} == ENABLED
+
+%if 0%{?vd_req:1}
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(deviced)
%endif
cp %{SOURCE1001} .
%build
-%if %{vd_req} == ENABLED
+%if 0%{?vd_req:1}
export CFLAGS="$CFLAGS -DVD_REQ"
%endif
install -m 0644 packaging/ua-manager.service %{buildroot}%{_unitdir}/ua-manager.service
ln -s ../ua-manager.service %{buildroot}%{_unitdir}/multi-user.target.wants/ua-manager.service
+mkdir -p %{buildroot}/etc/dbus-1/system.d/
+cp -af %{_builddir}/%{name}-%{version}/packaging/ua-manager.conf %{buildroot}/etc/dbus-1/system.d/
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files plugins
%defattr(-, root, root)
%{_includedir}/ua-manager/ua-plugin.h
+%if 0%{?vd_req:1}
%{_includedir}/ua-manager/ua-power-plugin.h
+%endif
%{_libdir}/pkgconfig/ua-plugins.pc
%files daemon
%{_unitdir}/multi-user.target.wants/ua-manager.service
%{_unitdir}/ua-manager.service
%{_datadir}/dbus-1/system-services/net.uamd.service
+%attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/ua-manager.conf
%{config_file_path}/uam-config.json