1514011f939e1a3eb8b578cf1a2bde6568b7bb60
[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.1
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 BuildRequires:  pkgconfig(aul)
13 BuildRequires:  pkgconfig(bluetooth-api)
14 %if "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
15 BuildRequires:  pkgconfig(alarm-service)
16 BuildRequires:  pkgconfig(capi-appfw-app-manager)
17 BuildRequires:  pkgconfig(capi-system-device)
18 %else
19 BuildRequires:  pkgconfig(contacts-service2)
20 BuildRequires:  pkgconfig(msg-service)
21 BuildRequires:  pkgconfig(email-service)
22 %endif
23 BuildRequires:  pkgconfig(capi-system-info)
24 BuildRequires:  pkgconfig(dbus-glib-1)
25 BuildRequires:  pkgconfig(tapi)
26 BuildRequires:  pkgconfig(dlog)
27 BuildRequires:  pkgconfig(vconf)
28 BuildRequires:  pkgconfig(appsvc)
29 BuildRequires:  pkgconfig(capi-appfw-application)
30 BuildRequires:  pkgconfig(capi-media-image-util)
31 BuildRequires:  pkgconfig(contacts-service2)
32 BuildRequires:  pkgconfig(libexif)
33 BuildRequires:  pkgconfig(gio-2.0)
34 BuildRequires:  cmake
35 Requires: security-config
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 %ifarch aarch64
52 echo arch64
53 export CFLAGS+=" -DARCH64"
54 export CXXFLAGS+=" -DARCH64"
55 export FFLAGS+=" -DARCH64"
56 %endif
57
58 %ifarch x86_64
59 echo x86_64
60 export CFLAGS+=" -DARCH64"
61 export CXXFLAGS+=" -DARCH64"
62 export FFLAGS+=" -DARCH64"
63 %endif
64
65 %if "%{?profile}" == "wearable"
66 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
67 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_LUNAR_DEVICE"
68 %else
69 export CFLAGS="$CFLAGS -DTIZEN_KIRAN"
70 %endif
71
72 %if "%{?profile}" == "ivi"
73 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
74 %endif
75
76 export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE -fvisibility=hidden "
77 export CXXFLAGS+=" -fpie -DPBAP_SIM_ENABLE -fvisibility=hidden "
78
79 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
80
81 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
82 %if "%{?profile}" == "wearable"
83         -DTIZEN_WEARABLE=1 \
84 %else
85         -DTIZEN_WEARABLE=0 \
86 %endif
87 %if "%{?profile}" == "ivi"
88         -DTIZEN_PROFILE_IVI=1 \
89 %endif
90         -DTIZEN_BT_HFP_AG_ENABLE=1
91
92 make VERBOSE=1
93
94 %install
95 rm -rf %{buildroot}
96 %make_install
97
98 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
99 #mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
100 #%if "%{?profile}" != "wearable"
101 #install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
102 #ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
103 #%endif
104 #%if 0%{?sec_product_feature_bt_map_server_enable}
105 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service
106 #%endif
107
108
109 %post
110 %if 0%{?sec_product_feature_bt_map_server_enable}
111 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
112 %endif
113
114 %files
115 %manifest %{name}.manifest
116 %defattr(-, root, root)
117 %if "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
118 %{_bindir}/bluetooth-hf-agent
119 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
120 %exclude %{_libdir}/systemd/user/bluetooth-map-agent.service
121 %else
122 %{_bindir}/bluetooth-ag-agent
123 %{_bindir}/bluetooth-map-agent
124 %{_bindir}/bluetooth-pb-agent
125 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
126 %{_datadir}/dbus-1/services/org.bluez.map_agent.service
127 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
128 #%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
129 #%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
130 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
131 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
132 %{_libdir}/systemd/user/bluetooth-map-agent.service
133 %endif
134 %{_datadir}/license/bluetooth-agent