GDBus Migration of MAP Agent
[platform/core/connectivity/bluetooth-agent.git] / packaging / bluetooth-agent.spec
1 %define _usrlibdir /usr/lib
2
3 Name:       bluetooth-agent
4 Summary:    Bluetooth agent packages that support various external profiles
5 Version:    0.1.0
6 Release:    1
7 Group:      Network & Connectivity/Bluetooth
8 License:    Apache-2.0
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001:     bluetooth-agent.manifest
11
12 %if "%{?profile}" == "tv"
13 ExcludeArch: %{arm} %ix86 x86_64
14 %endif
15
16 BuildRequires:  pkgconfig(aul)
17 BuildRequires:  pkgconfig(bluetooth-api)
18 %if "%{?profile}" == "wearable"
19 BuildRequires:  pkgconfig(alarm-service)
20 BuildRequires:  pkgconfig(capi-appfw-app-manager)
21 BuildRequires:  pkgconfig(capi-system-device)
22 %else
23 BuildRequires:  pkgconfig(contacts-service2)
24 BuildRequires:  pkgconfig(msg-service)
25 %endif
26 BuildRequires:  pkgconfig(capi-system-info)
27 BuildRequires:  pkgconfig(dbus-glib-1)
28 BuildRequires:  pkgconfig(email-service)
29 BuildRequires:  pkgconfig(tapi)
30 BuildRequires:  pkgconfig(dlog)
31 BuildRequires:  pkgconfig(vconf)
32 BuildRequires:  pkgconfig(appsvc)
33 BuildRequires:  pkgconfig(capi-appfw-application)
34 BuildRequires:  pkgconfig(capi-media-image-util)
35 BuildRequires:  pkgconfig(libexif)
36 BuildRequires:  pkgconfig(gio-2.0)
37 BuildRequires:  cmake
38 Requires: security-config
39
40 %description
41 Bluetooth agent packages that support various external profiles
42
43 %prep
44 %setup -q
45 cp %{SOURCE1001} .
46
47 %build
48 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
49 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
50 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
51 export CFLAGS="$CFLAGS -DTIZEN_MEDIA_ENHANCE"
52 export CFLAGS="$CFLAGS -DTIZEN_BT_HFP_AG_ENABLE"
53
54 %if "%{?profile}" == "wearable"
55 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
56 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_LUNAR_DEVICE"
57 %else
58 export CFLAGS="$CFLAGS -DTIZEN_KIRAN"
59 %endif
60
61 export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE"
62
63 export CFLAGS+=" -fpie -fvisibility=hidden"
64 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
65
66 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
67 %if "%{?profile}" == "wearable"
68         -DTIZEN_WEARABLE=1 \
69 %else
70         -DTIZEN_WEARABLE=0 \
71 %endif
72         -DTIZEN_BT_HFP_AG_ENABLE=1
73
74 make VERBOSE=1
75
76 %install
77 rm -rf %{buildroot}
78 %make_install
79
80 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
81 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
82 #%if "%{?profile}" != "wearable"
83 #install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
84 #ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
85 #%endif
86 %if 0%{?sec_product_feature_bt_map_server_enable}
87 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service
88 %endif
89
90
91 %post
92 %if 0%{?sec_product_feature_bt_map_server_enable}
93 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
94 %endif
95
96 %files
97 %manifest %{name}.manifest
98 %defattr(-, root, root)
99 %if "%{?profile}" == "wearable"
100 %{_bindir}/bluetooth-hf-agent
101 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
102 %else
103 %{_bindir}/bluetooth-ag-agent
104 %{_bindir}/bluetooth-map-agent
105 %{_bindir}/bluetooth-pb-agent
106 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
107 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
108 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
109 #%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
110 #%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
111 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
112 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
113 %endif
114 %{_datadir}/license/bluetooth-agent