summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-02-12 10:13:53 +0100
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-02-12 13:02:26 +0100
commit52334c25babb6e26b47d40b2cbaec6cff80ac420 (patch)
treecea75c24662204129802e9aaa9f07bac91ef948e
parent0d4637178db7bae58789e9eb1a74c8de1d4046d7 (diff)
downloadlibslp-alarm-sandbox/kthierry/multiuser.tar.gz
libslp-alarm-sandbox/kthierry/multiuser.tar.bz2
libslp-alarm-sandbox/kthierry/multiuser.zip
Add multi-user supportsandbox/kthierry/multiuser
Also: + set a valid license tag + clean spec file Bug-Tizen: PTREL-212 Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
-rw-r--r--CMakeLists.txt7
-rw-r--r--include/db-define.h6
-rw-r--r--packaging/libslp-alarm.spec88
3 files changed, 31 insertions, 70 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4857f25..d2a333e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,9 +18,9 @@ SET(VERSION "${VERSION_MAJOR}.0.0")
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX ${PREFIX})
SET(INCLUDEDIR "/usr/include")
-SET(PKGCONFIGDIR "/usr/lib/pkgconfig")
-SET(DBDIR "/opt/dbspace")
-SET(LIBDIR "/usr/lib")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(PKGCONFIGDIR "${LIBDIR}/pkgconfig")
+SET(DBDIR ${CMAKE_DB})
SET(UGLIBDIR "/opt/ug/lib")
SET(VERSION 0.1)
@@ -41,6 +41,7 @@ INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
gobject-2.0 glib-2.0 dlog
db-util
+ libtzplatform-config
)
#CFlags
diff --git a/include/db-define.h b/include/db-define.h
index d4f45dd..87bc1c3 100644
--- a/include/db-define.h
+++ b/include/db-define.h
@@ -23,13 +23,17 @@
#include <string.h>
#include <libintl.h>
#include <glib.h>
+
+/* For multi-user support */
+#include <tzplatform_config.h>
+
//tag
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "DB_ALARM"
//
-#define DBROOT "/opt/dbspace/"
+#define DBROOT tzplatform_mkstr(TZ_SYS_DB, "/")
#define DBNAME ".alarm.db"
//
#define DBHandle sqlite3
diff --git a/packaging/libslp-alarm.spec b/packaging/libslp-alarm.spec
index 764c6e9..10d6105 100644
--- a/packaging/libslp-alarm.spec
+++ b/packaging/libslp-alarm.spec
@@ -1,76 +1,61 @@
-#sbs-git:slp/apps/l/libslp-alarm libslp-alarm 0.2.7 743c13367284f1394db6db3a2d5a936be5279784
-# >> macros
-# << macros
-
Name: libslp-alarm
-Summary: libslp-alarm package
+Summary: Libslp-alarm package
Version: 0.2.7
Release: 59
Group: System/Libraries
-License: TBD
+License: Flora
Source0: %{name}-%{version}.tar.gz
-Source1001: libslp-alarm.manifest
-Requires(post): /sbin/ldconfig
-Requires(post): /usr/bin/sqlite3
-Requires(postun): /sbin/ldconfig
-BuildRequires: cmake
+Source1001: libslp-alarm.manifest
+
+BuildRequires: cmake
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(alarm-service)
+BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(libtzplatform-config)
+Requires: /sbin/ldconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
-
+Libslp-alarm package
%package devel
-Summary: libslp-alarm dev package
+Summary: Libslp-alarm dev package
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
-
+Libslp-alarm devel package
%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE1001} .
-# >> setup
-# << setup
%build
-# >> build pre
-# << build pre
-
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
-
-# Call make instruction with smp support
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_DB=%{TZ_SYS_DB}
make %{?jobs:-j%jobs}
-# >> build post
-# << build post
+
%install
rm -rf %{buildroot}
-# >> install pre
-# << install pre
%make_install
+rm -rf %{buildroot}%{_bindir}/test_alarmdb
+rm -rf %{buildroot}%{_libdir}/debug/.build-id/91/4fc4facc99877166fd839740e150eb7ae836f3*
+rm -rf %{buildroot}%{_libdir}/debug/usr/bin/test_alarmdb.debug
-# >> install post
-rm -f %{buildroot}/usr/bin/test_alarmdb
-# << install post
%clean
rm -rf %{buildroot}
-
-
%post
/sbin/ldconfig
-mkdir -p /opt/dbspace/
-sqlite3 /opt/dbspace/.alarm.db 'PRAGMA journal_mode = PERSIST;
+mkdir -p %{TZ_SYS_DB}
+sqlite3 %{TZ_SYS_DB}/.alarm.db 'PRAGMA journal_mode = PERSIST;
create table if not exists alarm (id INTEGER PRIMARY KEY,
magic INTEGER,
alarm_mgr_id INTEGER,
@@ -96,53 +81,24 @@ sqlite3 /opt/dbspace/.alarm.db 'PRAGMA journal_mode = PERSIST;
volume INTEGER,
auto_power_on INTEGER );'
+chown :6001 %{TZ_SYS_DB}/.alarm.db
+chown :6001 %{TZ_SYS_DB}/.alarm.db-journal
-# Change file owner
-#1.libraries
-#2.executables
-#3.configurations
-#4.images
-#5.edje
-#6.internatialize
-#7.etc
-#chown :5000 /opt/dbspace
-chown :6001 /opt/dbspace/.alarm.db
-chown :6001 /opt/dbspace/.alarm.db-journal
-#chown root:root /opt/dbspace/.alarm.db
-#chown root:root /opt/dbspace/.alarm.db-journal
-
-# Change file permissions
-#1.libraries
-#2.executables
-#3.configurations
-#4.images
-#5.edje
-#6.internatialize
-#7.etc
-#chmod 775 /opt/dbspace
-chmod 660 /opt/dbspace/.alarm.db
-chmod 660 /opt/dbspace/.alarm.db-journal
-#chmod 600 /opt/dbspace/.alarm.db
-#chmod 600 /opt/dbspace/.alarm.db-journal
+chmod 660 %{TZ_SYS_DB}/.alarm.db
+chmod 660 %{TZ_SYS_DB}/.alarm.db-journal
%postun -p /sbin/ldconfig
-
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
-# >> files
%{_libdir}/*.so*
-# << files
%files devel
%manifest %{name}.manifest
%defattr(-,root,root,-)
-# >> files devel
%{_includedir}/*
%{_libdir}/pkgconfig/*
-# << files devel
-