Removed hardcoded path for multiuser support 55/16855/5 accepted/tizen_3.0.2014.q3_common tizen_3.0.2014.q3_common tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common submit/tizen_common/20140521.163740 submit/tizen_common/20140522.130648 submit/tizen_common/20140522.135644 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release
authorSabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
Tue, 25 Feb 2014 09:14:45 +0000 (10:14 +0100)
committerSabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
Wed, 30 Apr 2014 14:06:13 +0000 (16:06 +0200)
Change-Id: I850a1b33b2f05737a69369858eb5809239f6fc05
Bug-Tizen: PTREL-230
Signed-off-by: Sabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
CMakeLists.txt
data/CMakeLists.txt
debian/org.tizen.menu-screen.install.in [deleted file]
debian/org.tizen.menu-screen.install.in.in [new file with mode: 0644]
debian/org.tizen.menu-screen.postinst
packaging/init_menu-screen_DB.sh [new file with mode: 0644]
packaging/org.tizen.menu-screen.spec
src/all_apps/db.c

index 92c5edb..eb470ff 100644 (file)
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(menu-screen C)
 
 SET(PACKAGE_NAME "org.tizen.${PROJECT_NAME}")
-SET(PREFIX "/usr/apps/${PACKAGE_NAME}")
+SET(PREFIX "${TZ_SYS_RO_APP}/${PACKAGE_NAME}")
 SET(EXEC_PREFIX "${PREFIX}/bin")
 SET(LIBDIR "${PREFIX}/lib")
 SET(DATADIR "/opt${PREFIX}/data")
@@ -37,6 +37,7 @@ pkg_check_modules(MENU_PKGS REQUIRED
        pkgmgr-info
        shortcut
        syspopup-caller
+       libtzplatform-config
 )
 
 ADD_DEFINITIONS("-DENABLE_BGIMAGE")
index b491de5..0200875 100644 (file)
@@ -1,5 +1,4 @@
-SET(MANIFESTDIR "/usr/share/packages")
-
+SET(MANIFESTDIR "${TZ_SYS_RO_PACKAGES}")
 # manifest
 CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}.xml)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR})
