421d3cccf91f70e51a3f2be00389cc1a17f74ee1
[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.2
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-network-connection)
31 BuildRequires:  pkgconfig(capi-network-bluetooth)
32 BuildRequires:  pkgconfig(capi-media-image-util)
33 BuildRequires:  pkgconfig(contacts-service2)
34 BuildRequires:  pkgconfig(libexif)
35 BuildRequires:  pkgconfig(gio-2.0)
36 BuildRequires:  cmake
37 Requires: security-config
38
39 %description
40 Bluetooth agent packages that support various external profiles
41
42 %package ipsp
43 Summary:    Bluetooth Ipsp daemon
44 Group:      Network & Connectivity/Bluetooth
45 Requires:   %{name} = %{version}-%{release}
46
47 %description ipsp
48 This package is Bluetooth ipsp daemon to manage activation / deactivation.
49
50 %prep
51 %setup -q
52 cp %{SOURCE1001} .
53
54 %build
55 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
56 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
57 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
58 #export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_MEDIA_ENHANCE"
59 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HFP_AG"
60 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_DUAL_HF"
61
62 %ifarch aarch64
63 echo arch64
64 export CFLAGS+=" -DARCH64"
65 export CXXFLAGS+=" -DARCH64"
66 export FFLAGS+=" -DARCH64"
67 %endif
68
69 %ifarch x86_64
70 echo x86_64
71 export CFLAGS+=" -DARCH64"
72 export CXXFLAGS+=" -DARCH64"
73 export FFLAGS+=" -DARCH64"
74 %endif
75
76 %if "%{?profile}" == "wearable"
77 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_WEARABLE"
78 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_LUNAR_DEVICE"
79 %else
80 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_KIRAN_DEVICE"
81 %endif
82
83 %if "%{?profile}" == "ivi"
84 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
85 %endif
86
87 export CFLAGS+=" -fpie -DTIZEN_FEATURE_BT_PBAP_SIM -fvisibility=hidden "
88 export CXXFLAGS+=" -fpie -DTIZEN_FEATURE_BT_PBAP_SIM -fvisibility=hidden "
89
90 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
91
92 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
93 %if "%{?profile}" == "wearable"
94         -DTIZEN_PROFILE_WEARABLE=1 \
95 %else
96         -DTIZEN_PROFILE_WEARABLE=0 \
97 %endif
98 %if "%{?profile}" == "ivi"
99         -DTIZEN_PROFILE_IVI=1 \
100 %endif
101         -DTIZEN_FEATURE_BT_HFP_AG=1
102
103 make VERBOSE=1
104
105 %install
106 rm -rf %{buildroot}
107 %make_install
108
109 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-agent
110 #mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
111 #%if "%{?profile}" != "wearable"
112 #install -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/
113 #ln -s ../bluetooth-ag-agent.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-ag-agent.service
114 #%endif
115 #%if 0%{?sec_product_feature_bt_map_server_enable}
116 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service
117 #%endif
118 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
119
120 %post
121 %if 0%{?sec_product_feature_bt_map_server_enable}
122 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
123 %endif
124 ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
125
126 %files
127 %manifest %{name}.manifest
128 %defattr(-, root, root)
129 %if "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
130 %{_bindir}/bluetooth-hf-agent
131 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
132 %exclude %{_libdir}/systemd/user/bluetooth-map-agent.service
133 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
134 %else
135 %{_bindir}/bluetooth-ag-agent
136 %{_bindir}/bluetooth-map-agent
137 %{_bindir}/bluetooth-pb-agent
138 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
139 %{_datadir}/dbus-1/services/org.bluez.map_agent.service
140 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
141 #%{_usrlibdir}/systemd/system/bluetooth-ag-agent.service
142 #%{_usrlibdir}/systemd/system/multi-user.target.wants/bluetooth-ag-agent.service
143 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
144 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
145 %{_libdir}/systemd/user/bluetooth-map-agent.service
146 %{_libdir}/systemd/system/bluetooth-pbap-agent.service
147 %endif
148 %{_datadir}/license/bluetooth-agent
149
150 %files ipsp
151 %manifest %{name}.manifest
152 %defattr(-, root, root)
153 %{_datadir}/dbus-1/system-services/org.projectx.bt_ipsp.service
154 %{_bindir}/bt-ipsp
155 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-ipsp.conf