ADD_SUBDIRECTORY(test)
## config ##
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/stt-config.xml DESTINATION ${LIBDIR}/voice/stt/1.0)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/stt-config.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/stt/1.0)
## Dbus service ##
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.sttserver.service DESTINATION /usr/share/dbus-1/services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.sttserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/stt-server.conf DESTINATION /etc/dbus-1/session.d)
#define STT_TIME_INFO_PATH tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt-time.xml")
-#define STT_DEFAULT_CONFIG STT_LIBDIR"/voice/stt/1.0/stt-config.xml"
#define STT_CONFIG tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt-config.xml")
+#define STT_DEFAULT_CONFIG tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/stt-config.xml")
-#define STT_DEFAULT_ENGINE STT_LIBDIR"/voice/stt/1.0/engine"
-#define STT_DOWNLOAD_ENGINE tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt/1.0/engine")
-
-#define STT_DEFAULT_ENGINE_INFO STT_LIBDIR"/voice/stt/1.0/engine-info"
-#define STT_DOWNLOAD_ENGINE_INFO tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt/1.0/engine-info")
-
-#define STT_DEFAULT_ENGINE_SETTING STT_LIBDIR"/voice/stt/1.0/engine-setting"
-#define STT_DOWNLOAD_ENGINE_SETTING tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt/1.0/engine-setting")
+#define STT_DEFAULT_ENGINE tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/engine")
+#define STT_DEFAULT_ENGINE_INFO tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/engine-info")
+#define STT_DEFAULT_ENGINE_SETTING tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/engine-setting")
#define STT_BASE_LANGUAGE "en_US"
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir}
+cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} \
+ -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN
make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
-mkdir -p %{buildroot}/usr/share/license
-install LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
+mkdir -p %{buildroot}%{TZ_SYS_RO_SHARE}/license
+install LICENSE.APLv2 %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}
%make_install
mkdir -p %{_libdir}/voice/
-mkdir -p /usr/share/voice/test
+mkdir -p %{TZ_SYS_RO_SHARE}/voice/test
%postun -p /sbin/ldconfig
%license LICENSE.APLv2
%defattr(-,root,root,-)
%{_libdir}/lib*.so
-%{_libdir}/voice/stt/1.0/stt-config.xml
%{_bindir}/stt-daemon
-/usr/share/dbus-1/services/org.tizen.voice*
/etc/dbus-1/session.d/stt-server.conf
-/usr/share/voice/test/stt-test
-/usr/share/license/%{name}
+%{TZ_SYS_RO_SHARE}/voice/stt/1.0/stt-config.xml
+%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice*
+%{TZ_SYS_RO_SHARE}/voice/test/stt-test
+%{TZ_SYS_RO_SHARE}/license/%{name}
%files devel
%manifest %{name}-devel.manifest
SLOG(LOG_WARN, TAG_STTD, "[Engine Agent WARNING] Fail to open default directory");
}
- /* Get file name from downloadable engine directory */
- dp = opendir(STT_DOWNLOAD_ENGINE);
- if (NULL != dp) {
- do {
- ret = readdir_r(dp, &entry, &dirp);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTD, "[File ERROR] Fail to read directory");
- break;
- }
-
- if (NULL != dirp) {
- sttengine_info_s* info;
- char* filepath;
- int filesize;
-
- filesize = strlen(STT_DOWNLOAD_ENGINE) + strlen(dirp->d_name) + 5;
- filepath = (char*)calloc(filesize, sizeof(char));
-
- if (NULL != filepath) {
- snprintf(filepath, filesize, "%s/%s", STT_DOWNLOAD_ENGINE, dirp->d_name);
- } else {
- SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Memory not enouth!!");
- continue;
- }
-
- /* get its info and update engine list */
- if (0 == __internal_get_engine_info(filepath, &info)) {
- /* add engine info to g_engine_list */
- g_engine_list = g_slist_append(g_engine_list, info);
- }
-
- if (NULL != filepath)
- free(filepath);
- }
- } while (NULL != dirp);
-
- closedir(dp);
- } else {
- SLOG(LOG_WARN, TAG_STTD, "[Engine Agent WARNING] Fail to open downloadable directory");
- }
-
if (0 >= g_slist_length(g_engine_list)) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] No Engine");
return STTD_ERROR_ENGINE_NOT_FOUND;
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_test_LDFLAGS} stt stt_file)
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/share/voice/test)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${TZ_SYS_RO_SHARE}/voice/test)