summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--packaging/librua.spec11
-rw-r--r--test/rua-test.c5
3 files changed, 11 insertions, 7 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..b19b615 100644
--- a/packaging/librua.spec
+++ b/packaging/librua.spec
@@ -1,15 +1,16 @@
Name: librua
Version: 0.1.0
-Release: 34
+Release: 0
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;