Remove trivial unnecessary build dependency
[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 BuildRequires:  pkgconfig(aul)
13 BuildRequires:  pkgconfig(bluetooth-api)
14 %if "%{?profile}" == "wearable"
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 export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE -fvisibility=hidden "
73 export CXXFLAGS+=" -fpie -DPBAP_SIM_ENABLE -fvisibility=hidden "
74
75 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
76
77 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
78 %if "%{?profile}" == "wearable"
79         -DTIZEN_WEARABLE=1 \
80 %else
81         -DTIZEN_WEARABLE=0 \
82 %endif
83         -DTIZEN_BT_HFP_AG_ENABLE=1
84
85 make VERBOSE=1
86
87 %install
88 rm -rf %{buildroot}
89 %make_install
90
91 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
92 #mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
93 #%if "%{?profile}" != "wearable"
94 #install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
95 #ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
96 #%endif
97 #%if 0%{?sec_product_feature_bt_map_server_enable}
98 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service
99 #%endif
100
101
102 %post
103 %if 0%{?sec_product_feature_bt_map_server_enable}
104 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
105 %endif
106
107 %files
108 %manifest %{name}.manifest
109 %defattr(-, root, root)
110 %if "%{?profile}" == "wearable"
111 %{_bindir}/bluetooth-hf-agent
112 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
113 %exclude %{_libdir}/systemd/user/bluetooth-map-agent.service
114 %else
115 %{_bindir}/bluetooth-ag-agent
116 %{_bindir}/bluetooth-map-agent
117 %{_bindir}/bluetooth-pb-agent
118 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
119 %{_datadir}/dbus-1/services/org.bluez.map_agent.service
120 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
121 #%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
122 #%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
123 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
124 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
125 %{_libdir}/systemd/user/bluetooth-map-agent.service
126 %endif
127 %{_datadir}/license/bluetooth-agent