Name: wifi-direct-manager
Summary: Wi-Fi Direct manger
-Version: 1.2.99
+Version: 1.2.181
Release: 1
Group: Network & Connectivity/Wireless
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Source1: dbus-wfd-manager.conf
+Source2: net.wifidirect.service
+Source3: wifi-direct-manager.service
BuildRequires: pkgconfig(capi-network-wifi-direct)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(libnl-2.0)
BuildRequires: pkgconfig(dbus-1)
-BuildRequires: pkgconfig(security-server)
+BuildRequires: pkgconfig(aul)
+
BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(libsystemd-login)
+
+BuildRequires: pkgconfig(libtzplatform-config)
+
BuildRequires: cmake
#BuildRequires: model-build-features
Requires: net-tools
#Requires: tizen-coreutils
Requires: toybox-symlinks-dhcpd
Requires: toybox-symlinks-dhcp
-Requires(post): /usr/bin/vconftool
%description
-Wi-Fi Direct manager
+Manager for handling wifi-direct functionalities
%package -n wifi-direct-plugin-wpasupplicant
Summary: Wifi direct plugin for wpa supplicant
Requires: %{name} = %{version}-%{release}
%description -n wifi-direct-plugin-wpasupplicant
-Wifi direct plugin for wpa supplicant
+Wi-Fi direct manager plugin to abstract wpa_supplicant
%prep
%setup -q
+chmod 644 %{SOURCE0}
+chmod 644 %{SOURCE1}
+chmod 644 %{SOURCE2}
+chmod 644 %{SOURCE3}
+cp -a %{SOURCE1} ./wfd-manager.conf
+cp -a %{SOURCE2} .
+cp -a %{SOURCE3} .
%build
%if ! 0%{?model_build_feature_network_tethering_disable}
-DTIZEN_TETHERING_ENABLE=0 \
%endif
+%if "%{profile}" == "common"
+ -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
+ -DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
+ -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
+ -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
+ -DCTRL_IFACE_DBUS=1 \
+ -DTIZEN_DEBUG_DBUS_VALUE=1 \
+ -DTIZEN_COMMON=1 \
+%else
%if "%{profile}" == "wearable"
-DTIZEN_FEATURE_SERVICE_DISCOVERY=0 \
-DTIZEN_FEATURE_WIFI_DISPLAY=0 \
%else
%if "%{profile}" == "mobile"
+%if "%{?tizen_target_name}" == "TM1"
+ -DTIZEN_WLAN_BOARD_SPRD=1 \
+%endif
-DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
-DTIZEN_WLAN_CONCURRENT_ENABLE=1 \
-DTIZEN_FEATURE_WIFI_DISPLAY=1 \
+ -DTIZEN_FEATURE_DEFAULT_CONNECTION_AGENT=1 \
+ -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
-DCTRL_IFACE_DBUS=1 \
+ -DTIZEN_DEBUG_DBUS_VALUE=1 \
-DTIZEN_MOBILE=1 \
+ -DTIZEN_FEATURE_ASP=1 \
%else
%if "%{profile}" == "tv"
-DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
-DTIZEN_WLAN_CONCURRENT_ENABLE=0 \
-DTIZEN_FEATURE_WIFI_DISPLAY=1 \
+ -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
-DCTRL_IFACE_DBUS=1 \
- -DTIZEN_WIFI_MODULE_BUNDLE=1 \
+ -DTIZEN_DEBUG_DBUS_VALUE=1 \
+ -DTIZEN_WIFI_MODULE_BUNDLE=0 \
-DTIZEN_TV=1 \
%endif
%endif
%endif
+%endif
%if "%{?_lib}" == "lib64"
-DTIZEN_ARCH_64=1 \
%endif
--DCMAKE_LIB_DIR=%{_libdir}
+-DLIB_DIR=%{_libdir} \
+-DBIN_DIR=%{_bindir} \
+-DSBIN_DIR=%{_sbindir} \
+-DTZ_SYS_RO_ETC=%TZ_SYS_RO_ETC \
+-DTZ_SYS_VAR=%TZ_SYS_VAR \
+-DTZ_SYS_ETC=%TZ_SYS_ETC \
+-DTZ_SYS_RUN=%TZ_SYS_RUN
make %{?_smp_mflags}
rm -rf %{buildroot}
%make_install
-#%__strip %{buildroot}%{_libdir}/wifi-direct-plugin-wpasupplicant.so
-#%__strip %{buildroot}%{_bindir}/wfd-manager
-#License
-mkdir -p %{buildroot}%{_datadir}/license
-cp %{_builddir}/%{buildsubdir}/LICENSE.APLv2 %{buildroot}%{_datadir}/license/%{name}
-cp %{_builddir}/%{buildsubdir}/LICENSE.APLv2 %{buildroot}%{_datadir}/license/wifi-direct-plugin-wpasupplicant
+mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
+cp wfd-manager.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/wfd-manager.conf
+mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
+cp net.wifidirect.service %{buildroot}%{_datadir}/dbus-1/system-services/net.wifidirect.service
+mkdir -p %{buildroot}%{_libdir}/systemd/system/
+cp wifi-direct-manager.service %{buildroot}%{_libdir}/systemd/system/wifi-direct-manager.service
%post
-chmod 644 /usr/etc/wifi-direct/dhcpd.p2p.conf
-chmod 755 /usr/bin/dhcpd-notify.sh
-chmod 755 /usr/etc/wifi-direct/udhcp_script.non-autoip
-chmod 755 /usr/bin/wifi-direct-server.sh
-chmod 755 /usr/bin/wifi-direct-dhcp.sh
-chmod 755 /usr/sbin/p2p_supp.sh
-
-vconftool set -t int memory/wifi_direct/state 0 -u 5000 -i -s system::vconf_network
-vconftool set -t int memory/private/wifi_direct_manager/dhcp_ip_lease 0 -i -s wifi_direct_manager
-vconftool set -t string memory/private/wifi_direct_manager/dhcpc_server_ip 0.0.0.0 -u 5000 -i
-vconftool set -t string memory/private/wifi_direct_manager/p2p_local_ip 0.0.0.0 -u 5000 -i
-vconftool set -t string memory/private/wifi_direct_manager/p2p_subnet_mask 0.0.0.0 -u 5000 -i
-vconftool set -t string memory/private/wifi_direct_manager/p2p_gateway 0.0.0.0 -u 5000 -i
-vconftool set -t string memory/private/wifi_direct_manager/p2p_ifname 0.0.0.0 -u 5000 -i
-
-%if "%{profile}" == "tv"
- if [ ! -d /opt/var/lib/misc ]; then
- mkdir -p /opt/var/lib/misc
- fi
-
- touch /opt/var/lib/misc/dhcpd.leases
- chmod 666 /opt/var/lib/misc/dhcpd.leases
-%else
- if [ ! -d /var/lib/misc ]; then
- mkdir -p /var/lib/misc
- fi
-
- touch /var/lib/misc/dhcpd.leases
- chmod 666 /var/lib/misc/dhcpd.leases
-%endif
+chmod 644 %{TZ_SYS_RO_ETC}/wifi-direct/dhcpd.conf
+chmod 755 %{_bindir}/dhcpd-notify.sh
+chmod 755 %{TZ_SYS_RO_ETC}/wifi-direct/udhcp_script.non-autoip
+chmod 755 %{_bindir}/wifi-direct-server.sh
+chmod 755 %{_bindir}/wifi-direct-dhcp.sh
+chmod 755 %{_sbindir}/p2p_supp.sh
-%postun
+if [ ! -d %{TZ_SYS_VAR}/lib/misc ]; then
+ mkdir -p %{TZ_SYS_VAR}/lib/misc
+fi
+touch %{TZ_SYS_VAR}/lib/misc/dhcpd.leases
+chmod 666 %{TZ_SYS_VAR}/lib/misc/dhcpd.leases
%files
%manifest wifi-direct-manager.manifest
+%license LICENSE
%defattr(-,root,root,-)
%{_bindir}/wfd-manager
-/usr/etc/wifi-direct/dhcpd.p2p.conf
-/usr/etc/wifi-direct/udhcp_script.non-autoip
-/usr/etc/wifi-direct/p2p_supp.conf
-/opt/etc/p2p_supp.conf
-/usr/etc/wifi-direct/ccode.conf
-/opt/etc/persistent-peer
+%config %TZ_SYS_RO_ETC/wifi-direct/ccode.conf
+%config %TZ_SYS_RO_ETC/wifi-direct/dhcpd.conf
+%config %TZ_SYS_RO_ETC/wifi-direct/p2p_supp.conf
+%config %TZ_SYS_RO_ETC/wifi-direct/udhcp_script.non-autoip
+%config %{_sysconfdir}/dbus-1/system.d/wfd-manager.conf
+%TZ_SYS_RO_ETC/wifi-direct/ccode.conf
+%TZ_SYS_RO_ETC/wifi-direct/dhcpd.conf
+%TZ_SYS_RO_ETC/wifi-direct/p2p_supp.conf
+%TZ_SYS_RO_ETC/wifi-direct/udhcp_script.non-autoip
+%TZ_SYS_ETC/p2p_supp.conf
%{_bindir}/dhcpd-notify.sh
%{_bindir}/wifi-direct-server.sh
%{_bindir}/wifi-direct-dhcp.sh
%attr(755,-,-) %{_bindir}/dhcpd-notify.sh
%attr(755,-,-) %{_bindir}/wifi-direct-server.sh
%attr(755,-,-) %{_bindir}/wifi-direct-dhcp.sh
-%attr(755,-,-) /usr/etc/wifi-direct/udhcp_script.non-autoip
+%attr(755,-,-) %{TZ_SYS_RO_ETC}/wifi-direct/udhcp_script.non-autoip
+%attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
+%attr(644,root,root) %{_datadir}/dbus-1/system-services/*
+%attr(644,root,root) %{_libdir}/systemd/system/*
%attr(755,-,-) %{_sbindir}/p2p_supp.sh
-%attr(644,-,-) %{_datadir}/license/%{name}
%files -n wifi-direct-plugin-wpasupplicant
%manifest wifi-direct-plugin-wpasupplicant.manifest
+%license LICENSE
%defattr(-,root,root,-)
%{_libdir}/wifi-direct-plugin-wpasupplicant.so
-%attr(644,-,-) %{_datadir}/license/wifi-direct-plugin-wpasupplicant