diff options
author | Kévin THIERRY <kevin.thierry@open.eurogiciel.org> | 2014-01-27 17:17:43 +0100 |
---|---|---|
committer | Kévin THIERRY <kevin.thierry@open.eurogiciel.org> | 2014-01-31 17:00:11 +0100 |
commit | e301978666399a7378f89416a05b6718bef11fb7 (patch) | |
tree | d55cd37d3f87578eba3336c1daf0e72b24443383 | |
parent | bf0ff3aeb217105839faab6e44419671cb2f5116 (diff) | |
download | librua-sandbox/kthierry/multiuser.tar.gz librua-sandbox/kthierry/multiuser.tar.bz2 librua-sandbox/kthierry/multiuser.zip |
Add multi-user supportsandbox/kthierry/multiuser
Bug-Tizen: PTREL-339
Change-Id: I1f6145ffaee1ee2fa80b24bb160e6de9251aec18
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | packaging/librua.spec | 9 | ||||
-rw-r--r-- | test/rua-test.c | 5 |
3 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5110cfb..29acdc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ SET(SRCS INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED sqlite3 db-util) +pkg_check_modules(pkgs REQUIRED sqlite3 db-util libtzplatform-config) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/packaging/librua.spec b/packaging/librua.spec index dc8621e..3aa4e67 100644 --- a/packaging/librua.spec +++ b/packaging/librua.spec @@ -5,11 +5,12 @@ License: Apache-2.0 Summary: Recently used application Group: Application Framework/Libraries Source0: librua-%{version}.tar.gz -Source1001: librua.manifest +Source1001: librua.manifest BuildRequires: cmake BuildRequires: sqlite3 BuildRequires: pkgconfig(db-util) BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(libtzplatform-config) %description Recently used application library @@ -31,8 +32,8 @@ make %{?_smp_mflags} %install %make_install -mkdir -p %{buildroot}/opt/dbspace -sqlite3 %{buildroot}/opt/dbspace/.rua.db < data/rua_db.sql +mkdir -p %{buildroot}%{TZ_SYS_DB} +sqlite3 %{buildroot}%{TZ_SYS_DB}/.rua.db < data/rua_db.sql %post -p /sbin/ldconfig @@ -41,7 +42,7 @@ sqlite3 %{buildroot}/opt/dbspace/.rua.db < data/rua_db.sql %files %manifest %{name}.manifest %defattr(-,root,root,-) -%config(noreplace) %attr(0660,root,app) /opt/dbspace/.rua.db* +%config(noreplace) %attr(0660,root,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_DB}/.rua.db* %{_libdir}/librua.so.* %license LICENSE diff --git a/test/rua-test.c b/test/rua-test.c index 6fdd2e0..bcd6913 100644 --- a/test/rua-test.c +++ b/test/rua-test.c @@ -25,6 +25,9 @@ #include <stdlib.h> #include <string.h> +/* For multi-user support */ +#include <tzplatform_config.h> + #include "rua.h" int __add_history(char *pkgname) @@ -33,7 +36,7 @@ int __add_history(char *pkgname) struct rua_rec rec; char apppath[FILENAME_MAX] = ""; - snprintf(apppath, "/opt/apps/%s", pkgname, FILENAME_MAX); + apppath = tzplatform_mkpath(TZ_SYS_RW_APP, pkgname); memset(&rec, 0, sizeof(rec)); rec.pkg_name = pkgname; rec.app_path = apppath; |