From 863259577b915ceec0dab6f82b2a6397856ddaea Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Tue, 29 Mar 2016 15:44:07 +0900 Subject: Modify hard-coding path to use tz-platform-config Change-Id: I3df2d185c79a9da55a2d880d8974d23dfc71b1cf Signed-off-by: pr.jung --- CMakeLists.txt | 2 ++ TC/testcase/utc_system_feedback.c | 4 ++-- packaging/libfeedback.spec | 17 +++++++++++------ src/common.h | 4 ++-- src/sound.c | 2 +- src/vibrator.c | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd6095c..28e87eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,8 @@ IF(NOT "${PROFILE}" STREQUAL "common") ADD_DEFINITIONS("-DWEARABLE") ENDIF() ENDIF() +ADD_DEFINITIONS("-DFEEDBACK_SYS_SHARE=\"${TZ_SYS_SHARE}\"") +ADD_DEFINITIONS("-DFEEDBACK_SYS_RO_SHARE=\"${TZ_SYS_RO_SHARE}\"") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src) diff --git a/TC/testcase/utc_system_feedback.c b/TC/testcase/utc_system_feedback.c index b784598..b1aa72f 100644 --- a/TC/testcase/utc_system_feedback.c +++ b/TC/testcase/utc_system_feedback.c @@ -74,8 +74,8 @@ struct tet_testlist tet_testlist[] = { { NULL, 0 }, }; -#define SOUND_FILE_PATH "/usr/share/feedback/sound/touch/touch.ogg" -#define VIBRATION_FILE_PATH "/usr/share/deviced/HW_touch_30ms_sharp.ivt" +#define SOUND_FILE_PATH FEEDBACK_SYS_RO_SHARE"/feedback/sound/touch/touch.ogg" +#define VIBRATION_FILE_PATH FEEDBACK_SYS_RO_SHARE"/deviced/HW_touch_30ms_sharp.ivt" static void startup(void) { diff --git a/packaging/libfeedback.spec b/packaging/libfeedback.spec index 38dea7e..363007b 100644 --- a/packaging/libfeedback.spec +++ b/packaging/libfeedback.spec @@ -16,6 +16,7 @@ BuildRequires: pkgconfig(mm-keysound) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(libtzplatform-config) Requires(post): svi-data %description @@ -46,7 +47,11 @@ export CFLAGS+=" -DTIZEN_ENGINEER_MODE" cp %{SOURCE1} . cp %{SOURCE2} . -%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPROFILE=%{profile} +%cmake . \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DPROFILE=%{profile} \ + -DTZ_SYS_RO_SHARE=%{_datadir} \ + -DTZ_SYS_SHARE=%{TZ_SYS_SHARE} make %install @@ -54,10 +59,10 @@ rm -rf %{buildroot} %make_install mkdir -p %{buildroot}%{_datadir}/license -cp LICENSE %{buildroot}/usr/share/license/%{name} -cp LICENSE %{buildroot}/usr/share/license/svi-data +cp LICENSE %{buildroot}%{_datadir}/license/%{name} +cp LICENSE %{buildroot}%{_datadir}/license/svi-data -mkdir -p %{buildroot}/opt/usr/share/feedback/haptic/custom +mkdir -p %{buildroot}%{TZ_SYS_SHARE}/feedback/haptic/custom %post -p /sbin/ldconfig @@ -67,7 +72,7 @@ mkdir -p %{buildroot}/opt/usr/share/feedback/haptic/custom %postun -n svi-data rm -rf %{_datadir}/feedback/ -rm -rf /opt/usr/share/feedback/ +rm -rf %{TZ_SYS_SHARE}/feedback/ %files %defattr(-,root,root,-) @@ -85,6 +90,6 @@ rm -rf /opt/usr/share/feedback/ %defattr(644,root,root,-) %{_datadir}/feedback/* %defattr(666,app,app,-) -%dir /opt/usr/share/feedback/haptic/custom +%dir %{TZ_SYS_SHARE}/feedback/haptic/custom %{_datadir}/license/svi-data %manifest svi-data.manifest diff --git a/src/common.h b/src/common.h index ddfae02..9b53726 100644 --- a/src/common.h +++ b/src/common.h @@ -54,8 +54,8 @@ typedef GList dd_list; for (elem = head; elem && ((node = elem->data) != NULL); elem = elem->next, node = NULL) #endif -#define FEEDBACK_DATA_DIR "/opt/usr/share/feedback" -#define FEEDBACK_ORIGIN_DATA_DIR "/usr/share/feedback" +#define FEEDBACK_DATA_DIR FEEDBACK_SYS_SHARE"/feedback" +#define FEEDBACK_ORIGIN_DATA_DIR FEEDBACK_SYS_RO_SHARE"/feedback" #define FEEDBACK_RETRY_CNT 1 diff --git a/src/sound.c b/src/sound.c index 75ce07c..6cb858e 100644 --- a/src/sound.c +++ b/src/sound.c @@ -34,7 +34,7 @@ #include "log.h" #include "parser.h" -#define SOUND_CONF_FILE "/usr/share/feedback/sound.conf" +#define SOUND_CONF_FILE FEEDBACK_SYS_RO_SHARE"/feedback/sound.conf" /* Temporary keys */ #ifndef VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL diff --git a/src/vibrator.c b/src/vibrator.c index bd1e550..621b42a 100644 --- a/src/vibrator.c +++ b/src/vibrator.c @@ -52,7 +52,7 @@ enum haptic_iteration { HAPTIC_ITERATION_INFINITE = 256, }; -#define VIBRATION_CONF_FILE "/usr/share/feedback/vibration.conf" +#define VIBRATION_CONF_FILE FEEDBACK_SYS_RO_SHARE"/feedback/vibration.conf" #define METHOD_OPEN "OpenDevice" #define METHOD_CLOSE "CloseDevice" -- cgit v1.2.3