[Media-Controller] Build error fix 61/40561/1 accepted/tizen_3.0.2015.q2_common tizen_3.0.2015.q2_common accepted/tizen/3.0.2015.q2/common/20150615.091744 accepted/tizen/common/20150605.080252 accepted/tizen/mobile/20150605.092756 accepted/tizen/tv/20150605.092712 accepted/tizen/wearable/20150605.092726 submit/tizen/20150605.065109 submit/tizen_3.0.2015.q2_common/20150615.075539
authorJi Yong Min <jiyong.min@samsung.com>
Fri, 5 Jun 2015 06:34:54 +0000 (15:34 +0900)
committerJi Yong Min <jiyong.min@samsung.com>
Fri, 5 Jun 2015 06:36:28 +0000 (15:36 +0900)
Change-Id: I803cd6732ee9eefb27754098a1127e7436ec7fd5
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
CMakeLists.txt
packaging/capi-media-controller.spec
packaging/media-controller_create_db.sh [new file with mode: 0644]
svc/CMakeLists.txt

index 06f1d39..3ab0553 100755 (executable)
@@ -55,7 +55,7 @@ ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DTIZEN_DEBUG")
 ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 
 aux_source_directory(src SOURCES)
 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
@@ -69,7 +69,7 @@ SET_TARGET_PROPERTIES(${fw_name}
      CLEAN_DIRECT_OUTPUT 1
 )
 
-INSTALL(TARGETS ${fw_name} DESTINATION lib)
+INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
 INSTALL(
         DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
         FILES_MATCHING
@@ -88,7 +88,7 @@ CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
     @ONLY
 )
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
 ADD_SUBDIRECTORY(svc)
 ADD_SUBDIRECTORY(test/client_test)
index 744e074..410bfaf 100755 (executable)
@@ -6,6 +6,7 @@ Group:      System/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1:    mediacontroller.service
+Source1001: media-controller_create_db.sh
 Requires(post):  /sbin/ldconfig
 Requires(postun):  /sbin/ldconfig
 BuildRequires:  cmake
@@ -41,41 +42,34 @@ A media controller library in SLP C API
 
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-export CFLAGS+=" -DGST_EXT_TIME_ANALYSIS -include stdint.h"
-
-%if 0%{?sec_build_binary_debug_enable}
-export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS+=" -DDTIZEN_DEBUG_ENABLE"
-export FFLAGS+=" -DTIZEN_DEBUG_ENABLE"
-%endif
-
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
-
-make %{?jobs:-j%jobs}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%__make %{?jobs:-j%jobs}
 
 %install
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
-install -m 644 %{SOURCE1} %{buildroot}/usr/lib/systemd/system/mediacontroller.service
-ln -s ../mediacontroller.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/mediacontroller.service
+mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/mediacontroller.service
+ln -s ../mediacontroller.service %{buildroot}%{_unitdir}/multi-user.target.wants/mediacontroller.service
 
 #Create DB
-mkdir -p %{buildroot}/opt/usr/dbspace
-sqlite3 %{buildroot}/opt/usr/dbspace/.media_controller.db 'PRAGMA journal_mode = PERSIST; PRAGMA user_version=1;'
+install -m 0775 %{SOURCE1001} %{buildroot}%{_bindir}/media-controller_create_db.sh
+#mkdir -p %{buildroot}/opt/usr/dbspace
+#sqlite3 %{buildroot}/opt/usr/dbspace/.media_controller.db 'PRAGMA journal_mode = PERSIST; PRAGMA user_version=1;'
 
 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
 mkdir -p %{buildroot}/usr/share/license
 cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name}
 
 %post -p /sbin/ldconfig
-
+chgrp %TZ_SYS_USER_GROUP %{_bindir}/media-controller_create_db.shchgrp -R %TZ_SYS_USER_GROUP %{TZ_SYS_DATA}/data-media
 %postun -p /sbin/ldconfig
 
 %files
 %defattr(-,root,root,-)
 %{_libdir}/*.so.*
+%{_bindir}/media-controller_create_db.sh
 #%{_bindir}/*                  //disable tests
 %manifest capi-media-controller.manifest
 /usr/share/license/%{name}
@@ -84,14 +78,14 @@ cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name}
 %defattr(-,root,root,-)
 %{_bindir}/mediacontroller
 %manifest media-controller-service.manifest
-/usr/lib/systemd/system/mediacontroller.service
-/usr/lib/systemd/system/multi-user.target.wants/mediacontroller.service
+%{_unitdir}/mediacontroller.service
+%{_unitdir}/multi-user.target.wants/mediacontroller.service
 #change owner
 #chown 200:5000 /opt/usr/dbspace/.media_controller.db*
-%attr(660,system,app) /opt/usr/dbspace/.media_controller.db
-%attr(660,system,app) /opt/usr/dbspace/.media_controller.db-journal
-%config(noreplace) /opt/usr/dbspace/.media_controller.db
-%config(noreplace) /opt/usr/dbspace/.media_controller.db-journal
+#%attr(660,system,app) /opt/usr/dbspace/.media_controller.db
+#%attr(660,system,app) /opt/usr/dbspace/.media_controller.db-journal
+#%config(noreplace) /opt/usr/dbspace/.media_controller.db
+#%config(noreplace) /opt/usr/dbspace/.media_controller.db-journal
 /usr/share/license/%{name}
 
 %files devel
diff --git a/packaging/media-controller_create_db.sh b/packaging/media-controller_create_db.sh
new file mode 100644 (file)
index 0000000..a8075a1
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+source /etc/tizen-platform.conf
+
+mkdir -p $TZ_SYS_DB
+
+#Create DB file
+sqlite3 ${TZ_SYS_DB}/.media_controller.db 'PRAGMA journal_mode = PERSIST;'
+
+#Change permission
+chmod 664 ${TZ_SYS_DB}/.media_controller.db
+chmod 664 ${TZ_SYS_DB}/.media_controller.db-journal
+
+#Change owner
+#chown -R :$TZ_SYS_USER_GROUP ${TZ_SYS_DATA}/data-media/*
+
+#Change group (6017: db_filemanager 5000: app)
+chgrp $TZ_SYS_USER_GROUP ${TZ_SYS_DB}
+chgrp 6017 ${TZ_SYS_DB}/.media_controller.db
+chgrp 6017 ${TZ_SYS_DB}/.media_controller.db-journal
index 4d3a678..b5d0262 100755 (executable)
@@ -28,7 +28,7 @@ ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DTIZEN_DEBUG")
 ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 
 aux_source_directory(. SOURCES_SVC)
 ADD_LIBRARY(${fw_svc} SHARED ${SOURCES_SVC})
@@ -42,5 +42,5 @@ SET_TARGET_PROPERTIES(${fw_svc}
      CLEAN_DIRECT_OUTPUT 1
 )
 
-INSTALL(TARGETS ${fw_svc} DESTINATION lib)
+INSTALL(TARGETS ${fw_svc} DESTINATION ${LIB_INSTALL_DIR})
 ADD_SUBDIRECTORY(daemon)