capi-network-connection
glib-2.0
dlog
+ libtzplatform-config
)
FOREACH(flag ${subpkgs_CFLAGS})
#include <unistd.h>
#include <math.h>
#include <errno.h>
+#include <tzplatform_config.h>
+
#include "download-agent-client-mgr.h"
#include "download-agent-debug.h"
#include "download-agent-utils.h"
ret = DA_ERR_FAIL_TO_ACCESS_STORAGE;
} else {
DA_SECURE_LOGD("[%s] is created!", install_dir);
- if (chown(install_dir, 5000, 5000) < 0) {
+ if (chown(install_dir, tzplatform_getuid(TZ_USER_NAME),tzplatform_getuid(TZ_SYS_USER_GROUP)) < 0) {
DA_LOG_ERR(FileManager, "Fail to chown");
ret = DA_ERR_FAIL_TO_ACCESS_STORAGE;
}
#include "download-agent-type.h"
#include "download-agent-dl-mgr.h"
-#define DA_DEFAULT_INSTALL_PATH_FOR_PHONE "/opt/usr/media/Downloads"
+#define DA_DEFAULT_INSTALL_PATH_FOR_PHONE tzplatform_getenv(TZ_USER_DOWNLOADS)
da_bool_t is_file_exist(const char *file_path);
da_bool_t is_dir_exist(const char *dir_path);
BuildRequires: pkgconfig(libsmack)
BuildRequires: gettext-devel
BuildRequires: pkgconfig(libsystemd-daemon)
+BuildRequires: pkgconfig(libtzplatform-config)
+Requires: libtzplatform-config
%description
Description: download the contents in background
%prep
%setup -q
-%define _data_install_path /usr/share/%{name}
+%define _data_install_path %{_datadir}/%{name}
%define _imagedir %{_data_install_path}/images
%define _localedir %{_data_install_path}/locales
%define _sqlschemadir %{_data_install_path}/sql
-%define _databasedir /opt/usr/dbspace
-%define _databasefile %{_databasedir}/.download-provider.db
%define _sqlschemafile %{_sqlschemadir}/download-provider-schema.sql
%define _licensedir /usr/share/license
-%define _smackruledir /opt/etc/smack/accesses.d
+%define _smackruledir %{TZ_SYS_SMACK}/accesses.d
%define cmake \
CFLAGS="${CFLAGS:-%optflags} -fPIC -D_REENTRANT -fvisibility=hidden"; export CFLAGS \
-DIMAGE_DIR:PATH=%{_imagedir} \\\
-DLOCALE_DIR:PATH=%{_localedir} \\\
-DDATABASE_SCHEMA_DIR=%{_sqlschemadir} \\\
- -DDATABASE_FILE:PATH=%{_databasefile} \\\
-DDATABASE_SCHEMA_FILE=%{_sqlschemafile} \\\
-DLICENSE_DIR:PATH=%{_licensedir} \\\
-DSMACK_RULE_DIR:PATH=%{_smackruledir} \\\
/sbin/ldconfig
%post
-mkdir -p %{_databasedir}
/sbin/ldconfig
-if [ ! -f %{_databasefile} ];
-then
-sqlite3 %{_databasefile} '.read %{_sqlschemafile}'
-chmod 660 %{_databasefile}
-chmod 660 %{_databasefile}-journal
-fi
-
%files
%defattr(-,root,root,-)
%manifest download-provider.manifest
appsvc
bundle
libsmack
- dlog
- libsystemd-daemon)
+ libsystemd-daemon
+ libtzplatform-config
+ dlog)
FOREACH(flag ${dp2_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -Wall")
-IF(DEFINED DATABASE_FILE)
- ADD_DEFINITIONS(-DDATABASE_FILE=\"${DATABASE_FILE}\")
-ENDIF(DEFINED DATABASE_FILE)
-
IF(DEFINED DATABASE_SCHEMA_FILE)
ADD_DEFINITIONS(-DDATABASE_SCHEMA_FILE=\"${DATABASE_SCHEMA_FILE}\")
ENDIF(DEFINED DATABASE_SCHEMA_FILE)
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <tzplatform_config.h>
#include <stdlib.h>
#include <sqlite3.h>
#include "download-provider-log.h"
#include "download-provider-pthread.h"
+#define DATABASE_FILE tzplatform_mkpath(TZ_USER_DB,".download-provider.db")
+
//BASIC
#define DP_DB_BASIC_GET_QUERY_FORMAT "SELECT %s FROM %s WHERE id = ?"
#define DP_DB_BASIC_SET_QUERY_FORMAT "UPDATE %s SET %s = ? WHERE id = ?"