# Comment this to disable control of global settings with environment variable
ADD_DEFINITIONS("-DGLOBAL_SETTINGS_CONTROL")
-
+ADD_DEFINITIONS("-DLIBDIR_PREFIX=\"${LIB_INSTALL_DIR}\"")
# Build type
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release")
macro(configure_and_install_pkg PKG_FILE)
CONFIGURE_FILE(${PKG_FILE}.in ${PKG_FILE} @ONLY)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_FILE} DESTINATION lib/pkgconfig)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_FILE} DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
endmacro(configure_and_install_pkg)
ADD_SUBDIRECTORY(modules)
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-commons-auto-save-dao-ro
Description: wrt-commons-auto-save-dao-ro
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-commons-auto-save-dao-rw
Description: wrt-commons-auto-save-dao-rw
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-commons-auto-save-dao
Description: wrt-commons-auto-save-dao
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-commons-certificate-dao
Description: wrt-commons-certificate-dao
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_CORE_EFL_DETAIL_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-efl
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-commons-custom-handler-dao-ro
Description: wrt-commons-custom-handler-dao-ro
Version: @VERSION@
Requires: dpl-efl
Libs: -lwrt-commons-custom-handler-dao-ro -L${libdir}
-Cflags: -I${includedir}/dpl-efl
+Cflags: -I${includedir}/dpl-efl -DLIBDIR_PREFIX=\"${libdir}\"
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-commons-custom-handler-dao-rw
Description: wrt-commons-custom-handler-dao-rw
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_DB_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_DB_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-db-efl
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_DBUS_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_DBUS_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-dbus-efl
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_EVENT_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_EVENT_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-event-efl
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_LOG_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
INSTALL(FILES ${DPL_LOG_HEADERS}
DESTINATION include/dpl-efl/dpl/log)
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-log-efl
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_RPC_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_RPC_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-rpc-efl
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-commons-security-origin-dao
Description: wrt-commons-security-origin-dao
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_SOCKET_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_SOCKET_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-socket-efl
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: wrt-plugins-types
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_TEST_ENGINE_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_TEST_ENGINE_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-test-efl
# Install libraries
INSTALL(TARGETS ${TARGET_DPL_UTILS_EFL}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
# Install detail headers
INSTALL(FILES ${DPL_UTILS_HEADERS}
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-utils-efl
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-wrt-dao-ro
Description: dpl-wrt-dao-ro
prefix=/usr
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: dpl-wrt-dao-rw
Description: dpl-wrt-dao-rw
dbpath=$2
# extract smack label before removal
DB_LABEL=""
- if [ -f $dbpath.$name.db ]
- then
- DB_LABEL=`chsmack $dbpath.$name.db | sed -r "s/.*access=\"([^\"]+)\"/\1/"`
- fi
rm -f $dbpath.$name.db
-
# extract smack label before removal
JOURNAL_LABEL=""
- if [ -f $dbpath.$name.db-journal ]
- then
- JOURNAL_LABEL=`chsmack $dbpath.$name.db-journal | sed -r "s/.*access=\"([^\"]+)\"/\1/"`
- fi
rm -f $dbpath.$name.db-journal
- SQL="PRAGMA journal_mode = PERSIST;"
- sqlite3 $dbpath.$name.db "$SQL"
SQL=".read /usr/share/wrt-engine/"$name"_db.sql"
sqlite3 $dbpath.$name.db "$SQL"
touch $dbpath.$name.db-journal
pkill -9 security-serv
# restore smack label
- if [ -n "$DB_LABEL" ]
- then
- chsmack -a $DB_LABEL $dbpath.$name.db
- fi
-
# restore smack label
- if [ -n "$JOURNAL_LABEL" ]
- then
- chsmack -a $JOURNAL_LABEL $dbpath.$name.db-journal
- fi
}
for name in wrt
TARGET_LINK_LIBRARIES(${TARGET_CERTIFICATE_DAO_LIB} ${TARGET_DPL_EFL} ${TARGET_DPL_DB_EFL} ${TARGET_WRT_DAP_RO_LIB} ${CERTIFICATE_DAO_DEPS_LIBRARIES})
ADD_DEPENDENCIES(${TARGET_CERTIFICATE_DAO_LIB} ${TARGET_CERTIFICATE_DAO_DB})
-INSTALL(TARGETS ${TARGET_CERTIFICATE_DAO_LIB} DESTINATION lib)
+INSTALL(TARGETS ${TARGET_CERTIFICATE_DAO_LIB} DESTINATION ${LIB_INSTALL_DIR})
INSTALL(FILES
include/wrt-commons/certificate-dao/certificate_dao_types.h
{
stream.Write(sizeof(*value), value);
}
+
+ // long int
+ static void Serialize(IStream& stream, const long unsigned int value)
+ {
+ stream.Write(sizeof(value), &value);
+ }
+ static void Serialize(IStream& stream, const long unsigned int* const value)
+ {
+ stream.Write(sizeof(*value), value);
+ }
// int
static void Serialize(IStream& stream, const int value)
stream.Read(sizeof(*value), value);
}
+ // long int
+ static void Deserialize(IStream& stream, long unsigned int& value)
+ {
+ stream.Read(sizeof(value), &value);
+ }
+ static void Deserialize(IStream& stream, long unsigned int*& value)
+ {
+ value = new long unsigned int;
+ stream.Read(sizeof(*value), value);
+ }
+
// int
static void Deserialize(IStream& stream, int& value)
{
TARGET_LINK_LIBRARIES(${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} ${TARGET_CUSTOM_HANDLER_DAO_RO_LIB})
ADD_DEPENDENCIES(${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} ${TARGET_CUSTOM_HANDLER_DAO_DB})
-INSTALL(TARGETS ${TARGET_CUSTOM_HANDLER_DAO_RO_LIB} DESTINATION lib)
-INSTALL(TARGETS ${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} DESTINATION lib)
+INSTALL(TARGETS ${TARGET_CUSTOM_HANDLER_DAO_RO_LIB} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${TARGET_CUSTOM_HANDLER_DAO_RW_LIB} DESTINATION ${LIB_INSTALL_DIR})
INSTALL(FILES
include/wrt-commons/custom-handler-dao-ro/common_dao_types.h
LogPedantic("Transaction is initialized");
TransactionCancel() = false;
- (*Connection())->ExecCommand("BEGIN;");
+ (*Connection())->ExecCommand("BEGIN IMMEDIATE;");
}
}
TARGET_LINK_LIBRARIES(${TARGET_SECURITY_ORIGIN_DAO_LIB} ${TARGET_DPL_EFL} ${TARGET_DPL_DB_EFL} ${TARGET_WRT_DAO_RO_LIB} ${SECURITY_ORIGIN_DAO_DEPS_LIBRARIES})
ADD_DEPENDENCIES(${TARGET_SECURITY_ORIGIN_DAO_LIB} ${TARGET_SECURITY_ORIGIN_DAO_DB})
-INSTALL(TARGETS ${TARGET_SECURITY_ORIGIN_DAO_LIB} DESTINATION lib)
+INSTALL(TARGETS ${TARGET_SECURITY_ORIGIN_DAO_LIB} DESTINATION ${LIB_INSTALL_DIR})
INSTALL(FILES
include/wrt-commons/security-origin-dao/security_origin_dao_types.h
ADD_DEPENDENCIES(${TARGET_WRT_DAO_RW_LIB} ${TARGET_WRT_DAO_DB})
INSTALL(TARGETS ${TARGET_WRT_DAO_RO_LIB}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
INSTALL(TARGETS ${TARGET_WRT_DAO_RW_LIB}
- DESTINATION lib)
+ DESTINATION ${LIB_INSTALL_DIR})
INSTALL(FILES
include/dpl/wrt-dao-ro/config_parser_data.h
message); \
}
-#define CHECK_WIDGET_EXISTENCE(macro_transaction, macro_handle) \
+#define CHECK_WIDGET_EXISTENCE(macro_handle) \
if (!WidgetDAOReadOnly::isWidgetInstalled(macro_handle)) \
{ \
- macro_transaction.Commit(); \
LogWarning("Cannot find widget. Handle: " << macro_handle); \
ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist, \
"Cannot find widget. Handle: " << macro_handle); \
LogDebug("Getting Localized Info. Handle: " << m_widgetHandle);
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
- ScopedTransaction transaction(&WrtDatabase::interface());
- CHECK_WIDGET_EXISTENCE(transaction, m_widgetHandle)
+ CHECK_WIDGET_EXISTENCE(m_widgetHandle)
WRT_DB_SELECT(select, LocalizedWidgetInfo, &WrtDatabase::interface())
select->Where(
result.license = info.Get_widget_license();
result.licenseHref = info.Get_widget_license_href();
- transaction.Commit();
return result;
}
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get localized info")
LogDebug("Getting FeaturesList. Handle: " << m_widgetHandle);
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
- ScopedTransaction transaction(&WrtDatabase::interface());
- CHECK_WIDGET_EXISTENCE(transaction, m_widgetHandle)
+ CHECK_WIDGET_EXISTENCE(m_widgetHandle)
WRT_DB_SELECT(select, WidgetFeature, &WrtDatabase::interface())
select->Where(Equals<WidgetFeature::app_id>(m_widgetHandle));
feature.pluginId = featureDao.GetPluginHandle();
resultSet.insert(feature);
}
- transaction.Commit();
return resultSet;
}
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get features list")
m_widgetHandle);
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
- ScopedTransaction transaction(&WrtDatabase::interface());
- CHECK_WIDGET_EXISTENCE(transaction, m_widgetHandle)
+ CHECK_WIDGET_EXISTENCE(m_widgetHandle)
WRT_DB_SELECT(select, wrt::WidgetFeature, &WrtDatabase::interface())
select->Where(And(Equals<wrt::WidgetFeature::app_id>(m_widgetHandle),
DPL::FromUTF8String(featureName))));
wrt::WidgetFeature::Select::RowList rows = select->GetRowList();
- transaction.Commit();
return !rows.empty();
}
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to check for feature")
LogDebug("Getting AccessHostList. Handle: " << m_widgetHandle);
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
- ScopedTransaction transaction(&WrtDatabase::interface());
- CHECK_WIDGET_EXISTENCE(transaction, m_widgetHandle)
+ CHECK_WIDGET_EXISTENCE(m_widgetHandle)
WRT_DB_SELECT(select, WidgetAccessHost, &WrtDatabase::interface())
select->Where(Equals<WidgetAccessHost::app_id>(m_widgetHandle));
FOREACH(it, values)
ret.push_back(DPL::ToUTF8String(*it));
- transaction.Commit();
return ret;
}
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get access host list")
CertificateChainList WidgetDAOReadOnly::getWidgetCertificate(
CertificateSource source) const
{
- WRT_DB_SELECT(select, WidgetCertificate, &WrtDatabase::interface())
- select->Where(
- And(
+ CertificateChainList result;
+
+ SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
+ {
+
+ WRT_DB_SELECT(select, WidgetCertificate, &WrtDatabase::interface())
+ select->Where(
+ And(
Equals<WidgetCertificate::app_id>(m_widgetHandle),
Equals<WidgetCertificate::cert_source>(source)));
std::list<WidgetCertificate::Row> chainList = select->GetRowList();
- CertificateChainList result;
FOREACH(iter, chainList)
result.push_back(DPL::ToUTF8String(iter->Get_encoded_chain()));
+ }
+ SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to getWidgetCertificate")
+
return result;
}
DbWidgetSize WidgetDAOReadOnly::getPreferredSize() const
{
- WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
+ DbWidgetSize size;
+ SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
+ { WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
- DbWidgetSize size;
size.width = row.Get_widget_width();
size.height = row.Get_widget_height();
LogDebug("Return size wxh = " <<
(!!size.width ? *size.width : -1) << " x " <<
(!!size.height ? *size.height : -1));
+ }
+ SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to getPreferredSize")
return size;
}
WidgetType WidgetDAOReadOnly::getWidgetType() const
{
- WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
- DPL::OptionalInt result = row.Get_widget_type();
+ DPL::OptionalInt result;
+ SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
+ {
+ WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
+ result = row.Get_widget_type();
+
+ } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to getWidgetType")
+
return WidgetType(static_cast<AppType>(*result));
}
WidgetGUID WidgetDAOReadOnly::getGUID() const
{
- WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
- return row.Get_widget_id();
+ WidgetInfoRow row;
+ SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
+ {
+ row = getWidgetInfoRow(m_widgetHandle);
+
+ } SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to getGUID")
+ return row.Get_widget_id();
}
DPL::OptionalString WidgetDAOReadOnly::getTizenAppId() const
LogDebug("Getting getAppControlList. Handle: " << m_widgetHandle);
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
- ScopedTransaction transaction(&WrtDatabase::interface());
- CHECK_WIDGET_EXISTENCE(transaction, m_widgetHandle)
+ CHECK_WIDGET_EXISTENCE(m_widgetHandle)
WRT_DB_SELECT(select, AppControlInfo, &WrtDatabase::interface())
select->Where(Equals<AppControlInfo::app_id>(m_widgetHandle));
outAppControlList.push_back(ret);
}
- transaction.Commit();
}
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get AppControl list")
}
*/
inline const char* GetDevicePluginPath()
{
- return "/usr/lib/wrt-plugins";
+ return LIBDIR_PREFIX "/wrt-plugins";
}
/**
--- /dev/null
+* Mon May 20 2013 Rusty Lynch <rusty.lynch@intel.com> accepted/tizen/20130520.103517@f203c87
+- Fix WRT Runtimes Change post section : call wrt_common_create_cleandb.sh
+- Fix WRT Runtime : SQL Issue , remove transaction around CHECK_WIDGET_EXISTENCE + Force transaction BEGIN IMEDIATE + Try catch
+- Add Serialize/Deserialize function for unsigned long
+- Fix PC File
+- Fix x86-64 compliance
+
+* Sat May 18 2013 Anas Nashif <anas.nashif@intel.com> submit/tizen/20130517.045648@957c86e
+- Call ldconfig
+
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
-#git:framework/web/wrt-commons
Name: wrt-commons
Summary: Wrt common library
Version: 0.2.157
Release: 1
-Group: Development/Libraries
-License: Apache License, Version 2.0
-URL: N/A
+Group: System/Libraries
+License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Source1001: wrt-commons.manifest
BuildRequires: cmake
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(appcore-efl)
%prep
%setup -q
+cp %{SOURCE1001} .
%define with_tests 0
%if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed"
-cmake . -DVERSION=%{version} \
+%cmake . -DVERSION=%{version} \
-DDPL_LOG="OFF" \
- -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
%{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS} \
%{?WITH_CHILD:-DWITH_CHILD=%WITH_CHILD}
make %{?jobs:-j%jobs}
%install
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE %{buildroot}/usr/share/license/%{name}
%make_install
-%clean
-rm -rf %{buildroot}
-%post
+%postun -p /sbin/ldconfig
+
+%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 /usr/lib/wrt-plugins
+mkdir -p %{_libdir}/wrt-plugins
#Don't reset DB when install on QEMU (during other packages building witch GBS)
if [ -z "$EMULATOR_ARCHS" ]; then
echo "[WRT] wrt-commons postinst done ..."
%files
-%manifest wrt-commons.manifest
-%{_libdir}/*.so
+%manifest %{name}.manifest
+%license LICENSE
%{_libdir}/*.so.*
%{_datadir}/wrt-engine/*
-%{_datadir}/license/%{name}
%attr(755,root,root) %{_bindir}/wrt_commons_create_clean_db.sh
%attr(755,root,root) %{_bindir}/wrt_commons_reset_db.sh
%if %{with_tests}
%endif
%files devel
+%manifest %{name}.manifest
+%{_libdir}/*.so
%{_includedir}/dpl-efl/*
%{_libdir}/pkgconfig/*.pc
+++ /dev/null
-<manifest>
- <define>
- <domain name="wrt-commons"/>
- <provide>
- <label name="wrt-commons::db_wrt"/>
- </provide>
- </define>
- <request>
- <domain name="_"/>
- </request>
-</manifest>