Stop supporting wpasupplicant socket plugin
[platform/core/connectivity/wifi-direct-manager.git] / packaging / wifi-direct-manager.spec
1 # Do not provide .so automatically for the extensions.
2 # This if statement is for backward compatibility with GBM/Obsolete build systems
3 %if "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
4 %global __provides_exclude_from ^.*\\.(wearable|mobile|tm1|tv|ivi|common)$
5 %endif
6
7 %define upgrade_script_path /usr/share/upgrade/scripts
8
9 Name:           wifi-direct-manager
10 Summary:        Wi-Fi Direct manger
11 Version:        1.2.227
12 Release:        1
13 Group:      Network & Connectivity/Wireless
14 License:    Apache-2.0
15 Source0:        %{name}-%{version}.tar.gz
16 Source1:        dbus-wfd-manager.conf
17 Source2:        net.wifidirect.service
18 Source3:        wifi-direct-manager.service
19 Source4:        500.wifi-direct-manager_upgrade.sh
20 BuildRequires:  pkgconfig(capi-network-wifi-direct)
21 BuildRequires:  pkgconfig(gio-2.0)
22 BuildRequires:  pkgconfig(dlog)
23 BuildRequires:  pkgconfig(vconf)
24 BuildRequires:  pkgconfig(libnl-2.0)
25 BuildRequires:  pkgconfig(dbus-1)
26 BuildRequires:  pkgconfig(aul)
27 BuildRequires:  pkgconfig(capi-system-info)
28
29 BuildRequires:  pkgconfig(capi-appfw-application)
30 BuildRequires:  pkgconfig(libsystemd-login)
31
32 BuildRequires: pkgconfig(libtzplatform-config)
33
34 BuildRequires:  cmake
35 #BuildRequires:  model-build-features
36 Requires:       net-tools
37 #Requires:      sys-assert
38 #Requires:      tizen-coreutils
39 Requires:       %{name}-compat = %{version}-%{release}
40 Recommends:     %{name}-profile_common = %{version}-%{release}
41
42 Requires: toybox-symlinks-dhcpd
43 Requires: toybox-symlinks-dhcp
44
45 %description
46 Manager for handling wifi-direct functionalities
47
48 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
49 # if common || ivi || "undefined"
50 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
51 %package profile_common
52 Summary:        Wi-Fi Direct manger for common/ivi
53 Provides:       %{name}-compat = %{version}-%{release}
54 Provides:       %{name}-profile_ivi = %{version}-%{release}
55 Conflicts:      %{name}-profile_mobile
56 Conflicts:      %{name}-profile_wearable
57 Conflicts:      %{name}-profile_tv
58 %description profile_common
59 Manager for handling wifi-direct functionalities for common/ivi
60 %endif
61
62 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
63 # if mobile || "undefined"
64 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
65 %package profile_mobile
66 Summary:        Wi-Fi Direct manger for mobile
67 Provides:       %{name}-compat = %{version}-%{release}
68 Conflicts:      %{name}-profile_common
69 Conflicts:      %{name}-profile_wearable
70 Conflicts:      %{name}-profile_tv
71 %description profile_mobile
72 Manager for handling wifi-direct functionalities for mobile
73
74 %ifarch %{arm}
75 %package extension-TM1
76 Summary:        Extension for mobile TM1
77 Requires:       %{name}-profile_mobile = %{version}-%{release}
78 %description extension-TM1
79 Manager for handling wifi-direct functionalities for mobile TM1
80 %endif
81 %endif
82
83 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
84 # if wearable || "undefined"
85 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
86 %package profile_wearable
87 Summary:        Wi-Fi Direct manger for wearable
88 Provides:       %{name}-compat = %{version}-%{release}
89 Conflicts:      %{name}-profile_common
90 Conflicts:      %{name}-profile_mobile
91 Conflicts:      %{name}-profile_tv
92 %description profile_wearable
93 Manager for handling wifi-direct functionalities for wearable
94 %endif
95
96 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
97 # if tv || "undefined"
98 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
99 %package profile_tv
100 Summary:        Wi-Fi Direct manger for tv
101 Provides:       %{name}-compat = %{version}-%{release}
102 Conflicts:      %{name}-profile_common
103 Conflicts:      %{name}-profile_mobile
104 Conflicts:      %{name}-profile_wearable
105 %description profile_tv
106 Manager for handling wifi-direct functionalities for tv
107 %endif
108
109 %package -n wifi-direct-plugin-wpasupplicant
110 Summary:    Wifi direct plugin for wpa supplicant
111 Group:      Network & Connectivity/Wireless
112 Requires:   %{name} = %{version}-%{release}
113 %description -n wifi-direct-plugin-wpasupplicant
114 Wi-Fi direct manager plugin to abstract wpa_supplicant
115
116 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
117 # if common || ivi || "undefined"
118 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
119 %package -n wifi-direct-plugin-wpasupplicant-profile_common
120 Summary:    Wifi direct plugin for wpa supplicant for common/ivi
121 Group:      Network & Connectivity/Wireless
122 Requires:   wifi-direct-plugin-wpasupplicant = %{version}-%{release}
123 %description -n wifi-direct-plugin-wpasupplicant-profile_common
124 Wi-Fi direct manager plugin to abstract wpa_supplicant for common/ivi
125 %endif
126
127 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
128 # if mobile || "undefined"
129 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
130 %package -n wifi-direct-plugin-wpasupplicant-profile_mobile
131 Summary:    Wifi direct plugin for wpa supplicant for mobile
132 Group:      Network & Connectivity/Wireless
133 Requires:   wifi-direct-plugin-wpasupplicant = %{version}-%{release}
134 %description -n wifi-direct-plugin-wpasupplicant-profile_mobile
135 Wi-Fi direct manager plugin to abstract wpa_supplicant for mobile
136
137 %ifarch %{arm}
138 %package -n wifi-direct-plugin-wpasupplicant-extension-TM1
139 Summary:    Wifi direct plugin for wpa supplicant for mobile TM1
140 Group:      Network & Connectivity/Wireless
141 Requires:   wifi-direct-plugin-wpasupplicant-profile_mobile = %{version}-%{release}
142 %description -n wifi-direct-plugin-wpasupplicant-extension-TM1
143 Wi-Fi direct manager plugin to abstract wpa_supplicant for mobile TM1
144 %endif
145 %endif
146
147 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
148 # if wearable || "undefined"
149 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
150 %package -n wifi-direct-plugin-wpasupplicant-profile_wearable
151 Summary:    Wifi direct plugin for wpa supplicant for wearable
152 Group:      Network & Connectivity/Wireless
153 Requires:   wifi-direct-plugin-wpasupplicant = %{version}-%{release}
154 %description -n wifi-direct-plugin-wpasupplicant-profile_wearable
155 Wi-Fi direct manager plugin to abstract wpa_supplicant for wearable
156 %endif
157
158 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
159 # if tv || "undefined"
160 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
161 %package -n wifi-direct-plugin-wpasupplicant-profile_tv
162 Summary:    Wifi direct plugin for wpa supplicant for tv
163 Group:      Network & Connectivity/Wireless
164 Requires:   wifi-direct-plugin-wpasupplicant = %{version}-%{release}
165 %description -n wifi-direct-plugin-wpasupplicant-profile_tv
166 Wi-Fi direct manager plugin to abstract wpa_supplicant for tv
167 %endif
168
169 #%package -n wifi-direct-prd-plugin-wpasupplicant
170 #Summary:    Wifi direct prd plugin for wpa supplicant
171 #Group:      Network & Connectivity/Wireless
172 #Requires:   %{name} = %{version}-%{release}
173 #%description -n wifi-direct-prd-plugin-wpasupplicant
174 #Wi-Fi direct manager prd plugin to abstract wpa_supplicant
175
176 %prep
177 %setup -q
178 chmod 644 %{SOURCE0}
179 chmod 644 %{SOURCE1}
180 chmod 644 %{SOURCE2}
181 chmod 644 %{SOURCE3}
182 chmod 755 %{SOURCE4}
183 cp -a %{SOURCE1} ./wfd-manager.conf
184 cp -a %{SOURCE2} .
185 cp -a %{SOURCE3} .
186 cp -a %{SOURCE4} .
187
188 %build
189
190 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
191 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
192 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
193
194 %ifarch %{arm}
195 export ARCH=arm
196 %else
197
198 %if 0%{?simulator}
199 export ARCH=emul
200 %else
201 export ARCH=i586
202 %endif
203
204 %endif
205
206 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
207 # if mobile || "undefined"
208 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
209 mkdir -p build_mobile
210 pushd build_mobile
211 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
212         -DTIZEN_ENABLE_PRD=0 \
213 %if 0%{?model_build_feature_wlan_concurrent_mode}
214         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
215 %endif
216 %if ! 0%{?model_build_feature_network_tethering_disable}
217         -DTIZEN_TETHERING_ENABLE=0 \
218 %endif
219         -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
220         -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
221         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
222         -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
223         -DTIZEN_FEATURE_DEFAULT_CONNECTION_AGENT=1 \
224         -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
225         -DTIZEN_DEBUG_DBUS_VALUE=1 \
226         -DTIZEN_PROFILE_MOBILE=1 \
227         -DTIZEN_FEATURE_ASP=1 \
228 %if "%{?_lib}" == "lib64"
229         -DTIZEN_ARCH_64=1 \
230 %endif
231         -DLIB_DIR=%{_libdir} \
232         -DBIN_DIR=%{_bindir} \
233         -DSBIN_DIR=%{_sbindir} \
234         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
235         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
236         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
237         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
238
239 make %{?_smp_mflags}
240 popd
241
242 %ifarch %{arm}
243 mkdir -p build_tm1
244 pushd build_tm1
245 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
246         -DTIZEN_ENABLE_PRD=0 \
247 %if 0%{?model_build_feature_wlan_concurrent_mode}
248         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
249 %endif
250 %if ! 0%{?model_build_feature_network_tethering_disable}
251         -DTIZEN_TETHERING_ENABLE=0 \
252 %endif
253         -DTIZEN_WLAN_BOARD_SPRD=1 \
254         -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
255         -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
256         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
257         -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
258         -DTIZEN_FEATURE_DEFAULT_CONNECTION_AGENT=1 \
259         -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
260         -DTIZEN_DEBUG_DBUS_VALUE=1 \
261         -DTIZEN_PROFILE_MOBILE=1 \
262         -DTIZEN_FEATURE_ASP=1 \
263 %if "%{?_lib}" == "lib64"
264         -DTIZEN_ARCH_64=1 \
265 %endif
266         -DLIB_DIR=%{_libdir} \
267         -DBIN_DIR=%{_bindir} \
268         -DSBIN_DIR=%{_sbindir} \
269         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
270         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
271         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
272         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
273
274 make %{?_smp_mflags}
275 popd
276 %endif
277 %endif
278
279 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
280 # if wearable || "undefined"
281 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
282 mkdir -p build_wearable
283 pushd build_wearable
284 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
285         -DTIZEN_ENABLE_PRD=0 \
286 %if 0%{?model_build_feature_wlan_concurrent_mode}
287         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
288 %endif
289 %if ! 0%{?model_build_feature_network_tethering_disable}
290         -DTIZEN_TETHERING_ENABLE=0 \
291 %endif
292         -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
293         -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
294         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
295         -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
296         -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
297         -DTIZEN_DEBUG_DBUS_VALUE=1 \
298         -DTIZEN_PROFILE_COMMON=1 \
299 %if "%{?_lib}" == "lib64"
300         -DTIZEN_ARCH_64=1 \
301 %endif
302         -DLIB_DIR=%{_libdir} \
303         -DBIN_DIR=%{_bindir} \
304         -DSBIN_DIR=%{_sbindir} \
305         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
306         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
307         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
308         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
309
310 make %{?_smp_mflags}
311 popd
312 %endif
313
314 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
315 # if tv || "undefined"
316 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
317 mkdir -p build_tv
318 pushd build_tv
319 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
320         -DTIZEN_ENABLE_PRD=0 \
321 %if 0%{?model_build_feature_wlan_concurrent_mode}
322         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
323 %endif
324 %if ! 0%{?model_build_feature_network_tethering_disable}
325         -DTIZEN_TETHERING_ENABLE=0 \
326 %endif
327         -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
328         -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
329         -DTIZEN_WLAN_CONCURRENT_ENABLE=0 \
330         -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
331         -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
332         -DTIZEN_DEBUG_DBUS_VALUE=1 \
333         -DTIZEN_WIFI_MODULE_BUNDLE=0 \
334         -DTIZEN_PROFILE_TV=1 \
335 %if "%{?_lib}" == "lib64"
336         -DTIZEN_ARCH_64=1 \
337 %endif
338         -DLIB_DIR=%{_libdir} \
339         -DBIN_DIR=%{_bindir} \
340         -DSBIN_DIR=%{_sbindir} \
341         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
342         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
343         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
344         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
345
346 make %{?_smp_mflags}
347 popd
348 %endif
349
350 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
351 # if common || ivi || "undefined"
352 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
353 # common
354 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
355         -DTIZEN_ENABLE_PRD=0 \
356 %if 0%{?model_build_feature_wlan_concurrent_mode}
357         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
358 %endif
359 %if ! 0%{?model_build_feature_network_tethering_disable}
360         -DTIZEN_TETHERING_ENABLE=0 \
361 %endif
362         -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
363         -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
364         -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
365         -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
366         -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
367         -DTIZEN_DEBUG_DBUS_VALUE=1 \
368         -DTIZEN_PROFILE_COMMON=1 \
369 %if "%{?_lib}" == "lib64"
370         -DTIZEN_ARCH_64=1 \
371 %endif
372 -DLIB_DIR=%{_libdir} \
373 -DBIN_DIR=%{_bindir} \
374 -DSBIN_DIR=%{_sbindir} \
375 -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
376 -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
377 -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
378 -DTZ_SYS_RUN=%{TZ_SYS_RUN}
379
380 make %{?_smp_mflags}
381 %endif
382
383
384 %install
385 rm -rf %{buildroot}
386
387 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
388 # if mobile || "undefined"
389 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
390 pushd build_mobile
391 %make_install
392 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.mobile
393 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.mobile
394 popd
395
396 %ifarch %{arm}
397 pushd build_tm1
398 %make_install
399 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.tm1
400 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.tm1
401 popd
402 %endif
403 %endif
404
405 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
406 # if wearable || "undefined"
407 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
408 pushd build_wearable
409 %make_install
410 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.wearable
411 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.wearable
412 popd
413 %endif
414
415 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
416 # if tv || "undefined"
417 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
418 pushd build_tv
419 %make_install
420 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.tv
421 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.tv
422 popd
423 %endif
424
425 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
426 # if common || ivi || "undefined"
427 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
428 %make_install
429 %endif
430
431 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
432 cp wfd-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/wfd-manager.conf
433 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
434 cp net.wifidirect.service %{buildroot}%{_datadir}/dbus-1/system-services/net.wifidirect.service
435 mkdir -p %{buildroot}%{_libdir}/systemd/system/
436 cp wifi-direct-manager.service %{buildroot}%{_libdir}/systemd/system/wifi-direct-manager.service
437 %if "%{?_lib}" == "lib64"
438 mkdir -p %{buildroot}%{_unitdir}
439 cp wifi-direct-manager.service %{buildroot}%{_unitdir}/wifi-direct-manager.service
440 %endif
441 mkdir -p %{buildroot}%{upgrade_script_path}
442 cp -f 500.wifi-direct-manager_upgrade.sh %{buildroot}%{upgrade_script_path}
443
444 %post
445 chmod 644 %{TZ_SYS_RO_ETC}/wifi-direct/dhcpd.conf
446 chmod 755 %{_bindir}/dhcpd-notify.sh
447 chmod 755 %{TZ_SYS_RO_ETC}/wifi-direct/udhcp_script.non-autoip
448 chmod 755 %{_bindir}/wifi-direct-server.sh
449 chmod 755 %{_bindir}/wifi-direct-dhcp.sh
450 chmod 755 %{_sbindir}/p2p_supp.sh
451
452 if [ ! -d %{TZ_SYS_VAR}/lib/misc ]; then
453         mkdir -p %{TZ_SYS_VAR}/lib/misc
454 fi
455
456 touch %{TZ_SYS_VAR}/lib/misc/dhcpd.leases
457 chmod 666 %{TZ_SYS_VAR}/lib/misc/dhcpd.leases
458
459 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
460 # if mobile || "undefined"
461 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
462 %post profile_mobile
463 pushd %{_bindir}
464 ln -sf wfd-manager.mobile wfd-manager
465 popd
466 %preun profile_mobile
467 case "$1" in
468   0)
469     # This is an un-installation.
470         rm %{_bindir}/wfd-manager
471   ;;
472   1)
473     # This is an upgrade.
474     # Do nothing.
475     :
476   ;;
477 esac
478
479 %post -n wifi-direct-plugin-wpasupplicant-profile_mobile
480 pushd %{_libdir}
481 ln -sf wifi-direct-plugin-wpasupplicant.so.mobile wifi-direct-plugin-wpasupplicant.so
482 popd
483 /sbin/ldconfig
484
485 %preun -n wifi-direct-plugin-wpasupplicant-profile_mobile
486 case "$1" in
487   0)
488     # This is an un-installation.
489         rm %{_libdir}/wifi-direct-plugin-wpasupplicant.so
490         /sbin/ldconfig
491   ;;
492   1)
493     # This is an upgrade.
494     # Do nothing.
495     :
496   ;;
497 esac
498
499 %ifarch %{arm}
500 %post extension-TM1
501 pushd %{_bindir}
502 ln -sf wfd-manager.tm1 wfd-manager
503 popd
504 %preun extension-TM1
505 case "$1" in
506   0)
507     # This is an un-installation.
508         rm %{_bindir}/wfd-manager
509   ;;
510   1)
511     # This is an upgrade.
512     # Do nothing.
513     :
514   ;;
515 esac
516
517 %post -n wifi-direct-plugin-wpasupplicant-extension-TM1
518 pushd %{_libdir}
519 ln -sf wifi-direct-plugin-wpasupplicant.so.tm1 wifi-direct-plugin-wpasupplicant.so
520 popd
521 /sbin/ldconfig
522
523 %preun -n wifi-direct-plugin-wpasupplicant-extension-TM1
524 case "$1" in
525   0)
526     # This is an un-installation.
527         pushd %{_libdir}
528         rm wifi-direct-plugin-wpasupplicant.so
529         popd
530   ;;
531   1)
532     # This is an upgrade.
533     # Do nothing.
534     :
535   ;;
536 esac
537
538 %endif
539 %endif //mobile
540
541 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
542 # if wearable || "undefined"
543 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
544 %post profile_wearable
545 pushd %{_bindir}
546 ln -sf wfd-manager.wearable wfd-manager
547 popd
548 %preun profile_wearable
549 case "$1" in
550   0)
551     # This is an un-installation.
552         rm %{_bindir}/wfd-manager
553   ;;
554   1)
555     # This is an upgrade.
556     # Do nothing.
557     :
558   ;;
559 esac
560
561 %post -n wifi-direct-plugin-wpasupplicant-profile_wearable
562 pushd %{_libdir}
563 ln -sf wifi-direct-plugin-wpasupplicant.so.wearable wifi-direct-plugin-wpasupplicant.so
564 popd
565 /sbin/ldconfig
566
567 %preun -n wifi-direct-plugin-wpasupplicant-profile_wearable
568 case "$1" in
569   0)
570     # This is an un-installation.
571         rm %{_libdir}/wifi-direct-plugin-wpasupplicant.so
572         /sbin/ldconfig
573   ;;
574   1)
575     # This is an upgrade.
576     # Do nothing.
577     :
578   ;;
579 esac
580 %endif
581
582 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
583 # if tv || "undefined"
584 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
585 %post profile_tv
586 pushd %{_bindir}
587 ln -sf wfd-manager.tv wfd-manager
588 popd
589 %preun profile_tv
590 case "$1" in
591   0)
592     # This is an un-installation.
593         rm %{_bindir}/wfd-manager
594   ;;
595   1)
596     # This is an upgrade.
597     # Do nothing.
598     :
599   ;;
600 esac
601
602 %post -n wifi-direct-plugin-wpasupplicant-profile_tv
603 pushd %{_libdir}
604 ln -sf wifi-direct-plugin-wpasupplicant.so.tv wifi-direct-plugin-wpasupplicant.so
605 popd
606 /sbin/ldconfig
607
608 %preun -n wifi-direct-plugin-wpasupplicant-profile_tv
609 case "$1" in
610   0)
611     # This is an un-installation.
612         rm %{_libdir}/wifi-direct-plugin-wpasupplicant.so
613         /sbin/ldconfig
614   ;;
615   1)
616     # This is an upgrade.
617     # Do nothing.
618     :
619   ;;
620 esac
621 %endif
622
623 %files
624 %manifest wifi-direct-manager.manifest
625 %license LICENSE
626 %defattr(-,network_fw,network_fw,-)
627 %config %{TZ_SYS_RO_ETC}/wifi-direct/ccode.conf
628 %config %{TZ_SYS_RO_ETC}/wifi-direct/dhcpd.conf
629 %config %{TZ_SYS_RO_ETC}/wifi-direct/p2p_supp.conf
630 %config %{_sysconfdir}/dbus-1/system.d/wfd-manager.conf
631 %attr(644,-,-) %{TZ_SYS_ETC}/p2p_supp.conf
632 %attr(755,-,-) %{_bindir}/dhcpd-notify.sh
633 %attr(755,-,-) %{_bindir}/wifi-direct-server.sh
634 %attr(755,-,-) %{_bindir}/wifi-direct-dhcp.sh
635 %attr(755,-,-) %{TZ_SYS_RO_ETC}/wifi-direct/udhcp_script.non-autoip
636 %attr(644,network_fw,network_fw) %{_datadir}/dbus-1/system-services/*
637 %attr(644,network_fw,network_fw) %{_libdir}/systemd/system/*
638 %if "%{?_lib}" == "lib64"
639 %{_unitdir}/wifi-direct-manager.service
640 %endif
641 %attr(755,-,-) %{_sbindir}/p2p_supp.sh
642 %{upgrade_script_path}/500.wifi-direct-manager_upgrade.sh
643
644 %files -n wifi-direct-plugin-wpasupplicant
645 %manifest wifi-direct-plugin-wpasupplicant.manifest
646 %license LICENSE
647 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
648 # if common || ivi || "undefined"
649 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
650 %defattr(-,network_fw,network_fw,-)
651 %{_libdir}/wifi-direct-plugin-wpasupplicant.so
652 %endif
653
654 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
655 # if common || ivi || "undefined"
656 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
657 %files profile_common
658 %defattr(-,network_fw,network_fw,-)
659 %{_bindir}/wfd-manager
660
661 %files -n wifi-direct-plugin-wpasupplicant-profile_common
662 # default .so files are housed in the main pkg.
663 %endif
664
665 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
666 # if mobile || "undefined"
667 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
668 %files profile_mobile
669 %defattr(-,network_fw,network_fw,-)
670 %{_bindir}/wfd-manager.mobile
671
672 %files -n wifi-direct-plugin-wpasupplicant-profile_mobile
673 %manifest wifi-direct-plugin-wpasupplicant.manifest
674 %defattr(-,network_fw,network_fw,-)
675 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.mobile
676
677 %ifarch %{arm}
678 %files extension-TM1
679 %defattr(-,network_fw,network_fw,-)
680 %{_bindir}/wfd-manager.tm1
681
682 %files -n wifi-direct-plugin-wpasupplicant-extension-TM1
683 %manifest wifi-direct-plugin-wpasupplicant.manifest
684 %defattr(-,network_fw,network_fw,-)
685 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.tm1
686 %endif
687 %endif
688
689 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
690 # if wearable || "undefined"
691 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
692 %files profile_wearable
693 %defattr(-,network_fw,network_fw,-)
694 %{_bindir}/wfd-manager.wearable
695
696 %files -n wifi-direct-plugin-wpasupplicant-profile_wearable
697 %manifest wifi-direct-plugin-wpasupplicant.manifest
698 %defattr(-,network_fw,network_fw,-)
699 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.wearable
700 %endif
701
702 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
703 # if tv || "undefined"
704 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
705 %files profile_tv
706 %defattr(-,network_fw,network_fw,-)
707 %{_bindir}/wfd-manager.tv
708
709 %files -n wifi-direct-plugin-wpasupplicant-profile_tv
710 %manifest wifi-direct-plugin-wpasupplicant.manifest
711 %defattr(-,network_fw,network_fw,-)
712 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.tv
713 %endif
714
715 #%files -n wifi-direct-prd-plugin-wpasupplicant
716 #%manifest wifi-direct-prd-plugin-wpasupplicant.manifest
717 #%license LICENSE
718 #%defattr(-,network_fw,network_fw,-)
719 #%{_libdir}/wifi-direct-prd-plugin-wpasupplicant.so