From 40e56972eb45a55cfb9fe9ec89c10df5b9b2c312 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 15 Jul 2013 14:06:08 +0300 Subject: [PATCH] Include database in package files instead of creating it in %post 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 --- CMakeLists.txt | 2 -- packaging/app-svc.changes | 3 +++ packaging/app-svc.spec | 19 +++++++------------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1970a55..b531550 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/packaging/app-svc.changes b/packaging/app-svc.changes index 3a8908c..1568ca0 100644 --- a/packaging/app-svc.changes +++ b/packaging/app-svc.changes @@ -1,3 +1,6 @@ +* Mon Jul 15 2013 Markus Lehtonen submit/tizen/20130621.062843@d15a8b6 +- Include database in package files instead of creating it in %post (TZPC-3631) + * Thu Jun 20 2013 José Bollo accepted/tizen/20130602.015259@a26a0be - cleanup diff --git a/packaging/app-svc.spec b/packaging/app-svc.spec index b047364..349ffaf 100644 --- a/packaging/app-svc.spec +++ b/packaging/app-svc.spec @@ -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 -- 2.7.4