Update AG and HF agent codes from wearable product
[platform/core/connectivity/bluetooth-agent.git] / packaging / bluetooth-agent.spec
index 64ac68f..937288c 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:       bluetooth-agent
 Summary:    Bluetooth agent packages that support various external profiles
-Version:    0.1.1
+Version:    0.1.3
 Release:    1
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
@@ -11,11 +11,21 @@ Source1001:         bluetooth-agent.manifest
 
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(bluetooth-api)
-%if "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
+
+# The profile macro usage with the following comments may be removed after
+# Tizen OBS build projects are merged. However, each vendor may keep using
+# such if/endif statement to skip building profiles not interested
+
+# This usage of profile macro does NOT conflict 4.0 configurability.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
+# Original: wearable, ivi. Added: common, "undefined"
 BuildRequires:  pkgconfig(alarm-service)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
 BuildRequires:  pkgconfig(capi-system-device)
-%else
+%endif
+# This usage of profile macro does NOT conflict 4.0 configurability.
+%if "%{?profile}" != "ivi"
+# Original: common, mobile, tv. Added: "undefined"
 BuildRequires:  pkgconfig(contacts-service2)
 BuildRequires:  pkgconfig(msg-service)
 BuildRequires:  pkgconfig(email-service)
@@ -23,20 +33,61 @@ BuildRequires:  pkgconfig(email-service)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(dbus-glib-1)
 BuildRequires:  pkgconfig(tapi)
+BuildRequires:  pkgconfig(capi-system-device)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(syspopup-caller)
+BuildRequires:  pkgconfig(capi-network-bluetooth)
 BuildRequires:  pkgconfig(appsvc)
 BuildRequires:  pkgconfig(capi-appfw-application)
+BuildRequires:  pkgconfig(capi-network-connection)
+BuildRequires:  pkgconfig(capi-network-bluetooth)
 BuildRequires:  pkgconfig(capi-media-image-util)
 BuildRequires:  pkgconfig(contacts-service2)
 BuildRequires:  pkgconfig(libexif)
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  cmake
 Requires: security-config
+Requires:      %{name}-compat = %{version}-%{release}
+Recommends:    %{name}-profile_common = %{version}-%{release}
 
 %description
 Bluetooth agent packages that support various external profiles
 
+%package profile_common
+Summary:       Bluetooth agent for common/tv/mobile
+Provides:      %{name}-compat = %{version}-%{release}
+Provides:      %{name}-profile_mobile = %{version}-%{release}
+Provides:      %{name}-profile_tv = %{version}-%{release}
+Conflicts:     %{name}-profile_ivi
+Conflicts:     %{name}-profile_wearable
+%description profile_common
+Bluetooth agent binary compiled for common, tv, mobile profiles
+
+%package profile_ivi
+Summary:       Bluetooth agent for ivi
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_common
+Conflicts:     %{name}-profile_wearable
+%description profile_ivi
+Bluetooth agent binary compiled for ivi profile
+
+%package profile_wearable
+Summary:       Bluetooth agent for wearable
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_common
+Conflicts:     %{name}-profile_ivi
+%description profile_wearable
+Bluetooth agent binary compiled for wearable profile
+
+%package ipsp
+Summary:    Bluetooth Ipsp daemon
+Group:      Network & Connectivity/Bluetooth
+Requires:   %{name} = %{version}-%{release}
+
+%description ipsp
+This package is Bluetooth ipsp daemon to manage activation / deactivation.
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -45,8 +96,9 @@ cp %{SOURCE1001} .
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-#export CFLAGS="$CFLAGS -DTIZEN_MEDIA_ENHANCE"
-export CFLAGS="$CFLAGS -DTIZEN_BT_HFP_AG_ENABLE"
+
+#export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_MEDIA_ENHANCE"
+#export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_DUAL_HF"
 
 %ifarch aarch64
 echo arch64
@@ -62,47 +114,31 @@ export CXXFLAGS+=" -DARCH64"
 export FFLAGS+=" -DARCH64"
 %endif
 
-%if "%{?profile}" == "wearable"
-export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
-export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_LUNAR_DEVICE"
-%else
-export CFLAGS="$CFLAGS -DTIZEN_KIRAN"
-%endif
-
-%if "%{?profile}" == "ivi"
-export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
-%endif
-
-export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE -fvisibility=hidden "
-export CXXFLAGS+=" -fpie -DPBAP_SIM_ENABLE -fvisibility=hidden "
+export CFLAGS+=" -fpie -DTIZEN_FEATURE_BT_PBAP_SIM -fvisibility=hidden "
+export CXXFLAGS+=" -fpie -DTIZEN_FEATURE_BT_PBAP_SIM -fvisibility=hidden "
 
 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
 
-cmake . -DCMAKE_INSTALL_PREFIX=/usr \
-%if "%{?profile}" == "wearable"
-        -DTIZEN_WEARABLE=1 \
-%else
-        -DTIZEN_WEARABLE=0 \
-%endif
-%if "%{?profile}" == "ivi"
-        -DTIZEN_PROFILE_IVI=1 \
-%endif
-        -DTIZEN_BT_HFP_AG_ENABLE=1
+export CFLAGS_DEFAULT="$CFLAGS"
 
+# Build All (wearalbe/ivi/common/tv/mobile)
+cmake . -DCMAKE_INSTALL_PREFIX=/usr
 make VERBOSE=1
 
 %install
 rm -rf %{buildroot}
 %make_install
 
-install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
-#mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
-#%if "%{?profile}" != "wearable"
-#install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
-#ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
-#%endif
-#%if 0%{?sec_product_feature_bt_map_server_enable}
-install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service
+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"
+# Original: wearable, ivi. Added: common, "undefined"
+#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
 
@@ -114,24 +150,54 @@ ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/sys
 
 %files
 %manifest %{name}.manifest
+%license LICENSE
 %defattr(-, root, root)
-%if "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
+
+# This usage of profile macro does NOT conflict 4.0 configurability.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
+# Original: wearable, ivi. Added: common, "undefined"
+%files profile_wearable
+%license LICENSE
+%{_bindir}/bluetooth-hf-agent
+%{_bindir}/bluetooth-ag-agent
+%{_bindir}/bluetooth-hid-agent
+%{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
+%{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
+%{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service
+%{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
+%{_sysconfdir}/dbus-1/system.d/bluetooth-hf-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
 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
-%exclude %{_libdir}/systemd/user/bluetooth-map-agent.service
+%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
-%else
+
+# This usage of profile macro does NOT conflict 4.0 configurability.
+%if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
+# Original: common, mobile, tv. Added: "undefined"
+%files profile_common
+%license LICENSE
 %{_bindir}/bluetooth-ag-agent
 %{_bindir}/bluetooth-map-agent
 %{_bindir}/bluetooth-pb-agent
 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
-%{_datadir}/dbus-1/services/org.bluez.map_agent.service
+%{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
-#%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
-#%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
-%{_libdir}/systemd/user/bluetooth-map-agent.service
+%{_libdir}/systemd/system/bluetooth-map-agent.service
 %{_libdir}/systemd/system/bluetooth-pbap-agent.service
 %endif
-%{_datadir}/license/bluetooth-agent
+
+%files ipsp
+%manifest %{name}.manifest
+%license LICENSE
+%defattr(-, root, root)
+%{_datadir}/dbus-1/system-services/org.projectx.bt_ipsp.service
+%{_bindir}/bt-ipsp
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-ipsp.conf