From 8c9e7969ce86bd9ce7f94a4ee1db55e3020764c4 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Wed, 29 Mar 2017 12:47:28 +0900 Subject: [PATCH] Cleanup the build spec and remove capi-system-sensor-extension-recorder package Change-Id: I4efb8a4c8735242205cf77f691c4cf597a9925be Signed-off-by: Mu-Woong Lee --- CMakeLists.txt | 14 +--- packaging/capi-system-sensor.spec | 77 ++---------------- src/sensor_recorder_dummy.cpp | 167 -------------------------------------- 3 files changed, 9 insertions(+), 249 deletions(-) delete mode 100644 src/sensor_recorder_dummy.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ba5e3b..d149868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,7 @@ PROJECT(capi-system-sensor) INCLUDE(GNUInstallDirs) SET(DEPENDENTS "dlog sensor capi-base-common") - -IF("${SENSOR_RECORDER}" STREQUAL "on") - SET(DEPENDENTS "${DEPENDENTS} context-sensor-recorder-client") -ENDIF() +SET(DEPENDENTS "${DEPENDENTS} context-sensor-recorder-client") SET(VERSION ${FULLVER}) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) @@ -15,7 +12,7 @@ SET(PC_NAME ${PROJECT_NAME}) SET(PC_DESCRIPTION "Sensor C-API library") SET(PC_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/sensor") SET(PC_DEPENDENTS "${DEPENDENTS}") -SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +SET(PC_LIBDIR "${CMAKE_INSTALL_LIBDIR}") SET(PC_LDFLAGS "-l${PROJECT_NAME}") INCLUDE_DIRECTORIES(include ${CMAKE_CURRENT_SOURCE_DIR}) @@ -38,15 +35,10 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl, --rpath=${LIB_INSTALL_DIR}") # Compile Source files SET(SOURCES src/sensor.cpp + src/sensor_recorder.cpp src/geomagnetic_field.c src/fusion_util.c) -IF("${SENSOR_RECORDER}" STREQUAL "on") - SET(SOURCES ${SOURCES} src/sensor_recorder.cpp) -ELSE() - SET(SOURCES ${SOURCES} src/sensor_recorder_dummy.cpp) -ENDIF() - ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCES}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_LDFLAGS}) diff --git a/packaging/capi-system-sensor.spec b/packaging/capi-system-sensor.spec index 9e9f263..cfbb7f8 100644 --- a/packaging/capi-system-sensor.spec +++ b/packaging/capi-system-sensor.spec @@ -1,9 +1,6 @@ -# Do not provide .so automatically for the extensions. -%global __provides_exclude_from ^.*\\.recorder - Name: capi-system-sensor Summary: A Sensor library in TIZEN C API -Version: 0.2.4 +Version: 0.2.5 Release: 1 Group: System/API License: Apache-2.0 and PD @@ -13,40 +10,20 @@ BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(sensor) BuildRequires: pkgconfig(capi-base-common) -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || wearable || common || "undefined" -%if "%{?profile}" != "tv" && "%{?profile}" != "ivi" BuildRequires: pkgconfig(context-sensor-recorder-client) -%endif Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig +Provides: %{name}-profile_common = %{version}-%{release} +Provides: %{name}-profile_mobile = %{version}-%{release} +Provides: %{name}-profile_wearable = %{version}-%{release} Provides: %{name}-profile_tv = %{version}-%{release} Provides: %{name}-profile_ivi = %{version}-%{release} %description A Sensor Library in TIZEN C API package. -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || wearable || common || "undefined" -%if "%{?profile}" != "tv" && "%{?profile}" != "ivi" -%package extension-recorder -Summary: capi-system-sensor extension with sensor recorder (for mobile/wearable) -Requires: %{name} = %{version}-%{release} -# After Context FW is refactored, this explicit dependency can be removed. -Requires: context-service -Provides: %{name}-profile_mobile = %{version}-%{release} -Provides: %{name}-profile_wearable = %{version}-%{release} -Provides: %{name}-profile_common = %{version}-%{release} - -%description extension-recorder -Binary replacing extension for capi-system-sensor supporting recorder. -This extension targets Tizen mobile/wearable profiles. -If you want to keep using %{name} after uninstalling this extension, -you need to reinstall %{name} after uninstalling this extension. -%endif - %package devel Summary: A Sensor library in TIZEN C API (Development) Group: System/Development @@ -61,34 +38,10 @@ A Sensor library in TIZEN C API package (Development). %build MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` - -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || wearable || common || "undefined" -%if "%{?profile}" != "tv" && "%{?profile}" != "ivi" -mkdir -p build_extension -pushd build_extension -%cmake .. -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DSENSOR_RECORDER=on -%__make %{?_smp_mflags} -popd -%endif - -%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DSENSOR_RECORDER=off +%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} %__make %{?_smp_mflags} %install -rm -rf %{buildroot} - -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || wearable || common || "undefined" -%if "%{?profile}" != "tv" && "%{?profile}" != "ivi" -pushd build_extension -%make_install -popd -pushd %{buildroot}%{_libdir}/ -for FILE in libcapi-system-sensor.so.*; do mv "${FILE}" "${FILE}.recorder"; done -popd -%endif - %make_install %post -p /sbin/ldconfig @@ -97,29 +50,11 @@ popd %files %manifest packaging/capi-system-sensor.manifest -%exclude %{_libdir}/libcapi-system-sensor.so.*.recorder -%{_libdir}/libcapi-system-sensor.so.* +%{_libdir}/libcapi-system-sensor.so* %license LICENSE.APLv2 %files devel %manifest packaging/capi-system-sensor.manifest -%{_libdir}/libcapi-system-sensor.so %{_libdir}/pkgconfig/*.pc %{_includedir}/sensor/*.h %license LICENSE.APLv2 - -# This is for backward-compatibility. This does not deteriorate 4.0 Configurability -# if mobile || wearable || common || "undefined" -%if "%{?profile}" != "tv" && "%{?profile}" != "ivi" -%post extension-recorder -pushd %{_libdir} -for FILE in libcapi-system-sensor.so.*.recorder; do ln -sf "${FILE}" "${FILE%.recorder}"; chsmack -a "_" "${FILE%.recorder}"; done -popd - -%preun extension-recorder -echo "You need to reinstall %{name} if you want to keep using %{name} after uninstalling this extension." - -%files extension-recorder -%manifest packaging/capi-system-sensor.manifest -%{_libdir}/libcapi-system-sensor.so.*.recorder -%endif diff --git a/src/sensor_recorder_dummy.cpp b/src/sensor_recorder_dummy.cpp deleted file mode 100644 index 669afae..0000000 --- a/src/sensor_recorder_dummy.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -int sensor_recorder_is_supported(sensor_type_e type, bool *supported) -{ - if (type <= SENSOR_ALL) - return SENSOR_ERROR_INVALID_PARAMETER; - if (!supported) - return SENSOR_ERROR_INVALID_PARAMETER; - - *supported = false; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_start(sensor_type_e type, sensor_recorder_option_h option) -{ - if (type <= SENSOR_ALL) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NOT_SUPPORTED; -} - -int sensor_recorder_stop(sensor_type_e type) -{ - if (type <= SENSOR_ALL) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NOT_SUPPORTED; -} - -int sensor_recorder_create_option(sensor_recorder_option_h *option) -{ - if (!option) - return SENSOR_ERROR_INVALID_PARAMETER; - - *option = (sensor_recorder_option_h)malloc(sizeof(sensor_recorder_option_h)); - if (!*option) - return SENSOR_ERROR_OUT_OF_MEMORY; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_destroy_option(sensor_recorder_option_h option) -{ - if (!option) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_option_set_int(sensor_recorder_option_h option, sensor_recorder_option_e attribute, int value) -{ - if (!option) - return SENSOR_ERROR_INVALID_PARAMETER; - if (attribute < 0) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_create_query(sensor_recorder_query_h *query) -{ - if (!query) - return SENSOR_ERROR_INVALID_PARAMETER; - - *query = (sensor_recorder_query_h)malloc(sizeof(sensor_recorder_query_h)); - if (!*query) - return SENSOR_ERROR_OUT_OF_MEMORY; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_destroy_query(sensor_recorder_query_h query) -{ - if (!query) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_query_set_int(sensor_recorder_query_h query, sensor_recorder_query_e attribute, int value) -{ - if (!query) - return SENSOR_ERROR_INVALID_PARAMETER; - if (attribute < 0) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_query_set_time(sensor_recorder_query_h query, sensor_recorder_query_e attribute, time_t t) -{ - if (!query) - return SENSOR_ERROR_INVALID_PARAMETER; - if (attribute < 0) - return SENSOR_ERROR_INVALID_PARAMETER; - if (t < 0) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_read(sensor_type_e type, sensor_recorder_query_h query, sensor_recorder_data_cb cb, void *user_data) -{ - if (type <= SENSOR_ALL) - return SENSOR_ERROR_INVALID_PARAMETER; - if (!query || !cb) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_read_sync(sensor_type_e type, sensor_recorder_query_h query, sensor_recorder_data_cb cb, void *user_data) -{ - if (type <= SENSOR_ALL) - return SENSOR_ERROR_INVALID_PARAMETER; - if (!query || !cb) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_data_get_time(sensor_recorder_data_h data, time_t *start_time, time_t *end_time) -{ - if (!data || !start_time || !end_time) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_data_get_int(sensor_recorder_data_h data, sensor_recorder_data_e key, int *value) -{ - if (!data || !value) - return SENSOR_ERROR_INVALID_PARAMETER; - if (key < 0) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} - -int sensor_recorder_data_get_double(sensor_recorder_data_h data, sensor_recorder_data_e key, double *value) -{ - if (!data || !value) - return SENSOR_ERROR_INVALID_PARAMETER; - if (key < 0) - return SENSOR_ERROR_INVALID_PARAMETER; - - return SENSOR_ERROR_NONE; -} -- 2.7.4