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})
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
${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)
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
%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}
%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