Destroy session first, and destroy group later
[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.237
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_network_tethering_disable}
214         -DTIZEN_TETHERING_ENABLE=0 \
215 %endif
216         -DTIZEN_DEBUG_DBUS_VALUE=1 \
217         -DTIZEN_PROFILE_MOBILE=1 \
218 %if "%{?_lib}" == "lib64"
219         -DTIZEN_ARCH_64=1 \
220 %endif
221         -DLIB_DIR=%{_libdir} \
222         -DBIN_DIR=%{_bindir} \
223         -DSBIN_DIR=%{_sbindir} \
224         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
225         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
226         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
227         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
228
229 make %{?_smp_mflags}
230 popd
231
232 %ifarch %{arm}
233 mkdir -p build_tm1
234 pushd build_tm1
235 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
236         -DTIZEN_ENABLE_PRD=0 \
237 %if ! 0%{?model_build_feature_network_tethering_disable}
238         -DTIZEN_TETHERING_ENABLE=0 \
239 %endif
240         -DTIZEN_WLAN_BOARD_SPRD=1 \
241         -DTIZEN_DEBUG_DBUS_VALUE=1 \
242         -DTIZEN_PROFILE_MOBILE=1 \
243 %if "%{?_lib}" == "lib64"
244         -DTIZEN_ARCH_64=1 \
245 %endif
246         -DLIB_DIR=%{_libdir} \
247         -DBIN_DIR=%{_bindir} \
248         -DSBIN_DIR=%{_sbindir} \
249         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
250         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
251         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
252         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
253
254 make %{?_smp_mflags}
255 popd
256 %endif
257 %endif
258
259 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
260 # if wearable || "undefined"
261 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
262 mkdir -p build_wearable
263 pushd build_wearable
264 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
265         -DTIZEN_ENABLE_PRD=0 \
266 %if ! 0%{?model_build_feature_network_tethering_disable}
267         -DTIZEN_TETHERING_ENABLE=0 \
268 %endif
269         -DTIZEN_DEBUG_DBUS_VALUE=1 \
270         -DTIZEN_PROFILE_COMMON=1 \
271 %if "%{?_lib}" == "lib64"
272         -DTIZEN_ARCH_64=1 \
273 %endif
274         -DLIB_DIR=%{_libdir} \
275         -DBIN_DIR=%{_bindir} \
276         -DSBIN_DIR=%{_sbindir} \
277         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
278         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
279         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
280         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
281
282 make %{?_smp_mflags}
283 popd
284 %endif
285
286 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
287 # if tv || "undefined"
288 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
289 mkdir -p build_tv
290 pushd build_tv
291 cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
292         -DTIZEN_ENABLE_PRD=0 \
293 %if ! 0%{?model_build_feature_network_tethering_disable}
294         -DTIZEN_TETHERING_ENABLE=0 \
295 %endif
296         -DTIZEN_DEBUG_DBUS_VALUE=1 \
297         -DTIZEN_PROFILE_TV=1 \
298 %if "%{?_lib}" == "lib64"
299         -DTIZEN_ARCH_64=1 \
300 %endif
301         -DLIB_DIR=%{_libdir} \
302         -DBIN_DIR=%{_bindir} \
303         -DSBIN_DIR=%{_sbindir} \
304         -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
305         -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
306         -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
307         -DTZ_SYS_RUN=%{TZ_SYS_RUN}
308
309 make %{?_smp_mflags}
310 popd
311 %endif
312
313 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
314 # if common || ivi || "undefined"
315 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
316 # common
317 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
318         -DTIZEN_ENABLE_PRD=0 \
319 %if ! 0%{?model_build_feature_network_tethering_disable}
320         -DTIZEN_TETHERING_ENABLE=0 \
321 %endif
322         -DTIZEN_DEBUG_DBUS_VALUE=1 \
323         -DTIZEN_PROFILE_COMMON=1 \
324 %if "%{?_lib}" == "lib64"
325         -DTIZEN_ARCH_64=1 \
326 %endif
327 -DLIB_DIR=%{_libdir} \
328 -DBIN_DIR=%{_bindir} \
329 -DSBIN_DIR=%{_sbindir} \
330 -DTZ_SYS_RO_ETC=%{TZ_SYS_RO_ETC} \
331 -DTZ_SYS_VAR=%{TZ_SYS_VAR} \
332 -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
333 -DTZ_SYS_RUN=%{TZ_SYS_RUN}
334
335 make %{?_smp_mflags}
336 %endif
337
338
339 %install
340 rm -rf %{buildroot}
341
342 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
343 # if mobile || "undefined"
344 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
345 pushd build_mobile
346 %make_install
347 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.mobile
348 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.mobile
349 popd
350
351 %ifarch %{arm}
352 pushd build_tm1
353 %make_install
354 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.tm1
355 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.tm1
356 popd
357 %endif
358 %endif
359
360 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
361 # if wearable || "undefined"
362 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
363 pushd build_wearable
364 %make_install
365 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.wearable
366 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.wearable
367 popd
368 %endif
369
370 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
371 # if tv || "undefined"
372 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
373 pushd build_tv
374 %make_install
375 mv %{buildroot}%{_bindir}/wfd-manager %{buildroot}%{_bindir}/wfd-manager.tv
376 mv %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so.tv
377 popd
378 %endif
379
380 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
381 # if common || ivi || "undefined"
382 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
383 %make_install
384 %endif
385
386 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
387 cp wfd-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/wfd-manager.conf
388 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
389 cp net.wifidirect.service %{buildroot}%{_datadir}/dbus-1/system-services/net.wifidirect.service
390 mkdir -p %{buildroot}%{_libdir}/systemd/system/
391 cp wifi-direct-manager.service %{buildroot}%{_libdir}/systemd/system/wifi-direct-manager.service
392 %if "%{?_lib}" == "lib64"
393 mkdir -p %{buildroot}%{_unitdir}
394 cp wifi-direct-manager.service %{buildroot}%{_unitdir}/wifi-direct-manager.service
395 %endif
396 mkdir -p %{buildroot}%{upgrade_script_path}
397 cp -f 500.wifi-direct-manager_upgrade.sh %{buildroot}%{upgrade_script_path}
398
399 %post
400 chmod 644 %{TZ_SYS_RO_ETC}/wifi-direct/dhcpd.conf
401 chmod 644 %{TZ_SYS_RO_ETC}/wifi-direct/wifi-direct-manager.conf
402 chmod 755 %{_bindir}/dhcpd-notify.sh
403 chmod 755 %{TZ_SYS_RO_ETC}/wifi-direct/udhcp_script.non-autoip
404 chmod 755 %{_bindir}/wifi-direct-server.sh
405 chmod 755 %{_bindir}/wifi-direct-dhcp.sh
406 chmod 755 %{_sbindir}/p2p_supp.sh
407
408 if [ ! -d %{TZ_SYS_VAR}/lib/misc ]; then
409         mkdir -p %{TZ_SYS_VAR}/lib/misc
410 fi
411
412 touch %{TZ_SYS_VAR}/lib/misc/dhcpd.leases
413 chmod 666 %{TZ_SYS_VAR}/lib/misc/dhcpd.leases
414
415 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
416 # if mobile || "undefined"
417 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
418 %post profile_mobile
419 pushd %{_bindir}
420 ln -sf wfd-manager.mobile wfd-manager
421 popd
422 %preun profile_mobile
423 case "$1" in
424   0)
425     # This is an un-installation.
426         rm %{_bindir}/wfd-manager
427   ;;
428   1)
429     # This is an upgrade.
430     # Do nothing.
431     :
432   ;;
433 esac
434
435 %post -n wifi-direct-plugin-wpasupplicant-profile_mobile
436 pushd %{_libdir}
437 ln -sf wifi-direct-plugin-wpasupplicant.so.mobile wifi-direct-plugin-wpasupplicant.so
438 popd
439 /sbin/ldconfig
440
441 %preun -n wifi-direct-plugin-wpasupplicant-profile_mobile
442 case "$1" in
443   0)
444     # This is an un-installation.
445         rm %{_libdir}/wifi-direct-plugin-wpasupplicant.so
446         /sbin/ldconfig
447   ;;
448   1)
449     # This is an upgrade.
450     # Do nothing.
451     :
452   ;;
453 esac
454
455 %ifarch %{arm}
456 %post extension-TM1
457 pushd %{_bindir}
458 ln -sf wfd-manager.tm1 wfd-manager
459 popd
460 %preun extension-TM1
461 case "$1" in
462   0)
463     # This is an un-installation.
464         rm %{_bindir}/wfd-manager
465   ;;
466   1)
467     # This is an upgrade.
468     # Do nothing.
469     :
470   ;;
471 esac
472
473 %post -n wifi-direct-plugin-wpasupplicant-extension-TM1
474 pushd %{_libdir}
475 ln -sf wifi-direct-plugin-wpasupplicant.so.tm1 wifi-direct-plugin-wpasupplicant.so
476 popd
477 /sbin/ldconfig
478
479 %preun -n wifi-direct-plugin-wpasupplicant-extension-TM1
480 case "$1" in
481   0)
482     # This is an un-installation.
483         pushd %{_libdir}
484         rm wifi-direct-plugin-wpasupplicant.so
485         popd
486   ;;
487   1)
488     # This is an upgrade.
489     # Do nothing.
490     :
491   ;;
492 esac
493
494 %endif
495 %endif //mobile
496
497 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
498 # if wearable || "undefined"
499 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
500 %post profile_wearable
501 pushd %{_bindir}
502 ln -sf wfd-manager.wearable wfd-manager
503 popd
504 %preun profile_wearable
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-profile_wearable
518 pushd %{_libdir}
519 ln -sf wifi-direct-plugin-wpasupplicant.so.wearable wifi-direct-plugin-wpasupplicant.so
520 popd
521 /sbin/ldconfig
522
523 %preun -n wifi-direct-plugin-wpasupplicant-profile_wearable
524 case "$1" in
525   0)
526     # This is an un-installation.
527         rm %{_libdir}/wifi-direct-plugin-wpasupplicant.so
528         /sbin/ldconfig
529   ;;
530   1)
531     # This is an upgrade.
532     # Do nothing.
533     :
534   ;;
535 esac
536 %endif
537
538 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
539 # if tv || "undefined"
540 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
541 %post profile_tv
542 pushd %{_bindir}
543 ln -sf wfd-manager.tv wfd-manager
544 popd
545 %preun profile_tv
546 case "$1" in
547   0)
548     # This is an un-installation.
549         rm %{_bindir}/wfd-manager
550   ;;
551   1)
552     # This is an upgrade.
553     # Do nothing.
554     :
555   ;;
556 esac
557
558 %post -n wifi-direct-plugin-wpasupplicant-profile_tv
559 pushd %{_libdir}
560 ln -sf wifi-direct-plugin-wpasupplicant.so.tv wifi-direct-plugin-wpasupplicant.so
561 popd
562 /sbin/ldconfig
563
564 %preun -n wifi-direct-plugin-wpasupplicant-profile_tv
565 case "$1" in
566   0)
567     # This is an un-installation.
568         rm %{_libdir}/wifi-direct-plugin-wpasupplicant.so
569         /sbin/ldconfig
570   ;;
571   1)
572     # This is an upgrade.
573     # Do nothing.
574     :
575   ;;
576 esac
577 %endif
578
579 %files
580 %manifest wifi-direct-manager.manifest
581 %license LICENSE
582 %defattr(-,network_fw,network_fw,-)
583 %config %{TZ_SYS_RO_ETC}/wifi-direct/ccode.conf
584 %config %{TZ_SYS_RO_ETC}/wifi-direct/dhcpd.conf
585 %config %{TZ_SYS_RO_ETC}/wifi-direct/wifi-direct-manager.conf
586 %config %{TZ_SYS_RO_ETC}/wifi-direct/p2p_supp.conf
587 %config %{_sysconfdir}/dbus-1/system.d/wfd-manager.conf
588 %attr(644,-,-) %{TZ_SYS_ETC}/p2p_supp.conf
589 %attr(755,-,-) %{_bindir}/dhcpd-notify.sh
590 %attr(755,-,-) %{_bindir}/wifi-direct-server.sh
591 %attr(755,-,-) %{_bindir}/wifi-direct-dhcp.sh
592 %attr(755,-,-) %{TZ_SYS_RO_ETC}/wifi-direct/udhcp_script.non-autoip
593 %attr(644,network_fw,network_fw) %{_datadir}/dbus-1/system-services/*
594 %attr(644,network_fw,network_fw) %{_libdir}/systemd/system/*
595 %if "%{?_lib}" == "lib64"
596 %{_unitdir}/wifi-direct-manager.service
597 %endif
598 %attr(755,-,-) %{_sbindir}/p2p_supp.sh
599 %{upgrade_script_path}/500.wifi-direct-manager_upgrade.sh
600
601 %files -n wifi-direct-plugin-wpasupplicant
602 %manifest wifi-direct-plugin-wpasupplicant.manifest
603 %license LICENSE
604 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
605 # if common || ivi || "undefined"
606 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
607 %defattr(-,network_fw,network_fw,-)
608 %{_libdir}/wifi-direct-plugin-wpasupplicant.so
609 %endif
610
611 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
612 # if common || ivi || "undefined"
613 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "mobile"
614 %files profile_common
615 %defattr(-,network_fw,network_fw,-)
616 %{_bindir}/wfd-manager
617
618 %files -n wifi-direct-plugin-wpasupplicant-profile_common
619 # default .so files are housed in the main pkg.
620 %endif
621
622 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
623 # if mobile || "undefined"
624 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
625 %files profile_mobile
626 %defattr(-,network_fw,network_fw,-)
627 %{_bindir}/wfd-manager.mobile
628
629 %files -n wifi-direct-plugin-wpasupplicant-profile_mobile
630 %manifest wifi-direct-plugin-wpasupplicant.manifest
631 %defattr(-,network_fw,network_fw,-)
632 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.mobile
633
634 %ifarch %{arm}
635 %files extension-TM1
636 %defattr(-,network_fw,network_fw,-)
637 %{_bindir}/wfd-manager.tm1
638
639 %files -n wifi-direct-plugin-wpasupplicant-extension-TM1
640 %manifest wifi-direct-plugin-wpasupplicant.manifest
641 %defattr(-,network_fw,network_fw,-)
642 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.tm1
643 %endif
644 %endif
645
646 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
647 # if wearable || "undefined"
648 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
649 %files profile_wearable
650 %defattr(-,network_fw,network_fw,-)
651 %{_bindir}/wfd-manager.wearable
652
653 %files -n wifi-direct-plugin-wpasupplicant-profile_wearable
654 %manifest wifi-direct-plugin-wpasupplicant.manifest
655 %defattr(-,network_fw,network_fw,-)
656 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.wearable
657 %endif
658
659 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
660 # if tv || "undefined"
661 %if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
662 %files profile_tv
663 %defattr(-,network_fw,network_fw,-)
664 %{_bindir}/wfd-manager.tv
665
666 %files -n wifi-direct-plugin-wpasupplicant-profile_tv
667 %manifest wifi-direct-plugin-wpasupplicant.manifest
668 %defattr(-,network_fw,network_fw,-)
669 %{_libdir}/wifi-direct-plugin-wpasupplicant.so.tv
670 %endif
671
672 #%files -n wifi-direct-prd-plugin-wpasupplicant
673 #%manifest wifi-direct-prd-plugin-wpasupplicant.manifest
674 #%license LICENSE
675 #%defattr(-,network_fw,network_fw,-)
676 #%{_libdir}/wifi-direct-prd-plugin-wpasupplicant.so