diff options
-rwxr-xr-x | CMakeLists.txt | 6 | ||||
-rwxr-xr-x | packaging/capi-media-controller.spec | 40 | ||||
-rw-r--r-- | packaging/media-controller_create_db.sh | 20 | ||||
-rwxr-xr-x | svc/CMakeLists.txt | 4 |
4 files changed, 42 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 06f1d39..3ab0553 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/packaging/capi-media-controller.spec b/packaging/capi-media-controller.spec index 744e074..410bfaf 100755 --- a/packaging/capi-media-controller.spec +++ b/packaging/capi-media-controller.spec @@ -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 index 0000000..a8075a1 --- /dev/null +++ b/packaging/media-controller_create_db.sh @@ -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 diff --git a/svc/CMakeLists.txt b/svc/CMakeLists.txt index 4d3a678..b5d0262 100755 --- a/svc/CMakeLists.txt +++ b/svc/CMakeLists.txt @@ -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) |