# limitations under the License.
#
-DB_PATH=/opt/dbspace/
-DB_USER_PATH=/opt/usr/dbspace/
+source /etc/tizen-platform.conf
+
+DB_PATH=$TZ_SYS_DB/
+DB_USER_PATH=$TZ_USER_DB/
function create_db {
name=$1
SQL=".read /usr/share/wrt-engine/"$name"_db.sql"
sqlite3 $dbpath.$name.db "$SQL"
touch $dbpath.$name.db-journal
- chown 0:6026 $dbpath.$name.db
- chown 0:6026 $dbpath.$name.db-journal
+ chown 0:db_wrt $dbpath.$name.db
+ chown 0:db_wrt $dbpath.$name.db-journal
chmod 660 $dbpath.$name.db
chmod 660 $dbpath.$name.db-journal
# limitations under the License.
#
-rm -rf /opt/share/widget/system/*
+source /etc/tizen-platform.conf
+
+rm -rf $TZ_SYS_RW_WIDGET/system/*
uninstall_widgets=1
if [ "$1" == "--old" ]
then
uninstall_widgets=0
fi
#Removing of widget desktop icons
-WIDGET_EXEC_PATH=/opt/usr/apps/
-WIDGET_PRELOAD_EXEC_PATH=/usr/apps/
-WIDGET_DESKTOP_PATH=/opt/share/applications/
-SMACK_RULES_PATH=/etc/smack/accesses.d/
-WRT_DB=/opt/dbspace/.wrt.db
-PLUGINS_INSTALLATION_REQUIRED_PATH=/opt/share/widget/
+WIDGET_EXEC_PATH=$TZ_USER_APP/
+WIDGET_PRELOAD_EXEC_PATH=$TZ_SYS_RO_APP/
+WIDGET_DESKTOP_PATH=$TZ_SYS_RW_DESKTOP_APP/
+SMACK_RULES_PATH=$TZ_SYS_SMACK/accesses.d/
+WRT_DB=$TZ_SYS_DB/.wrt.db
+PLUGINS_INSTALLATION_REQUIRED_PATH=$TZ_SYS_RW_WIDGET/
PLUGINS_INSTALLATION_REQUIRED=plugin-installation-required
if [ -f ${WRT_DB} ]
PKG_CHECK_MODULES(CERTIFICATE_DAO_DEPS
glib-2.0
+ libtzplatform-config
REQUIRED)
SET(CERTIFICATE_DAO_INCLUDE_DIRS
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/wrt-dao-ro/common_dao_types.h>
#include <sys/stat.h>
+#include <tzplatform_config.h>
#include <fstream>
/* GCC versions 4.7 had changes to the C++ standard. It
* no longer includes <unistd.h> to remove namespace pollution.
"/usr/share/wrt-engine/certificate_db.sql";
const char* const CERTIFICATE_DATABASE_JOURNAL_FILENAME = "-journal";
-const int WEB_APPLICATION_UID = 5000;
-const int WEB_APPLICATION_GUID = 5000;
+const int WEB_APPLICATION_UID = tzplatform_getuid(TZ_USER_NAME);
+const int WEB_APPLICATION_GUID = tzplatform_getgid(TZ_SYS_USER_GROUP);
std::string createDatabasePath(const WrtDB::TizenPkgId &pkgName)
{
PKG_CHECK_MODULES(CUSTOM_HANDLER_DAO_DEPS
glib-2.0
+ libtzplatform-config
REQUIRED)
SET(CUSTOM_HANDLER_DAO_INCLUDE_DIRS
* limitations under the License.
*/
#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
+#include <tzplatform_config.h>
namespace CustomHandlerDB {
namespace Interface {
namespace {
-const char* CustomHandler_DB_DATABASE = "/opt/usr/dbspace/.wrt_custom_handler.db";
+const char* CustomHandler_DB_DATABASE = tzplatform_mkpath(TZ_USER_DB,".wrt_custom_handler.db");
DPL::DB::SqlConnection::Flag::Type CustomHandler_DB_FLAGS =
DPL::DB::SqlConnection::Flag::UseLucene;
}
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wrt_i18n_db.sql DESTINATION share/wrt-engine/)
###############################################################################
+INCLUDE(FindPkgConfig)
+
+PKG_CHECK_MODULES(I18N_DAO_DEPS
+ libtzplatform-config
+ REQUIRED)
SET(I18N_DAO_INCLUDE_DIRS
${PROJECT_SOURCE_DIR}/modules/i18n/dao/include
* limitations under the License.
*/
#include <wrt-commons/i18n-dao-ro/i18n_database.h>
+#include <tzplatform_config.h>
namespace I18n {
namespace DB {
namespace Interface {
namespace {
-const char* const I18N_DB_FILE_PATH = "/opt/usr/dbspace/.wrt_i18n.db";
+const char* const I18N_DB_FILE_PATH = tzplatform_mkpath(TZ_USER_DB,".wrt_i18n.db");
DPL::DB::SqlConnection::Flag::Type I18N_DB_FLAGS =
DPL::DB::SqlConnection::Flag::UseLucene;
PKG_CHECK_MODULES(SECURITY_ORIGIN_DAO_DEPS
glib-2.0
+ libtzplatform-config
REQUIRED)
SET(SECURITY_ORIGIN_DAO_INCLUDE_DIRS
#include <sys/stat.h>
#include <fstream>
#include <unistd.h>
+#include <tzplatform_config.h>
using namespace DPL::DB::ORM;
using namespace DPL::DB::ORM::security_origin;
"/usr/share/wrt-engine/security_origin_db.sql";
const char* const SECURITY_DATABASE_JOURNAL_FILENAME = "-journal";
-const int WEB_APPLICATION_UID = 5000;
-const int WEB_APPLICATION_GUID = 5000;
+const int WEB_APPLICATION_UID = tzplatform_getuid(TZ_USER_NAME);
+const int WEB_APPLICATION_GUID = tzplatform_getgid(TZ_SYS_USER_GROUP);
std::string createDatabasePath(const WrtDB::TizenPkgId &pkgName)
{
appcore-efl
libxml-2.0
openssl
+ libtzplatform-config
REQUIRED)
set(WRT_DAO_RO_SOURCES
#include <string>
#include <list>
+#include <tzplatform_config.h>
namespace WrtDB {
namespace GlobalConfig {
*/
inline const char* GetWrtDatabaseFilePath()
{
- return "/opt/dbspace/.wrt.db";
+ return tzplatform_mkpath(TZ_SYS_DB,".wrt.db");
}
/**
*/
inline const char* GetUserInstalledWidgetPath()
{
- return "/opt/usr/apps";
+ return tzplatform_getenv(TZ_USER_APP);
}
/**
*/
inline const char* GetUserPreloadedWidgetPath()
{
- return "/usr/apps";
+ return tzplatform_getenv(TZ_SYS_RO_APP);
}
/**
*/
inline const char* GetWidgetUserDataPath()
{
- return "/opt/usr/apps";
+ return tzplatform_getenv(TZ_USER_APP);
}
/**
*/
inline const char* GetPublicVirtualRootPath()
{
- return "/opt/share/widget/data/Public";
+ return tzplatform_mkpath(TZ_SYS_RW_WIDGET,"data/Public");
}
/**
*/
inline const char* GetTestsDataPath()
{
- return "/opt/share/widget/tests";
+ return tzplatform_mkpath(TZ_SYS_RW_WIDGET,"tests");
}
/**
*/
inline const char* GetUserWidgetDesktopPath()
{
- return "/opt/share/applications";
+ return tzplatform_getenv(TZ_SYS_RW_DESKTOP_APP);
}
/**
*/
inline const char* GetWrtClientExec()
{
- return "/usr/bin/wrt-client";
+ return tzplatform_mkpath(TZ_SYS_BIN,"wrt-client");
}
/**
*/
inline const char* GetUserWidgetDesktopIconPath()
{
- return "/opt/share/icons/default/small";
+ return tzplatform_mkpath(TZ_SYS_SHARE,"icons/default/small");
}
/**
*/
inline const char* GetUserWidgetDefaultIconFile()
{
- return "/usr/share/wrt-engine/wrt_widget_default_icon.png";
+ return tzplatform_mkpath(TZ_SYS_RO_WRT_ENGINE,"wrt_widget_default_icon.png");
}
inline const char* GetSignatureXmlSchema()
{
//TODO please rename, this filename is not descriptive enough
- return "/usr/share/wrt-engine/schema.xsd";
+ return tzplatform_mkpath(TZ_SYS_RO_WRT_ENGINE,"schema.xsd");
}
/**
*/
inline const char* GetPluginInstallInitializerName()
{
- return "/opt/share/widget/plugin-installation-required";
+ return tzplatform_mkpath(TZ_SYS_RW_WIDGET,"plugin-installation-required");
}
/**
inline const char* GetFingerprintListFile()
{
- return "/usr/share/wrt-engine/fingerprint_list.xml";
+ return tzplatform_mkpath(TZ_SYS_RO_WRT_ENGINE,"fingerprint_list.xml");
}
inline const char* GetFingerprintListSchema()
{
- return "/usr/share/wrt-engine/fingerprint_list.xsd";
+ return tzplatform_mkpath(TZ_SYS_RO_WRT_ENGINE,"fingerprint_list.xsd");
}
inline const char* GetVCoreDatabaseFilePath()
{
- return "/opt/dbspace/.cert_svc_vcore.db";
+ return tzplatform_mkpath(TZ_SYS_DB,".cert_svc_vcore.db");
}
/**
inline const char* GetShareDirectoryPath()
{
- return "/opt/share";
+ return tzplatform_getenv(TZ_SYS_SHARE);
}
inline const char* GetTempInstallInfoPath()
{
- return "/opt/share/widget/temp_info";
+ return tzplatform_mkpath(TZ_SYS_RW_WIDGET,"temp_info");
}
inline const char* GetWidgetSharedPath()
inline const char* GetManifestPath()
{
- return "/opt/share/packages";
+ return tzplatform_getenv(TZ_SYS_RW_PACKAGES);
}
inline const char* GetPreloadManifestPath()
{
- return "/usr/share/packages";
+ return tzplatform_getenv(TZ_SYS_RO_PACKAGES);
}
inline const char* GetRecoveryStatusPath()
{
- return "/usr/share/packages/.recovery/wgt";
+ return tzplatform_mkpath(TZ_SYS_RO_PACKAGES,".recovery/wgt");
}
} // namespace GlobalConfig
} // namespace WrtDB
PKG_CHECK_MODULES(WIDGET_INTERFACE_DAO_DEPS
glib-2.0
+ libtzplatform-config
REQUIRED)
SET(WIDGET_INTERFACE_DAO_INCLUDE_DIRS
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <dpl/wrt-dao-ro/WrtDatabase.h>
#include <dpl/wrt-dao-ro/widget_config.h>
+#include <tzplatform_config.h>
#include "orm_generator_widget_interface.h"
namespace WidgetInterfaceDB {
"/usr/share/wrt-engine/widget_interface_db.sql";
const char* const DATABASE_JOURNAL_FILENAME = "-journal";
-const int APP_UID = 5000;
-const int APP_GUID = 5000;
+const int APP_UID = tzplatform_getuid(TZ_USER_NAME);
+const int APP_GUID = tzplatform_getgid(TZ_SYS_USER_GROUP);
} // anonymous namespace
WidgetInterfaceDAO::WidgetInterfaceDAO(int widgetHandle) :
BuildRequires: pkgconfig(libiri)
BuildRequires: pkgconfig(libidn)
BuildRequires: pkgconfig(minizip)
-
+BuildRequires: pkgconfig(libtzplatform-config)
+Requires: libtzplatform-config
%description
Wrt common library
%post
/sbin/ldconfig
-mkdir -p /opt/share/widget/system
-mkdir -p /opt/share/widget/user
-mkdir -p /opt/share/widget/exec
-mkdir -p /opt/share/widget/data/Public
+mkdir -p ${TZ_SYS_RW_WIDGET}/system
+mkdir -p ${TZ_SYS_RW_WIDGET}/user
+mkdir -p ${TZ_SYS_RW_WIDGET}/exec
+mkdir -p ${TZ_SYS_RW_WIDGET}/data/Public
mkdir -p %{_libdir}/wrt-plugins
#Don't reset DB when install on QEMU (during other packages building witch GBS)
if [ -z ${2} ]; then
echo "This is new install of wrt-commons"
echo "Calling /usr/bin/wrt_commons_reset_db.sh"
- /usr/bin/wrt_commons_reset_db.sh
+ %{_bindir}/wrt_commons_reset_db.sh
else
# Find out old and new version of databases
- WRT_OLD_DB_VERSION=`sqlite3 /opt/dbspace/.wrt.db ".tables" | grep "DB_VERSION_"`
- WRT_NEW_DB_VERSION=`cat /usr/share/wrt-engine/wrt_db.sql | tr '[:blank:]' '\n' | grep DB_VERSION_`
+ WRT_OLD_DB_VERSION=`sqlite3 %{TZ_SYS_DB}/.wrt.db ".tables" | grep "DB_VERSION_"`
+ WRT_NEW_DB_VERSION=`cat %{TZ_SYS_RO_WRT_ENGINE}/wrt_db.sql | tr '[:blank:]' '\n' | grep DB_VERSION_`
echo "OLD wrt database version ${WRT_OLD_DB_VERSION}"
echo "NEW wrt database version ${WRT_NEW_DB_VERSION}"
echo "Equal database detected so db installation ignored"
else
echo "Calling /usr/bin/wrt_commons_reset_db.sh"
- /usr/bin/wrt_commons_reset_db.sh
+ %{_bindir}/wrt_commons_reset_db.sh
fi
else
echo "Calling /usr/bin/wrt_commons_reset_db.sh"
- /usr/bin/wrt_commons_reset_db.sh
+ %{_bindir}/wrt_commons_reset_db.sh
fi
fi
fi
-mkdir -p /usr/etc/ace
-mkdir -p /usr/apps/org.tizen.policy
+mkdir -p %{TZ_SYS_ACE_CONF}
+mkdir -p %{TZ_SYS_RO_APP}/org.tizen.policy
# DBUS services fix
# WARNING: THIS IS TEMPORARY SOLUTION, AS THIS SHOULD NOT BE OUR
%attr(755,root,root) %{_bindir}/wrt_dao_tests_prepare_db.sh
%attr(755,root,root) %{_bindir}/wrt_db_localization_prepare.sh
%{_datadir}/dbus-1/services/org.tizen.DBusTestService.service
- /opt/share/wrt/wrt-commons/tests/*
- /opt/share/widget/tests/localization/*
+ %{TZ_SYS_SHARE}/wrt/wrt-commons/tests/*
+ %{TZ_SYS_RW_WIDGET}/tests/localization/*
%endif
%files devel
# limitations under the License.
#
-WRT_DB=/opt/dbspace/.wrt.db
+source /etc/tizen-platform.conf
+
+WRT_DB=$TZ_SYS_DB/.wrt.db
WRT_DB_BCK=/tmp/wrt.db_backup
if [ "x$1" == "xstart" ]; then
set -e
+source /etc/tizen-platform.conf
+
trap 'echo "Script failed"; exit 1' ERR
-WRT_DB=/opt/dbspace/.wrt.db
+WRT_DB=$TZ_SYS_DB/.wrt.db
WRT_DB_BCK=/tmp/wrt.db_backup
-WIDGET_INSTALL_PATH=/opt/usr/apps
+WIDGET_INSTALL_PATH=$TZ_USER_APP
case $1 in
start)
sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(1, 'tizenid201')";
sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2, 'tizenid202')";
- sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(1, '/opt/share/widget/tests/localization/widget1')";
- sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2, '/opt/share/widget/tests/localization/widget2')";
+ sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(1, '${TZ_SYS_RW_WIDGET}/tests/localization/widget1')";
+ sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2, '${TZ_SYS_RW_WIDGET}/tests/localization/widget2')";
exit 0
;;
stop)
# @version 1.0
# @brief
#
+INCLUDE(FindPkgConfig)
+
+PKG_CHECK_MODULES(DPL_TESTS_UTIL_DEPS
+ libtzplatform-config
+ REQUIRED)
SET(TARGET_NAME "wrt-commons-tests-utils")
#include <dpl/binary_queue.h>
#include <dpl/file_input.h>
#include <dpl/file_output.h>
+#include <tzplatform_config.h>
#include <sys/stat.h>
#include <unistd.h>
RUNNER_TEST(path_create_temp_dir)
{
Path p1 = CreateTempPath(Path("/usr/tmp/"));
- Path p2 = CreateTempPath(Path("/opt/usr/apps/tmp/"));
- Path p3 = CreateTempPath(Path("/opt/usr/apps/tmp/"));
+ Path p2 = CreateTempPath(Path(tzplatform_mkpath(TZ_USER_APP,"tmp/")));
+ Path p3 = CreateTempPath(Path(tzplatform_mkpath(TZ_USER_APP,"tmp/")));
RUNNER_ASSERT_MSG(p1.Exists(), "Temp dir doesn't exists");
RUNNER_ASSERT_MSG(p2.Exists(), "Temp dir doesn't exists");
#include <dpl/test/test_runner.h>
#include <dpl/utils/wrt_utility.h>
#include <dpl/log/log.h>
+#include <tzplatform_config.h>
RUNNER_TEST_GROUP_INIT(DPL_WRT_UTILITY)
char *buffer = new char[bufsize];
struct passwd p;
struct passwd *result = NULL;
- int return_value = getpwnam_r("app", &p, buffer, bufsize, &result);
+ int return_value = getpwnam_r(tzplatform_getenv(TZ_USER_NAME), &p, buffer, bufsize, &result);
delete[] buffer;
if (return_value != 0 || !result) {