Remove hardcoded path for multiuser support 27/18527/2 accepted/tizen_ivi_panda tizen_ivi_panda accepted/tizen/ivi/panda/20140403.015044 submit/tizen_ivi_panda/20140403.011834
authorJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Mon, 24 Mar 2014 14:08:39 +0000 (15:08 +0100)
committerJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Wed, 26 Mar 2014 08:21:33 +0000 (09:21 +0100)
Bug-Tizen: PTREL-311

Change-Id: I2533ea48982f63b24031f540c104ce34ffab908f
Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
CMakeLists.txt
initdb/src/initdb.c
packaging/ail.spec
src/ail_private.h
tool/src/ail_fota.c
tool/src/initdb.c

index 1a8f40e..cf9de2c 100644 (file)
@@ -33,7 +33,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
 
-pkg_check_modules(LPKGS REQUIRED glib-2.0 sqlite3 dlog db-util xdgmime vconf)
+pkg_check_modules(LPKGS REQUIRED glib-2.0 sqlite3 dlog db-util xdgmime vconf libtzplatform-config)
 STRING(REPLACE ";" " " EXTRA_CFLAGS "${LPKGS_CFLAGS}")
 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
 
index e9847d3..4d58945 100755 (executable)
 #define OWNER_ROOT 0
 #define GROUP_MENU 6010
 #define BUFSZE 1024
-#define OPT_DESKTOP_DIRECTORY "/opt/share/applications"
-#define USR_DESKTOP_DIRECTORY "/usr/share/applications"
-#define APP_INFO_DB_FILE "/opt/dbspace/.app_info.db"
-#define APP_INFO_DB_FILE_JOURNAL "/opt/dbspace/.app_info.db-journal"
+#define OPT_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RW_DESKTOP_APP)
+#define USR_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RO_DESKTOP_APP)
+#define APP_INFO_DB_FILE tzplatform_mkpath(TZ_SYS_DB,".app_info.db")
+#define APP_INFO_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB,".app_info.db-journal")
 #define APP_INFO_DB_LABEL "ail::db"
 
 #ifdef _E
index 18b7c9b..7f061d3 100755 (executable)
@@ -13,6 +13,7 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(sqlite3)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(xdgmime)
+BuildRequires:  pkgconfig(libtzplatform-config)
 Provides:       libail = %{version}-%{release}
 
 %description
@@ -46,8 +47,8 @@ make %{?_smp_mflags}
 %install
 %make_install
 
-mkdir -p %{buildroot}/opt/dbspace/
-mkdir -p %{buildroot}/opt/share/applications/
+mkdir -p %{buildroot}%{TZ_SYS_DB}/
+mkdir -p %{buildroot}%{TZ_SYS_RW_DESKTOP_APP}/
 
 %post
 /sbin/ldconfig
@@ -73,34 +74,33 @@ update_DAC_for_db_file()
         fi
 }
 ail_initdb
-mkdir -p /usr/share/applications
-mkdir -p /opt/share/applications
-mkdir -p /opt/dbspace/
+mkdir -p %{TZ_SYS_RO_DESKTOP_APP}
+mkdir -p %{TZ_SYS_RW_DESKTOP_APP}
+mkdir -p %{TZ_SYS_DB}
 
-update_DAC_for_db_file /opt/dbspace/.app_info.db
-update_DAC_for_db_file /opt/dbspace/.app_info.db-journal
+update_DAC_for_db_file %{TZ_SYS_DB}/.app_info.db
+update_DAC_for_db_file %{TZ_SYS_DB}/.app_info.db-journal
 
 %postun
 /sbin/ldconfig
 if [ $1 == 0 ]; then
-rm -f /opt/dbspace/.app_info.db*
+rm -f %{TZ_SYS_DB}/.app_info.db*
 fi
 
 
 %files
 %manifest %{name}.manifest
 %license LICENSE
-%dir /opt/share/applications
+%dir %{TZ_SYS_RW_DESKTOP_APP}
 %{_bindir}/ail_initdb
+%{_bindir}/ail_initdb
+%{_bindir}/ail_fota
+%{_bindir}/ail_desktop
+%{_bindir}/ail_filter
+%{_bindir}/ail_package
 %{_datadir}/install-info/*
 %{_libdir}/libail.so.0
 %{_libdir}/libail.so.0.1.0
-/usr/bin/ail_initdb
-/usr/bin/ail_fota
-/usr/bin/ail_desktop
-/usr/bin/ail_filter
-/usr/bin/ail_package
-/usr/share/install-info/*
 
 %files devel
 %manifest %{name}.manifest
index 4891c82..efa2f66 100755 (executable)
@@ -27,6 +27,7 @@
 
 #include <stdbool.h>
 #include <sqlite3.h>
+#include <tzplatform_config.h>
 
 #ifndef EXPORT_API
 #define EXPORT_API __attribute__ ((visibility("default")))
@@ -91,7 +92,7 @@ enum {
 #define ELEMENT_BOOL(e) ((struct element_bool *)(e))
 
 #define AIL_SQL_QUERY_MAX_LEN  2048
-#define APP_INFO_DB "/opt/dbspace/.app_info.db"
+#define APP_INFO_DB tzplatform_mkpath(TZ_SYS_DB,".app_info.db")
 
 #define ELEMENT_TYPE(e, t) do { \
        if(e->prop >= E_AIL_PROP_STR_MIN && e->prop <= E_AIL_PROP_STR_MAX) t= (int)VAL_TYPE_STR; \
index 334388f..3c0dbca 100644 (file)
 #define OWNER_ROOT 0
 #define GROUP_MENU 6010
 #define BUFSZE 1024
-#define OPT_DESKTOP_DIRECTORY "/opt/share/applications"
-#define USR_DESKTOP_DIRECTORY "/usr/share/applications"
-#define APP_INFO_DB_FILE "/opt/dbspace/.app_info.db"
-#define APP_INFO_DB_FILE_JOURNAL "/opt/dbspace/.app_info.db-journal"
+#define OPT_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RW_DESKTOP_APP)
+#define USR_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RO_DESKTOP_APP)
+#define APP_INFO_DB_FILE tzplatform_mkpath(TZ_SYS_DB,".app_info.db")
+#define APP_INFO_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB,".app_info.db-journal")
 #define APP_INFO_DB_LABEL "ail::db"
 
 #ifdef _E
index 1bba847..ff49c9a 100755 (executable)
 #define OWNER_ROOT 0
 #define GROUP_MENU 6010
 #define BUFSZE 1024
-#define OPT_DESKTOP_DIRECTORY "/opt/share/applications"
-#define USR_DESKTOP_DIRECTORY "/usr/share/applications"
-#define APP_INFO_DB_FILE "/opt/dbspace/.app_info.db"
-#define APP_INFO_DB_FILE_JOURNAL "/opt/dbspace/.app_info.db-journal"
+#define OPT_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RW_DESKTOP_APP)
+#define USR_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RO_DESKTOP_APP)
+#define APP_INFO_DB_FILE tzplatform_mkpath(TZ_SYS_DB,".app_info.db")
+#define APP_INFO_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB,".app_info.db-journal")
 #define APP_INFO_DB_LABEL "ail::db"
 
 #ifdef _E