Remove the redundency to make profile rpms 65/139265/3 accepted/tizen/4.0/unified/20170816.013509 accepted/tizen/4.0/unified/20170816.015952 accepted/tizen/unified/20170721.024457 submit/tizen/20170719.005005 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 18 Jul 2017 06:34:06 +0000 (15:34 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 18 Jul 2017 09:46:50 +0000 (18:46 +0900)
Check the specific features in run-time using the
profile information. So we can build all source codes
at once.

Change-Id: Ibca746737712b1d178717e450d5fc54dbea9bd97
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
CMakeLists.txt
ag-agent/CMakeLists.txt
ag-agent/bluetooth-ag-agent.c
bt-ipsp/CMakeLists.txt
hf-agent/CMakeLists.txt
hf-agent/bluetooth-hf-agent.c
include/bluetooth-agent-profile.c [new file with mode: 0644]
include/bluetooth-agent-profile.h [new file with mode: 0644]
map-agent/CMakeLists.txt
packaging/bluetooth-agent.spec
pb-agent/CMakeLists.txt

index 419b7de..86d8c7a 100644 (file)
@@ -1,13 +1,10 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
-IF (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
+# For bluetooth-agent-profile.h
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
 ADD_SUBDIRECTORY(hf-agent)
-ELSE (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
 ADD_SUBDIRECTORY(map-agent)
 ADD_SUBDIRECTORY(pb-agent)
-IF (TIZEN_FEATURE_BT_HFP_AG)
 ADD_SUBDIRECTORY(ag-agent)
-ENDIF (TIZEN_FEATURE_BT_HFP_AG)
-ENDIF (TIZEN_PROFILE_WEARABLE OR TIZEN_PROFILE_IVI)
-
 ADD_SUBDIRECTORY(bt-ipsp)
\ No newline at end of file
index 3737443..99fe7b4 100644 (file)
@@ -3,7 +3,8 @@ PROJECT(bluetooth-ag-agent C)
 
 SET(SRCS bluetooth-ag-agent.c
                        bluetooth-ag-handler.c
-                       bluetooth-ag-manager.c)
+                       bluetooth-ag-manager.c
+                       ../include/bluetooth-agent-profile.c)
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 
index 9555899..d6f9bbb 100755 (executable)
@@ -29,6 +29,7 @@
 #include <bundle_internal.h>
 #include "bluetooth-ag-agent.h"
 #include "bluetooth-ag-handler.h"
+#include "bluetooth-agent-profile.h"
 
 #include <TapiUtility.h>
 #include <ITapiSim.h>
@@ -74,10 +75,7 @@ static bt_ag_media_transport_state_t transport_state;
 #define A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb"
 #endif
 #define DEFAULT_ADAPTER_OBJECT_PATH "/org/bluez/hci0"
-
-#ifdef TIZEN_FEATURE_BT_LUNAR_DEVICE
 #define VCONF_KEY_BT_LUNAR_ENABLED "db/wms/bt_loop_device_hfp_connected"
-#endif
 
 #if defined(TIZEN_PROFILE_WEARABLE) && defined(TIZEN_FEATURE_BT_HFP_AG)
 #define CALL_APP_ID "org.tizen.call-ui"
@@ -555,7 +553,6 @@ static gboolean __bt_get_outgoing_call_condition(int *condition)
 #endif
 }
 
-#if defined(TIZEN_PROFILE_WEARABLE) && defined(TIZEN_TELEPHONY_ENABLED)
 static gboolean  __bt_ag_agent_launch_call_app(const char *number)
 {
        FN_START;
@@ -581,7 +578,6 @@ static gboolean  __bt_ag_agent_launch_call_app(const char *number)
        FN_END;
        return TRUE;
 }
-#endif
 
 static void *__bt_ag_agent_launch_call_req(void *arg)
 {
@@ -599,14 +595,13 @@ static gboolean __bt_ag_agent_make_call(const char *number)
 {
        FN_START;
 
-#if defined(TIZEN_PROFILE_WEARABLE) && defined(TIZEN_FEATURE_BT_HFP_AG)
-       FN_END;
-       return __bt_ag_agent_launch_call_app(number);
-#else
        char telnum[BT_MAX_TEL_NUM_STRING];
        bundle *b;
        pthread_t thread_id;
 
+       if (TIZEN_PROFILE_WEARABLE)
+               return __bt_ag_agent_launch_call_app(number);
+
        if (call_launch_requested == TRUE) {
                DBG("Launch request is in progress");
                return TRUE;
@@ -634,7 +629,6 @@ static gboolean __bt_ag_agent_make_call(const char *number)
 
        FN_END;
        return TRUE;
-#endif
 }
 
 static gboolean __bt_ag_agent_make_video_call(const char *mo_number)
@@ -1638,14 +1632,10 @@ static bt_hfp_agent_error_t __bt_hfp_send_bcs_command(bt_ag_info_t *hs,
        uint32_t codec;
        struct ag_codec *data = NULL;;
 
-#ifdef TIZEN_FEATURE_BT_KIRAN_DEVICE
-       codec = BT_CVSD_CODEC_ID;
-#else
        if (hs->codec_info.remote_codecs & BT_MSBC_CODEC_MASK)
                codec = BT_MSBC_CODEC_ID;
        else
                codec = BT_CVSD_CODEC_ID;
-#endif
 
        if (wbs_opts.wbs_enable == FALSE)
                codec = BT_CVSD_CODEC_ID;
@@ -3754,7 +3744,6 @@ static void __bt_ag_agent_network_signal_status_cb(keynode_t *node)
        _bt_hfp_set_property_value("SignalBarsChanged", signal_bar);
 }
 
-#ifdef TIZEN_FEATURE_BT_LUNAR_DEVICE
 static void __bt_ag_agent_lunar_connection_status_cb(keynode_t *node)
 {
        gboolean status = vconf_keynode_get_bool(node);
@@ -3768,7 +3757,6 @@ static void __bt_ag_agent_lunar_connection_status_cb(keynode_t *node)
                }
        }
 }
-#endif
 
 static void __bt_ag_agent_network_register_status_cb(keynode_t *node)
 {
@@ -3827,13 +3815,12 @@ static void __bt_ag_agent_subscribe_vconf_updates(void)
        if (0 != ret)
                ERR("Subsrciption to network failed err =  [%d]\n", ret);
 
-#ifdef TIZEN_FEATURE_BT_LUNAR_DEVICE
-       ret = vconf_notify_key_changed(VCONF_KEY_BT_LUNAR_ENABLED,
-                       (void *)__bt_ag_agent_lunar_connection_status_cb, NULL);
-       if (0 != ret)
-               ERR("Subsrciption to lunar connection failed err =  [%d]\n", ret);
-
-#endif
+       if (TIZEN_PROFILE_WEARABLE) {
+               ret = vconf_notify_key_changed(VCONF_KEY_BT_LUNAR_ENABLED,
+                               (void *)__bt_ag_agent_lunar_connection_status_cb, NULL);
+               if (0 != ret)
+                       ERR("Subsrciption to lunar connection failed err =  [%d]\n", ret);
+       }
 }
 
 static void __bt_ag_agent_release_vconf_updates(void)
@@ -4345,9 +4332,7 @@ static uint32_t __bt_ag_agent_get_ag_features(void)
                                BT_AG_FEATURE_REJECT_CALL |
                                BT_AG_FEATURE_ENHANCED_CALL_STATUS |
                                BT_AG_FEATURE_THREE_WAY_CALL |
-#ifndef TIZEN_FEATURE_BT_KIRAN_DEVICE
                                BT_AG_FEATURE_VOICE_RECOGNITION |
-#endif
                                BT_AG_FEATURE_EXTENDED_ERROR_RESULT_CODES;
 
        wbs_en = TRUE;
index 93d2776..5d3f910 100644 (file)
@@ -1,7 +1,8 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(bt-ipsp C)
 
-SET(SRCS bt-ipsp.c)
+SET(SRCS bt-ipsp.c
+               ../include/bluetooth-agent-profile.c)
 
 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
        SET(CMAKE_BUILD_TYPE "Release")
@@ -18,6 +19,7 @@ SET(PKG_MODULES
        bluetooth-api
        gio-2.0
        dlog
+       capi-system-info
 )
 
 INCLUDE(FindPkgConfig)
index 1f47bc3..da878f5 100644 (file)
@@ -1,7 +1,8 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(bluetooth-hf-agent C)
 
-SET(SRCS bluetooth-hf-agent.c)
+SET(SRCS bluetooth-hf-agent.c
+               ../include/bluetooth-agent-profile.c)
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 
@@ -9,7 +10,8 @@ INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs_hf_agent
                REQUIRED
                dlog aul bluetooth-api alarm-service capi-appfw-app-manager
-               glib-2.0 gio-2.0 gio-unix-2.0 capi-system-device vconf)
+               glib-2.0 gio-2.0 gio-unix-2.0 capi-system-device vconf
+               capi-system-info)
 
 FOREACH(flag ${pkgs_hf_agent_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 048ae4a..7ac16c2 100755 (executable)
@@ -40,6 +40,7 @@
 #include <bundle_internal.h>
 
 #include "bluetooth-hf-agent.h"
+#include "bluetooth-agent-profile.h"
 
 #define BT_AGENT_SYSPOPUP_MAX_ATTEMPT 3
 #define CALL_APP_ID "org.tizen.call-ui"
@@ -2587,9 +2588,8 @@ static gboolean __bt_establish_service_level_conn(bt_hf_agent_info_t *bt_hf_info
                        BT_HF_FEATURE_REMOTE_VOLUME_CONTROL |
                        BT_HF_FEATURE_ENHANCED_CALL_STATUS;
 
-#ifdef TIZEN_PROFILE_WEARABLE
-       feature = feature | BT_HF_FEATURE_CODEC_NEGOTIATION;
-#endif
+       if (TIZEN_PROFILE_WEARABLE)
+               feature = feature | BT_HF_FEATURE_CODEC_NEGOTIATION;
 
        snprintf(cmd_buf, sizeof(cmd_buf), BT_HF_FEATURES, feature);
        ret = __bt_hf_send_and_read(bt_hf_info, cmd_buf, buf,
@@ -2609,18 +2609,17 @@ static gboolean __bt_establish_service_level_conn(bt_hf_agent_info_t *bt_hf_info
                return FALSE;
        INFO("Gateway supported features are 0x%X", bt_hf_info->ag_features);
 
-#ifdef TIZEN_PROFILE_WEARABLE
-       if (bt_hf_info->ag_features & BT_AG_FEATURE_CODEC_NEGOTIATION) {
-               ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_MSBC);
-               if (ret != BT_HF_AGENT_ERROR_NONE)
-                       ERR("Unable to set the default WBC codec");
+       if (TIZEN_PROFILE_WEARABLE) {
+               if (bt_hf_info->ag_features & BT_AG_FEATURE_CODEC_NEGOTIATION) {
+                       ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_MSBC);
+                       if (ret != BT_HF_AGENT_ERROR_NONE)
+                               ERR("Unable to set the default WBC codec");
 
-               ret = __bt_hf_send_available_codec(bt_hf_info, 0);
-               if (!ret)
-                       return FALSE;
-       } else
-#endif
-       {
+                       ret = __bt_hf_send_available_codec(bt_hf_info, 0);
+                       if (!ret)
+                               return FALSE;
+               }
+       } else {
                /* Default codec is NB */
                ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_CVSD);
                if (ret != BT_HF_AGENT_ERROR_NONE)
@@ -3373,9 +3372,8 @@ static uint32_t __bt_hf_agent_get_hf_features(void)
                        BT_HF_FEATURE_ENHANCED_CALL_STATUS |
                        BT_HF_FEATURE_CODEC_NEGOTIATION;
 
-#ifdef TIZEN_PROFILE_WEARABLE
-       hf_features = hf_features | BT_HF_FEATURE_CODEC_NEGOTIATION;
-#endif
+       if (TIZEN_PROFILE_WEARABLE)
+               hf_features = hf_features | BT_HF_FEATURE_CODEC_NEGOTIATION;
 
        hf_ver = HFP_VERSION_1_6;
 
diff --git a/include/bluetooth-agent-profile.c b/include/bluetooth-agent-profile.c
new file mode 100644 (file)
index 0000000..fe1aeca
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Bluetooth-agent-common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:    Hocheol Seo <hocheol.seo@samsung.com>
+ *             Girishashok Joshi <girish.joshi@samsung.com>
+ *             Chanyeol Park <chanyeol.park@samsung.com>
+ *
+ * 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 "bluetooth-agent-profile.h"
+
+tizen_profile_t profile = _PROFILE_UNKNOWN;
diff --git a/include/bluetooth-agent-profile.h b/include/bluetooth-agent-profile.h
new file mode 100644 (file)
index 0000000..d25af2f
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Bluetooth-agent-common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:    Hocheol Seo <hocheol.seo@samsung.com>
+ *             Girishashok Joshi <girish.joshi@samsung.com>
+ *             Chanyeol Park <chanyeol.park@samsung.com>
+ *
+ * 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.
+ *
+ */
+
+#ifndef __DEF_BT_AGENT_PROFILE_H_
+#define __DEF_BT_AGENT_PROFILE_H_
+
+#include <sys/types.h>
+#include <libintl.h>
+#include <stdlib.h>
+#include <system_info.h>
+
+typedef enum {
+       _PROFILE_UNKNOWN = 0,
+       _PROFILE_MOBILE = 0x1,
+       _PROFILE_WEARABLE = 0x2,
+       _PROFILE_TV = 0x4,
+       _PROFILE_IVI = 0x8,
+       _PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+
+/* For optimization, make this extern and define in a shared C file */
+extern tizen_profile_t profile;
+
+/* Accessing system info */
+int system_info_get_platform_string(const char *key, char **value);
+
+static inline tizen_profile_t get_tizen_profile()
+{
+        char *profileName = NULL;
+
+        if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+                return profile;
+
+        system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+
+        /* To pass the checking of g_ir */
+        if (!profileName)
+                return _PROFILE_UNKNOWN;
+
+        switch (*profileName) {
+        case 'm':
+        case 'M':
+                profile = _PROFILE_MOBILE;
+                break;
+        case 'w':
+        case 'W':
+                profile = _PROFILE_WEARABLE;
+                break;
+        case 't':
+        case 'T':
+                profile = _PROFILE_TV;
+                break;
+        case 'i':
+        case 'I':
+                profile = _PROFILE_IVI;
+                break;
+        default: // common or unknown ==> ALL ARE COMMON.
+                profile = _PROFILE_COMMON;
+        }
+        free(profileName);
+
+        return profile;
+}
+
+#define TIZEN_PROFILE_WEARABLE (get_tizen_profile() == _PROFILE_WEARABLE)
+#define TIZEN_PROFILE_IVI (get_tizen_profile() == _PROFILE_IVI)
+#define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
+#define TIZEN_PROFILE_MOBILE (get_tizen_profile() == _PROFILE_MOBILE)
+
+#endif /* __DEF_BT_AGENT_PROFILE_H_ */
index 8b7ce48..d887e65 100644 (file)
@@ -1,14 +1,16 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(bluetooth-map-agent C)
 
-SET(SRCS bluetooth_map_agent.c bluetooth_map_sms.c bluetooth_map_email.c map_bmessage.c)
+SET(SRCS bluetooth_map_agent.c bluetooth_map_sms.c bluetooth_map_email.c 
+               map_bmessage.c ../include/bluetooth-agent-profile.c)
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs_map_agent
                REQUIRED
-               dlog msg-service email-service tapi vconf gio-2.0)
+               dlog msg-service email-service tapi vconf gio-2.0
+               capi-system-info)
 
 FOREACH(flag ${pkgs_map_agent_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index ad8c0b9..9df8a2c 100644 (file)
@@ -118,85 +118,25 @@ export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=
 
 export CFLAGS_DEFAULT="$CFLAGS"
 
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
-# Original: wearable, ivi. Added: common, "undefined"
-
-# Build Wearable
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_PROFILE_WEARABLE"
-export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_LUNAR_DEVICE"
-mkdir -p wearable_build
-pushd wearable_build
-cmake .. -DCMAKE_INSTALL_PREFIX=/usr/wearable -DTIZEN_PROFILE_WEARABLE=1 -DTIZEN_FEATURE_BT_HFP_AG=1
-make VERBOSE=1
-popd
-
-
-# Build IVI
-# TODO: BT-Agent Developers, Please Check if TIZEN_KIRAN is really need for ALL NON-WEARABLES.
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_KIRAN_DEVICE"
-export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
-mkdir -p ivi_build
-pushd ivi_build
-cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ivi -DTIZEN_PROFILE_WEARABLE=0 -DTIZEN_PROFILE_IVI=1 -DTIZEN_FEATURE_BT_HFP_AG=1
-make VERBOSE=1
-popd
-
-%endif
-
-
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-# Original: common, mobile, tv. Added: "undefined"
-
-# Build All Others (common/tv/mobile)
-# TODO: BT-Agent Developers, Please Check if TIZEN_KIRAN is really need for ALL NON-WEARABLES.
-export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_KIRAN_DEVICE"
-mkdir -p common_build
-pushd common_build
-cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_PROFILE_WEARABLE=0 -DTIZEN_FEATURE_BT_HFP_AG=1
+# Build All (wearalbe/ivi/common/tv/mobile)
+cmake . -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_FEATURE_BT_HFP_AG=1
 make VERBOSE=1
-popd
-
-%endif
 
 %install
 rm -rf %{buildroot}
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
-# Original: wearable, ivi. Added: common, "undefined"
-pushd wearable_build
-%make_install
-popd
-pushd ivi_build
-%make_install
-popd
-%endif
-
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-# Original: common, mobile, tv. Added: "undefined"
-pushd common_build
 %make_install
-popd
-%endif
 
 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service
 # This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
+#%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
 # Original: wearable, ivi. Added: common, "undefined"
-mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
-mkdir -p %{buildroot}%{_bindir}/
-install -D -m 0644 %{buildroot}/usr/wearable/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
-install -D -m 0644 %{buildroot}/usr/wearable/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
-install -D -m 0644 %{buildroot}/usr/wearable/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
-install -D -m 0644 %{buildroot}/usr/wearable/bin/bt-ipsp %{buildroot}%{_bindir}/
-install -D -m 0644 %{buildroot}/usr/ivi/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
-install -D -m 0644 %{buildroot}/usr/ivi/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/bluetooth-hf-agent.ivi
-install -D -m 0644 %{buildroot}/usr/ivi/bin/bt-ipsp %{buildroot}%{_bindir}/
-rm -Rf %{buildroot}/usr/ivi
-rm -Rf %{buildroot}/usr/wearable
-%endif
+#mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
+#mkdir -p %{buildroot}%{_bindir}/
+#install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
+#install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
+#install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
+#install -D -m 0644 %{buildroot}/usr/bin/bt-ipsp %{buildroot}%{_bindir}/
+#%endif
 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
 
 %post
@@ -205,15 +145,6 @@ ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/system
 %endif
 ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
 
-# This usage of profile macro does NOT conflict 4.0 configurability.
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
-# Original: wearable, ivi. Added: common, "undefined"
-%post profile_ivi
-ln -sf bluetooth-hf-agent.ivi %{_bindir}/bluetooth-hf-agent
-%preun profile_ivi
-rm %{_bindir}/bluetooth-hf-agent
-%endif
-
 %files
 %manifest %{name}.manifest
 %license LICENSE
@@ -231,14 +162,14 @@ rm %{_bindir}/bluetooth-hf-agent
 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
+%endif
 
 %files profile_ivi
 %license LICENSE
-%{_bindir}/bluetooth-hf-agent.ivi
+%{_bindir}/bluetooth-hf-agent
 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
-%endif
 
 # This usage of profile macro does NOT conflict 4.0 configurability.
 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
index 8e64ce7..fb2b4ed 100644 (file)
@@ -1,14 +1,16 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(bluetooth-pb-agent C)
 
-SET(SRCS bluetooth_pb_agent.c bluetooth_pb_vcard.c)
+SET(SRCS bluetooth_pb_agent.c bluetooth_pb_vcard.c
+       ../include/bluetooth-agent-profile.c)
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs_pb_agent
                REQUIRED
-               gio-2.0 dlog contacts-service2 tapi vconf capi-media-image-util libexif)
+               gio-2.0 dlog contacts-service2 tapi vconf capi-media-image-util libexif
+               capi-system-info)
 
 FOREACH(flag ${pkgs_pb_agent_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")