Use systemd user session instead of dbus user session
[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 BuildRequires:  pkgconfig(email-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(contacts-service2)
36 BuildRequires:  pkgconfig(libexif)
37 BuildRequires:  pkgconfig(gio-2.0)
38 BuildRequires:  cmake
39 Requires: security-config
40
41 %description
42 Bluetooth agent packages that support various external profiles
43
44 %prep
45 %setup -q
46 cp %{SOURCE1001} .
47
48 %build
49 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
50 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
51 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
52 export CFLAGS="$CFLAGS -DTIZEN_MEDIA_ENHANCE"
53 export CFLAGS="$CFLAGS -DTIZEN_BT_HFP_AG_ENABLE"
54
55 %ifarch aarch64
56 echo arch64
57 export CFLAGS+=" -DARCH64"
58 export CXXFLAGS+=" -DARCH64"
59 export FFLAGS+=" -DARCH64"
60 %endif
61
62 %ifarch x86_64
63 echo x86_64
64 export CFLAGS+=" -DARCH64"
65 export CXXFLAGS+=" -DARCH64"
66 export FFLAGS+=" -DARCH64"
67 %endif
68
69 %if "%{?profile}" == "wearable"
70 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
71 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_LUNAR_DEVICE"
72 %else
73 export CFLAGS="$CFLAGS -DTIZEN_KIRAN"
74 %endif
75
76 export CFLAGS+=" -fpie -DPBAP_SIM_ENABLE"
77
78 export CFLAGS+=" -fpie -fvisibility=hidden"
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         -DTIZEN_BT_HFP_AG_ENABLE=1
88
89 make VERBOSE=1
90
91 %install
92 rm -rf %{buildroot}
93 %make_install
94
95 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
96 #mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
97 #%if "%{?profile}" != "wearable"
98 #install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
99 #ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
100 #%endif
101 #%if 0%{?sec_product_feature_bt_map_server_enable}
102 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service
103 #%endif
104
105
106 %post
107 %if 0%{?sec_product_feature_bt_map_server_enable}
108 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
109 %endif
110
111 %files
112 %manifest %{name}.manifest
113 %defattr(-, root, root)
114 %if "%{?profile}" == "wearable"
115 %{_bindir}/bluetooth-hf-agent
116 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
117 %else
118 %{_bindir}/bluetooth-ag-agent
119 %{_bindir}/bluetooth-map-agent
120 %{_bindir}/bluetooth-pb-agent
121 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
122 %{_datadir}/dbus-1/services/org.bluez.map_agent.service
123 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
124 #%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
125 #%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
126 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
127 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
128 %{_libdir}/systemd/user/bluetooth-map-agent.service
129 %endif
130 %{_datadir}/license/bluetooth-agent