diff --git a/debian/org.tizen.menu-screen.install.in b/debian/org.tizen.menu-screen.install.in
deleted file mode 100644 (file)
index 32c44ee..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/usr/share/*
-/opt/apps/org.tizen.menu-screen/*
-/opt/share/packages/*
diff --git a/debian/org.tizen.menu-screen.install.in.in b/debian/org.tizen.menu-screen.install.in.in
new file mode 100644 (file)
index 0000000..b4e398c
--- /dev/null
@@ -0,0 +1,3 @@
+/usr/share/*
+@TZ_SYS_RW_APP@/org.tizen.menu-screen/*
+@TZ_SYS_RW_PACKAGES@/*
index ef33c15..9ae1a8d 100644 (file)
@@ -1,12 +1,16 @@
 #!/bin/sh
 
-INHOUSE_ID="5000"
+source /etc/tizen-platform.conf
+
+users_gid=$(getent group $TZ_SYS_USER_GROUP | cut -f3 -d':')
+
+INHOUSE_ID="$users_gid"
 
 init_vconf()
 {
-       vconftool set -t int memory/idle-screen/top 0 -i -u 5000 -f
-       vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" -i -u 5000 -f
-       vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -u 5000 -f
+       vconftool set -t int memory/idle-screen/top 0 -i -g $users_gid -f
+       vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" -i -g $users_gid -f
+       vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -g $users_gid -f
 }
 
 
diff --git a/packaging/init_menu-screen_DB.sh b/packaging/init_menu-screen_DB.sh
new file mode 100644 (file)
index 0000000..d0cdecc
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+source /etc/tizen-platform.conf
+if [ ! -d $1/dbspace ]
+then
+       mkdir -p $1/dbspace
+fi
+if [ ! -d $1/shortcut ]
+then
+       mkdir -p $1/shortcut
+else
+       rm -rf $1/shortcut/*
+fi
+sqlite3 $1/dbspace/.menu_screen.db 'PRAGMA journal_mode = PERSIST;
+       create table if not exists shortcut (
+               ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
+               appid TEXT,
+               name TEXT,
+               type INTEGER,
+               content_info TEXT,
+               icon TEXT
+       );
+'
+users_gid=$(getent group $TZ_SYS_USER_GROUP | cut -f3 -d':')
+
+INHOUSE_ID="$users_gid"
+chown -R $INHOUSE_ID:$INHOUSE_ID $1
+chown root:$INHOUSE_ID $1/dbspace/.menu_screen.db
+chown root:$INHOUSE_ID $1/dbspace/.menu_screen.db-journal
+
+chmod 660 $1/dbspace/.menu_screen.db
+chmod 660 $1/dbspace/.menu_screen.db-journal
+
index fc6c396..fc46cb6 100644 (file)
@@ -1,3 +1,4 @@
+
 Name: org.tizen.menu-screen
 Summary: Menu screen
 Version: 1.1.1
@@ -6,6 +7,7 @@ Group: Applications/Core Applications
 License: Flora
 Source0: %{name}-%{version}.tar.gz
 Source1001: %{name}.manifest
+Source1002:   init_menu-screen_DB.sh
 BuildRequires: pkgconfig(ail)
 BuildRequires: pkgconfig(appcore-efl)
 BuildRequires: pkgconfig(appsvc)
@@ -33,6 +35,7 @@ BuildRequires: pkgconfig(syspopup-caller)
 BuildRequires: cmake
 BuildRequires: edje-tools
 BuildRequires: gettext-tools
+BuildRequires:  pkgconfig(libtzplatform-config)
 
 %description
 Tizen 2.x Reference Application.
@@ -43,47 +46,39 @@ User application for launching apps.
 cp %{SOURCE1001} .
 
 %build
-%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}/apps/%{name}/
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}/apps/%{name}/  \
+-DTZ_SYS_ETC=%TZ_SYS_ETC \
+-DTZ_SYS_SMACK=%TZ_SYS_SMACK \
+-DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
+-DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+-DTZ_SYS_RW_APP=%TZ_SYS_RW_APP \
+-DTZ_SYS_RW_PACKAGES=%TZ_SYS_RW_PACKAGES \
+-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP
 make %{?jobs:-j%jobs}
 
 %install
 %make_install
 mkdir -p %{buildroot}/%{_datarootdir}/license
+install -D -m 0755 %{SOURCE1002} %{buildroot}%{_datadir}/%{name}/init_menu-screen_DB.sh
 
 %post
-INHOUSE_ID="5000"
+users_gid=$(getent group %TZ_SYS_USER_GROUP | cut -f3 -d':')
+INHOUSE_ID="$users_gid"
 
 init_vconf()
 {
-       vconftool set -t int memory/idle-screen/top 0 -i -u 5000 -f
-       vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" -i -u 5000 -f
-       vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -u 5000 -f
+       vconftool set -t int memory/idle-screen/top 0 -i -g $users_gid -f
+       vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" -i -g $users_gid -f
+       vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -g $users_gid -f
 }
 init_vconf
 
-sqlite3 %{_datadir}/dbspace/.menu_screen.db 'PRAGMA journal_mode = PERSIST;
-       create table if not exists shortcut (
-               ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
-               appid TEXT,
-               name TEXT,
-               type INTEGER,
-               content_info TEXT,
-               icon TEXT
-       );
-'
-
-INHOUSE_ID="5000"
-chown -R $INHOUSE_ID:$INHOUSE_ID %{_datadir}
-chown root:$INHOUSE_ID %{_datadir}/dbspace/.menu_screen.db
-chown root:$INHOUSE_ID %{_datadir}/dbspace/.menu_screen.db-journal
-
-chmod 660 %{_datadir}/dbspace/.menu_screen.db
-chmod 660 %{_datadir}/dbspace/.menu_screen.db-journal
+%{_datadir}/%{name}/init_menu-screen_DB.sh %{_datadir}
 
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-/opt/usr/apps/%{name}/*
 %{_prefix}/apps/%{name}/*
 %{_datarootdir}/packages/%{name}.xml
 %{_datarootdir}/license/%{name}
+%{_datadir}/%{name}/init_menu-screen_DB.sh
index ffed9c7..b5fbc81 100644 (file)
 #include "util.h"
 #include "all_apps/db.h"
 
+#include <tzplatform_config.h>
+
 #define QUERY_LEN 1024
 
-#define MENU_SCREEN_DB_FILE "/opt/usr/apps/com.samsung.menu-screen/data/dbspace/.menu_screen.db"
+#define MENU_SCREEN_DB_FILE tzplatform_mkpath(TZ_USER_APP, "com.samsung.menu-screen/data/dbspace/.menu_screen.db")
 #define SHORTCUT_TABLE "shortcut"
 #define QUERY_INSERT_SHORTCUT "INSERT INTO "SHORTCUT_TABLE" ("\
        "appid,"\