Name: net-config
Summary: TIZEN Network Configuration service
-Version: 1.1.69
-Release: 2
+Version: 1.1.135
+Release: 3
Group: System/Network
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(eventsystem)
-BuildRequires: pkgconfig(alarm-service)
-BuildRequires: pkgconfig(syspopup-caller)
BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(capi-network-wifi-direct)
+BuildRequires: pkgconfig(capi-vpnsvc)
BuildRequires: cmake
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(key-manager)
+BuildRequires: pkgconfig(libnl-2.0)
Requires: vconf
Requires: connman
Requires: systemd
+Requires: security-config
+Requires: iproute2
+Requires: iptables
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
+Provides: %{name}-profile_common = %{version}-%{release}
+Provides: %{name}-profile_mobile = %{version}-%{release}
+Provides: %{name}-profile_wearable = %{version}-%{release}
+Provides: %{name}-profile_ivi = %{version}-%{release}
%description
TIZEN Network Configuration service
+%package profile_tv
+Summary: net-config extension for TV profile
+Requires: %{name} = %{version}-%{release}
+%description profile_tv
+TIZEN Network Configuration service extension for Tizen TV profile.
+
+%package profile_wearable
+Summary: net-config extension for wearable profile
+Requires: %{name} = %{version}-%{release}
+%description profile_wearable
+TIZEN Network Configuration service extension for Tizen wearable profile.
+
+%package plugin-headed
+Summary: net-config extension for headed profile
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(eventsystem)
+BuildRequires: pkgconfig(alarm-service)
+BuildRequires: pkgconfig(syspopup-caller)
+BuildRequires: pkgconfig(capi-appfw-application)
+Requires: %{name} = %{version}-%{release}
+%description plugin-headed
+TIZEN Network Configuration service extension for headed profile.
+
+%package plugin-telephony
+Summary: net-config extension for telephony FW
+BuildRequires: pkgconfig(tapi)
+Requires: %{name} = %{version}-%{release}
+%description plugin-telephony
+TIZEN Network Configuration service extension for telephony FW.
+
+%package haltests
+Summary: net-config extension for HAL test
+BuildRequires: pkgconfig(gmock)
+BuildRequires: pkgconfig(capi-network-wifi-manager)
+BuildRequires: pkgconfig(capi-network-wifi-direct)
+BuildRequires: pkgconfig(capi-network-softap)
+Requires: %{name} = %{version}-%{release}
+%description haltests
+TIZEN Network Configuration service extension for HAL test.
+
%prep
%setup -q
%build
+# Build for wearable
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DTIZEN_WLAN_PASSPOINT=1 \
-DTIZEN_WLAN_USE_P2P_INTERFACE=1 \
-%if 0%{?model_build_feature_wlan_concurrent_mode}
- -DWLAN_CONCURRENT_MODE=1 \
-%endif
-%if ! 0%{?model_build_feature_wlan_p2p_disable}
- -DTIZEN_P2P_ENABLE=1 \
-%endif
-%if ! 0%{?model_build_feature_network_tethering_disable}
- -DTIZEN_TETHERING_ENABLE=1 \
-%endif
-%if "%{profile}" == "mobile"
- -DTIZEN_TELEPHONY_ENABLE=1 \
-%else
-%if "%{profile}" == "tv"
- -DTIZEN_TV=1 \
-%endif
-%endif
-%if 0%{?model_build_feature_wlan_wearable} == 1
+ -DTIZEN_DEBUG_ENABLE=1 \
-DTIZEN_WEARABLE=1 \
-DTIZEN_CAPTIVE_PORTAL=1 \
-%endif
+ -DLIB_PATH=%{_lib} \
+ -DBIN_DIR=%{_bindir} \
+ -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
+ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
+ .
+
+%make_install
+mv %{buildroot}%{_bindir}/net-config %{_builddir}/%{name}-%{version}/net-config.wearable
+
+make %{?_smp_mflags}
+
+
+# Build for common packages
+cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ -DTIZEN_WLAN_PASSPOINT=1 \
+ -DTIZEN_WLAN_USE_P2P_INTERFACE=1 \
+ -DTIZEN_DEBUG_ENABLE=1 \
+ -DTIZEN_WEARABLE=0 \
+ -DTIZEN_CAPTIVE_PORTAL=0 \
+ -DLIB_PATH=%{_lib} \
+ -DBIN_DIR=%{_bindir} \
+ -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
+ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
.
make %{?_smp_mflags}
mkdir -p %{buildroot}%{_unitdir}
%endif
-%if "%{profile}" == "tv"
-cp resources/usr/lib/systemd/system/net-config_tv.service %{buildroot}%{_libdir}/systemd/system/net-config.service
+cp resources/usr/lib/systemd/system/net-config_tv.service %{buildroot}%{_libdir}/systemd/system/net-config.service.tv
mkdir -p %{buildroot}%{_libdir}/udev/rules.d/
cp resources/usr/lib/udev/rules.d/99-wifiusb-dev.rules %{buildroot}%{_libdir}/udev/rules.d/99-wifiusb-dev.rules
-%else
+%if "%{?_lib}" == "lib64"
+cp resources/usr/lib/systemd/system/net-config_tv.service %{buildroot}%{_unitdir}/net-config.service.tv
+%endif
cp resources/usr/lib/systemd/system/net-config.service %{buildroot}%{_libdir}/systemd/system/net-config.service
%if "%{?_lib}" == "lib64"
cp resources/usr/lib/systemd/system/net-config.service %{buildroot}%{_unitdir}/net-config.service
%endif
-%endif
mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
ln -s ../net-config.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/net-config.service
mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services/
cp resources/usr/share/dbus-1/system-services/net.netconfig.service %{buildroot}%{_datadir}/dbus-1/system-services/net.netconfig.service
-mkdir -p %{buildroot}%{_sysconfdir}/
-cp resources/etc/resolv.conf %{buildroot}%{_sysconfdir}/resolv.conf
-
-mkdir -p %{buildroot}%{_sbindir}/
-cp resources/usr/sbin/net-config.service %{buildroot}%{_sbindir}/net-config.service
+mkdir -p %{buildroot}%{TZ_SYS_ETC}
+cp resources/etc/resolv.conf %{buildroot}%{TZ_SYS_ETC}/resolv.conf
-mkdir -p %{buildroot}%{TZ_SYS_DB}
-sqlite3 %{buildroot}%{TZ_SYS_DB}/.wifi_offload.db < resources/usr/share/wifi_offloading.sql
+mkdir -p %{buildroot}%{_sysconfdir}
+ln -s %{TZ_SYS_ETC}/resolv.conf %{buildroot}%{_sysconfdir}/resolv.conf
#DBus DAC (net-config.manifest enables DBus SMACK)
mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
cp resources/etc/dbus-1/system.d/net-config.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/net-config.conf
#log dump
-mkdir -p %{buildroot}%{TZ_SYS_ETC}/dump.d/module.d/
-cp resources/opt/etc/dump.d/module.d/network_log_dump.sh %{buildroot}%{TZ_SYS_ETC}/dump.d/module.d/network_log_dump.sh
-mkdir -p %{buildroot}%{TZ_SYS_VAR}/lib/net-config/
-cp resources/opt/etc/dump.d/module.d/network_log_dump.sh %{buildroot}%{TZ_SYS_VAR}/lib/net-config/network_log_dump.sh
-cp resources/opt/etc/dump.d/module.d/network_dump.sh %{buildroot}%{TZ_SYS_VAR}/lib/net-config/network_dump.sh
+mkdir -p %{buildroot}/opt/etc/dump.d/module.d/
+cp resources/opt/etc/dump.d/module.d/network_dump.sh %{buildroot}/opt/etc/dump.d/module.d/network_dump.sh
+mkdir -p %{buildroot}/opt/var/lib/net-config/
+cp resources/opt/etc/dump.d/module.d/network_dump.sh %{buildroot}/opt/var/lib/net-config/network_dump.sh
-%if 0%{?model_build_feature_wlan_wearable} == 1
#softreset scripts
mkdir -p %{buildroot}/usr/system/RestoreDir/softreset
cp resources/usr/system/RestoreDir/softreset/network_softreset.sh %{buildroot}/usr/system/RestoreDir/softreset/network_softreset.sh
-%endif
-#License
-mkdir -p %{buildroot}%{_datadir}/license
-cp LICENSE %{buildroot}%{_datadir}/license/net-config
+mv %{_builddir}/%{name}-%{version}/net-config.wearable %{buildroot}%{_bindir}
%post
+chsmack -a 'System::Shared' %{_sysconfdir}/resolv.conf
+chsmack -a 'System::Shared' %{TZ_SYS_ETC}/resolv.conf
#Network logs
mkdir -p /opt/usr/data/network
chmod 755 /opt/usr/data/network
-chsmack -a net-config::logging /opt/usr/data/network
+chown network_fw:network_fw /opt/usr/data/network
+#chsmack -a 'System' /opt/usr/data/network
#Add net-config.service to systemd extra default dependency ignore list
mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
%files
%manifest net-config.manifest
-%attr(500,root,root) %{_sbindir}/*
-%attr(644,root,root) %{_sysconfdir}/resolv.conf
+%attr(500,network_fw,network_fw) %{_bindir}/*
+%exclude %{_bindir}/net-config.wearable
+%attr(644,network_fw,network_fw) %{_sysconfdir}/resolv.conf
+%attr(644,network_fw,network_fw) %{TZ_SYS_ETC}/resolv.conf
%attr(644,root,root) %{_datadir}/dbus-1/system-services/*
#DBus DAC
%attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
%attr(644,root,root) %{_libdir}/systemd/system/net-config.service
%attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/net-config.service
+%attr(644,root,root) /usr/lib/tmpfiles.d/security-network-config.conf
%if "%{?_lib}" == "lib64"
%attr(644,root,root) %{_unitdir}/net-config.service
%attr(644,root,root) %{_unitdir}/multi-user.target.wants/net-config.service
%endif
-%{_datadir}/license/net-config
-%attr(660,root,root) %{TZ_SYS_DB}/.wifi_offload.db
-%attr(664,root,root) %{TZ_SYS_DB}/.wifi_offload.db-journal
-%attr(500,root,root) %{TZ_SYS_ETC}/dump.d/module.d/network_log_dump.sh
-%attr(500,root,root) %{TZ_SYS_VAR}/lib/net-config/network_log_dump.sh
-%attr(500,root,root) %{TZ_SYS_VAR}/lib/net-config/network_dump.sh
-%if "%{profile}" == "tv"
-%attr(644,root,root) %{_libdir}/udev/rules.d/99-wifiusb-dev.rules
+%license LICENSE
+%attr(500,root,root) /opt/etc/dump.d/module.d/network_dump.sh
+%attr(500,network_fw,network_fw) /opt/var/lib/net-config/network_dump.sh
+
+#### tv profile ####
+%post profile_tv
+mv %{_libdir}/systemd/system/net-config.service.tv %{_libdir}/systemd/system/net-config.service
+%if "%{?_lib}" == "lib64"
+mv %{_unitdir}/net-config.service.tv %{_unitdir}/net-config.service
%endif
-%if 0%{?model_build_feature_wlan_wearable} == 1
-%attr(700,root,root) /usr/system/RestoreDir/softreset/network_softreset.sh
+%files profile_tv
+%attr(644,network_fw,network_fw) %{_libdir}/udev/rules.d/99-wifiusb-dev.rules
+%attr(644,root,root) %{_libdir}/systemd/system/net-config.service.tv
+%if "%{?_lib}" == "lib64"
+%attr(644,root,root) %{_unitdir}/net-config.service.tv
%endif
+
+#### wearable profile ####
+%preun profile_wearable
+rm %{_bindir}/net-config
+
+%post profile_wearable
+pushd %{_bindir}
+mv net-config.wearable net-config
+
+%files profile_wearable
+%attr(500,network_fw,network_fw) %{_bindir}/net-config.wearable
+%attr(644,network_fw,network_fw) /usr/system/RestoreDir/softreset/network_softreset.sh
+
+#### plugin ####
+%files plugin-headed
+%manifest net-config.manifest
+%attr(500,network_fw,network_fw) %{_libdir}/net-config-plugin-headed.so
+
+%files plugin-telephony
+%manifest net-config.manifest
+%attr(500,network_fw,network_fw) %{_libdir}/net-config-plugin-telephony.so
+
+%files haltests
+%manifest net-config.manifest
+%{_bindir}/*hal_tc
+