Modify installing directory path for blacklist file
[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(tapi)
29 BuildRequires:  pkgconfig(dlog)
30 BuildRequires:  pkgconfig(vconf)
31 BuildRequires:  pkgconfig(appsvc)
32 BuildRequires:  pkgconfig(capi-appfw-application)
33 BuildRequires:  pkgconfig(capi-media-image-util)
34 BuildRequires:  pkgconfig(libexif)
35 BuildRequires:  cmake
36
37 %description
38 Bluetooth agent packages that support various external profiles
39
40 %prep
41 %setup -q
42 cp %{SOURCE1001} .
43
44 %build
45 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
46 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
47 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
48 export CFLAGS="$CFLAGS -DTIZEN_MEDIA_ENHANCE"
49 export CFLAGS="$CFLAGS -DTIZEN_BT_HFP_AG_ENABLE"
50
51 %if "%{?profile}" == "wearable"
52 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
53 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_LUNAR_DEVICE"
54 %else
55 export CFLAGS="$CFLAGS -DTIZEN_KIRAN"
56 %endif
57
58 export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE"
59
60 export CFLAGS+=" -fpie -fvisibility=hidden"
61 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
62
63 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
64 %if "%{?profile}" == "wearable"
65         -DTIZEN_WEARABLE=1 \
66 %else
67         -DTIZEN_WEARABLE=0 \
68 %endif
69         -DTIZEN_BT_HFP_AG_ENABLE=1
70
71 make VERBOSE=1
72
73 %install
74 rm -rf %{buildroot}
75 %make_install
76
77 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
78 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
79 #%if "%{?profile}" != "wearable"
80 #install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
81 #ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
82 #%endif
83
84 %files
85 %manifest %{name}.manifest
86 %defattr(-, root, root)
87 %if "%{?profile}" == "wearable"
88 %{_bindir}/bluetooth-hf-agent
89 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
90 %else
91 %{_bindir}/bluetooth-ag-agent
92 %{_bindir}/bluetooth-map-agent
93 %{_bindir}/bluetooth-pb-agent
94 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
95 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
96 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
97 #%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
98 #%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
99 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
100 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
101 %endif
102 %{_datadir}/license/bluetooth-agent