%postun caller -p /sbin/ldconfig
%posttrans
-/usr/bin/sp_initdb
-
if [ -e %{_sysconfdir}/config/model-config.xml ]; then
PROFILE=`grep "feature\/profile" %{_sysconfdir}/config/model-config.xml`
if [[ "${PROFILE}" == *"mobile"* ]]; then
- rm -rf %{_datarootdir}/syspopup/wearable
- rm -rf %{_datarootdir}/syspopup/tv
- rm -rf %{_datarootdir}/syspopup/common
- rm -rf %{_datarootdir}/syspopup/ivi
+ rm -rf %{_datarootdir}/syspopup/default/wearable.xml
+ rm -rf %{_datarootdir}/syspopup/default/tv.xml
+ rm -rf %{_datarootdir}/syspopup/default/common.xml
+ rm -rf %{_datarootdir}/syspopup/default/ivi.xml
elif [[ "${PROFILE}" == *"wearable"* ]]; then
- rm -rf %{_datarootdir}/syspopup/mobile
- rm -rf %{_datarootdir}/syspopup/tv
- rm -rf %{_datarootdir}/syspopup/common
- rm -rf %{_datarootdir}/syspopup/ivi
+ rm -rf %{_datarootdir}/syspopup/default/mobile.xml
+ rm -rf %{_datarootdir}/syspopup/default/tv.xml
+ rm -rf %{_datarootdir}/syspopup/default/common.xml
+ rm -rf %{_datarootdir}/syspopup/default/ivi.xml
elif [[ "${PROFILE}" == *"tv"* ]]; then
- rm -rf %{_datarootdir}/syspopup/mobile
- rm -rf %{_datarootdir}/syspopup/wearable
- rm -rf %{_datarootdir}/syspopup/common
- rm -rf %{_datarootdir}/syspopup/ivi
+ rm -rf %{_datarootdir}/syspopup/default/mobile.xml
+ rm -rf %{_datarootdir}/syspopup/default/wearable.xml
+ rm -rf %{_datarootdir}/syspopup/default/common.xml
+ rm -rf %{_datarootdir}/syspopup/default/ivi.xml
elif [[ "${PROFILE}" == *"common"* ]]; then
- rm -rf %{_datarootdir}/syspopup/mobile
- rm -rf %{_datarootdir}/syspopup/wearable
- rm -rf %{_datarootdir}/syspopup/tv
- rm -rf %{_datarootdir}/syspopup/ivi
+ rm -rf %{_datarootdir}/syspopup/default/mobile.xml
+ rm -rf %{_datarootdir}/syspopup/default/wearable.xml
+ rm -rf %{_datarootdir}/syspopup/default/tv.xml
+ rm -rf %{_datarootdir}/syspopup/default/ivi.xml
elif [[ "${PROFILE}" == *"ivi"* ]]; then
- rm -rf %{_datarootdir}/syspopup/mobile
- rm -rf %{_datarootdir}/syspopup/wearable
- rm -rf %{_datarootdir}/syspopup/tv
- rm -rf %{_datarootdir}/syspopup/common
+ rm -rf %{_datarootdir}/syspopup/default/mobile.xml
+ rm -rf %{_datarootdir}/syspopup/default/wearable.xml
+ rm -rf %{_datarootdir}/syspopup/default/tv.xml
+ rm -rf %{_datarootdir}/syspopup/default/common.xml
else
- rm -rf %{_datarootdir}/syspopup/mobile
- rm -rf %{_datarootdir}/syspopup/wearable
- rm -rf %{_datarootdir}/syspopup/tv
- rm -rf %{_datarootdir}/syspopup/common
- rm -rf %{_datarootdir}/syspopup/ivi
+ rm -rf %{_datarootdir}/syspopup/default/mobile.xml
+ rm -rf %{_datarootdir}/syspopup/default/wearable.xml
+ rm -rf %{_datarootdir}/syspopup/default/tv.xml
+ rm -rf %{_datarootdir}/syspopup/default/common.xml
+ rm -rf %{_datarootdir}/syspopup/default/ivi.xml
fi
else
- rm -rf %{_datarootdir}/syspopup/mobile
- rm -rf %{_datarootdir}/syspopup/wearable
- rm -rf %{_datarootdir}/syspopup/tv
- rm -rf %{_datarootdir}/syspopup/common
- rm -rf %{_datarootdir}/syspopup/ivi
+ rm -rf %{_datarootdir}/syspopup/default/mobile.xml
+ rm -rf %{_datarootdir}/syspopup/default/wearable.xml
+ rm -rf %{_datarootdir}/syspopup/default/tv.xml
+ rm -rf %{_datarootdir}/syspopup/default/common.xml
+ rm -rf %{_datarootdir}/syspopup/default/ivi.xml
fi
+/usr/bin/sp_initdb
+
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
INSTALL(TARGETS sp_initdb DESTINATION bin)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.xsd DESTINATION ${SYSCONFDIR}/syspopup/preload/)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/xml.xsd DESTINATION ${SYSCONFDIR}/syspopup/preload/)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mobile.xml DESTINATION share/syspopup/mobile)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wearable.xml DESTINATION share/syspopup/wearable)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tv.xml DESTINATION share/syspopup/tv)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/common.xml DESTINATION share/syspopup/common)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ivi.xml DESTINATION share/syspopup/ivi)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mobile.xml DESTINATION share/syspopup/default)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wearable.xml DESTINATION share/syspopup/default)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tv.xml DESTINATION share/syspopup/default)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/common.xml DESTINATION share/syspopup/default)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ivi.xml DESTINATION share/syspopup/default)
static char path[PATH_MAX];
char *profile = NULL;
- if (access(PATH_SYSPOPUP_DEFAULT, F_OK) == 0)
- return PATH_SYSPOPUP_DEFAULT;
-
system_info_get_platform_string("http://tizen.org/feature/profile",
&profile);
if (profile == NULL) {
printf("Failed to get profile info\n");
- snprintf(path, sizeof(path), "%s/mobile", PATH_SYSPOPUP);
+ snprintf(path, sizeof(path), "%s/wearable", PATH_SYSPOPUP);
return path;
}
GList *list = NULL;
int ret;
- ret = __load_syspopup_info(__get_syspopup_path(), &list);
- if (ret < 0)
- goto end;
+ __load_syspopup_info(PATH_SYSPOPUP_DEFAULT, &list);
+ __load_syspopup_info(__get_syspopup_path(), &list);
+ if (!list)
+ return -1;
ret = syspopup_parser_db_open();
if (ret < 0)