Refactory the packages for each functionality
[platform/core/connectivity/bluetooth-agent.git] / packaging / bluetooth-agent.spec
index dde49cf..9c80b8e 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:       bluetooth-agent
 Summary:    Bluetooth agent packages that support various external profiles
-Version:    0.1.2
+Version:    0.1.3
 Release:    1
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
@@ -31,49 +31,67 @@ BuildRequires:  pkgconfig(msg-service)
 BuildRequires:  pkgconfig(email-service)
 %endif
 BuildRequires:  pkgconfig(capi-system-info)
-BuildRequires:  pkgconfig(dbus-glib-1)
+BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(tapi)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 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}
+#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 hfp_ag
+Summary:       Bluetooth agent for HFP(Hands-Free Profile)'s AG(Audio Gate) role
+Requires:   %{name} = %{version}-%{release}
+Group:      Network & Connectivity/Bluetooth
+%description hfp_ag
+Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s AG(Audio Gate) role
+
+%package hfp_hf
+Summary:       Bluetooth agent for HFP(Hands-Free Profile)'s HF(Hands-Free) role
+Requires:   %{name} = %{version}-%{release}
+Group:      Network & Connectivity/Bluetooth
+%description hfp_hf
+Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s HF(Hands-Free) role
+
+%package map
+Summary:       Bluetooth agent for MAP(Message Access Profile) server
+Requires:   %{name} = %{version}-%{release}
+Group:      Network & Connectivity/Bluetooth
+%description map
+Bluetooth agent binary compiled for MAP(Message Access Profile) server
+
+%package pbap
+Summary:       Bluetooth agent for PBAP(PhoneBook Access Profile) server
+Requires:   %{name} = %{version}-%{release}
+Group:      Network & Connectivity/Bluetooth
+%description pbap
+Bluetooth agent binary compiled for PBAP(PhoneBook Access Profile) server
+
+%package hid
+Summary:       Bluetooth agent for HID(Human Interface Device)'s device role
+Requires:   %{name} = %{version}-%{release}
+Group:      Network & Connectivity/Bluetooth
+%description hid
+Bluetooth agent binary compiled for HID(Human Interface Device)'s device role
+
+%package ipsp
+Summary:       Bluetooth agent for IPSP(Internet Protocol Support Profile)
+Requires:   %{name} = %{version}-%{release}
+Group:      Network & Connectivity/Bluetooth
+%description ipsp
+Bluetooth agent binary compiled for IPSP(Internet Protocol Support Profile)
 
 %prep
 %setup -q
@@ -108,80 +126,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 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
-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"
+#%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
 # Original: wearable, ivi. Added: common, "undefined"
-mv %{buildroot}/usr/wearable/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
-mv %{buildroot}/usr/wearable/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
-mv %{buildroot}/usr/ivi/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/bluetooth-hf-agent.ivi
-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.bluez.ipsp_agent.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/bluetooth-ipsp-agent %{buildroot}%{_bindir}/
+#%endif
 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
 
 %post
@@ -190,48 +153,54 @@ 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
 %defattr(-, root, root)
-%{_datadir}/license/bluetooth-agent
 
-# 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
-%{_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-pbap-agent.service
+%files hfp_ag
+%manifest %{name}.manifest
+%license LICENSE
+%{_bindir}/bluetooth-ag-agent
+%attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
+%{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
+%{_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
 
-%files profile_ivi
-%{_bindir}/bluetooth-hf-agent.ivi
+%files hfp_hf
+%manifest %{name}.manifest
+%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-pbap-agent.service
-%endif
+%{_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
 
-# 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
-%{_bindir}/bluetooth-ag-agent
+%files map
+%manifest %{name}.manifest
+%license LICENSE
 %{_bindir}/bluetooth-map-agent
+%{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
+%{_libdir}/systemd/system/bluetooth-map-agent.service
+
+%files pbap
+%manifest %{name}.manifest
+%license LICENSE
 %{_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.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-pbap-agent.service
-%endif
+
+%files hid
+%manifest %{name}.manifest
+%license LICENSE
+%{_bindir}/bluetooth-hid-agent
+%{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service
+
+%files ipsp
+%manifest %{name}.manifest
+%license LICENSE
+%{_bindir}/bluetooth-ipsp-agent
+%{_datadir}/dbus-1/system-services/org.bluez.ipsp_agent.service
+%{_sysconfdir}/dbus-1/system.d/bluetooth-ipsp-agent.conf
+