Fix the build flag
[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 Requires(post): sys-assert
17 BuildRequires:  pkgconfig(aul)
18 BuildRequires:  pkgconfig(bluetooth-api)
19 %if "%{?profile}" == "wearable"
20 BuildRequires:  pkgconfig(alarm-service)
21 BuildRequires:  pkgconfig(capi-appfw-app-manager)
22 BuildRequires:  pkgconfig(capi-system-device)
23 %else
24 BuildRequires:  pkgconfig(contacts-service2)
25 BuildRequires:  pkgconfig(msg-service)
26 %endif
27 BuildRequires:  pkgconfig(capi-system-info)
28 BuildRequires:  pkgconfig(dbus-glib-1)
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:  cmake
37
38 %description
39 Bluetooth agent packages that support various external profiles
40
41 %prep
42 %setup -q
43 cp %{SOURCE1001} .
44
45 %build
46 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
47 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
48 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
49 export CFLAGS="$CFLAGS -DTIZEN_MEDIA_ENHANCE"
50 export CFLAGS="$CFLAGS -DTIZEN_BT_HFP_AG_ENABLE"
51
52 %if "%{?profile}" == "wearable"
53 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
54 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_LUNAR_DEVICE"
55 %else
56 export CFLAGS="$CFLAGS -DTIZEN_KIRAN"
57 %endif
58
59 export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE"
60
61 export CFLAGS+=" -fpie -fvisibility=hidden"
62 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
63
64 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
65 %if "%{?profile}" == "wearable"
66         -DTIZEN_WEARABLE=1 \
67 %else
68         -DTIZEN_WEARABLE=0 \
69 %endif
70         -DTIZEN_BT_HFP_AG_ENABLE=1
71
72 make VERBOSE=1
73
74 %install
75 rm -rf %{buildroot}
76 %make_install
77
78 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
79 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
80 %if "%{?profile}" != "wearable"
81 install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
82 ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
83 %endif
84
85 %files
86 %manifest %{name}.manifest
87 %defattr(-, root, root)
88 %if "%{?profile}" == "wearable"
89 %{_bindir}/bluetooth-hf-agent
90 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
91 %else
92 %{_bindir}/bluetooth-ag-agent
93 %{_bindir}/bluetooth-map-agent
94 %{_bindir}/bluetooth-pb-agent
95 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
96 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
97 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
98 %{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
99 %{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
100 %attr(0666,-,-) /opt/var/lib/bluetooth/voice-recognition-blacklist
101 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
102 %endif
103 %{_datadir}/license/bluetooth-agent