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