Include database in package files instead of creating it in %post 27/5727/1 accepted/tizen/20130716.223231 submit/tizen/20130716.035005 submit/tizen/20130716.223402
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 15 Jul 2013 11:06:08 +0000 (14:06 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 15 Jul 2013 11:35:20 +0000 (14:35 +0300)
Removes the %post hack which broke the package by removing one of the
installed files (i.e. /opt/share/appsvc_db.sql). Instead, create the
database at package build time and install it as part of the package
like the other files.

Change-Id: I2989fdae3fb133e7f208a504e0da149c475fe022
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
CMakeLists.txt
packaging/app-svc.changes
packaging/app-svc.spec

index 1970a55..b531550 100755 (executable)
@@ -85,8 +85,6 @@ INSTALL(TARGETS ${AVATAR_NAME} DESTINATION bin)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/appsvc.h DESTINATION include/appsvc)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/appsvc.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/appsvc_db.sql DESTINATION /opt/share )
-
 # test
 add_subdirectory(test)
 
index 3a8908c..1568ca0 100644 (file)
@@ -1,3 +1,6 @@
+* Mon Jul 15 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> submit/tizen/20130621.062843@d15a8b6
+- Include database in package files instead of creating it in %post (TZPC-3631)
+
 * Thu Jun 20 2013 José Bollo <jose.bollo@eurogiciel.fr> accepted/tizen/20130602.015259@a26a0be
 - cleanup
 
index b047364..349ffaf 100644 (file)
@@ -8,9 +8,9 @@ Source0:    %{name}-%{version}.tar.gz
 Source1001:    app-svc.manifest
 
 Requires(post): /sbin/ldconfig
-Requires(post): sqlite3
 Requires(postun): /sbin/ldconfig
 BuildRequires: cmake
+BuildRequires: sqlite3
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(ecore) 
 BuildRequires: pkgconfig(x11)
@@ -48,17 +48,11 @@ make %{?jobs:-j%jobs}
 %install
 %make_install
 
+# Create database
+mkdir -p %{buildroot}/opt/dbspace
+sqlite3 %{buildroot}/opt/dbspace/.appsvc.db < data/appsvc_db.sql
 
-%post
-/sbin/ldconfig
-
-sqlite3 /opt/dbspace/.appsvc.db < /opt/share/appsvc_db.sql
-rm -rf /opt/share/appsvc_db.sql
-
-chown 0:5000 /opt/dbspace/.appsvc.db
-chown 0:5000 /opt/dbspace/.appsvc.db-journal
-chmod 664 /opt/dbspace/.appsvc.db
-chmod 664 /opt/dbspace/.appsvc.db-journal
+%post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
@@ -67,7 +61,8 @@ chmod 664 /opt/dbspace/.appsvc.db-journal
 %license LICENSE
 %manifest app-svc.manifest
 %defattr(-,root,root,-)
-/opt/share/appsvc_db.sql
+%config(noreplace) %verify(not md5 mtime size) %attr(664,0,5000) /opt/dbspace/.appsvc.db
+%config(noreplace) %verify(not md5 mtime size) %attr(664,0,5000) /opt/dbspace/.appsvc.db-journal
 /usr/bin/appsvc_test
 %{_libdir}/libappsvc.so.0
 %{_libdir}/libappsvc.so.0.1.0