Name: net-config
Summary: TIZEN Network Configuration service
-Version: 1.1.130
-Release: 3
+Version: 1.2.14
+Release: 1
Group: System/Network
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(key-manager)
-BuildRequires: pkgconfig(libnl-2.0)
-%if 0%{?gtests:1}
-BuildRequires: pkgconfig(gmock)
-BuildRequires: pkgconfig(capi-network-wifi-manager)
-BuildRequires: pkgconfig(capi-network-wifi-direct)
-BuildRequires: pkgconfig(capi-network-softap)
-%endif
+BuildRequires: pkgconfig(libnl-3.0)
+BuildRequires: pkgconfig(libnl-genl-3.0)
+BuildRequires: pkgconfig(hal-api-wifi)
+BuildRequires: pkgconfig(libcurl)
Requires: vconf
Requires: connman
Requires: systemd
Requires: security-config
Requires: iproute2
Requires: iptables
+Requires: tcpdump
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Provides: %{name}-profile_mobile = %{version}-%{release}
Provides: %{name}-profile_wearable = %{version}-%{release}
Provides: %{name}-profile_ivi = %{version}-%{release}
+Provides: %{name}-profile_robot = %{version}-%{release}
%description
TIZEN Network Configuration service
%description profile_wearable
TIZEN Network Configuration service extension for Tizen wearable profile.
+%package profile_robot
+Summary: net-config extension for robot profile
+Requires: %{name} = %{version}-%{release}
+%description profile_robot
+TIZEN Network Configuration service extension for Tizen robot profile.
+
%package plugin-headed
Summary: net-config extension for headed profile
BuildRequires: pkgconfig(bundle)
%description plugin-telephony
TIZEN Network Configuration service extension for telephony FW.
+%package plugin-stc
+Summary: net-config extension for STC FW
+BuildRequires: pkgconfig(capi-network-stc)
+Requires: %{name} = %{version}-%{release}
+%description plugin-stc
+TIZEN Network Configuration service extension for STC FW.
+
+%package plugin-battery
+Summary: net-config extension for battery FW
+Requires: %{name} = %{version}-%{release}
+%description plugin-battery
+TIZEN Network Configuration service extension for battery 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.
+
+%ifarch arm armv7l aarch64
+%package plugin-online-monitor
+Summary: net-config extension for advanced online monitoring
+BuildRequires: pkgconfig(libbpf)
+Requires: libbpf
+Requires: %{name} = %{version}-%{release}
+%description plugin-online-monitor
+TIZEN Network Configuration service extension for advanced online monitoring.
+%endif
+
%prep
%setup -q
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DTIZEN_WLAN_PASSPOINT=1 \
-DTIZEN_WLAN_USE_P2P_INTERFACE=1 \
- -DTIZEN_DEBUG_ENABLE=1 \
+ -DTIZEN_DEBUG_ENABLE=0 \
-DTIZEN_WEARABLE=1 \
-DTIZEN_CAPTIVE_PORTAL=1 \
+%if "%{?_lib}" == "lib64"
+ -DTIZEN_ARCH_64=1 \
+%endif
+%ifarch arm armv7l aarch64
+ -DTIZEN_ARM_ARCH=1 \
+%endif
-DLIB_PATH=%{_lib} \
-DBIN_DIR=%{_bindir} \
-DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DTIZEN_WLAN_PASSPOINT=1 \
-DTIZEN_WLAN_USE_P2P_INTERFACE=1 \
- -DTIZEN_DEBUG_ENABLE=1 \
+ -DTIZEN_DEBUG_ENABLE=0 \
-DTIZEN_WEARABLE=0 \
-DTIZEN_CAPTIVE_PORTAL=0 \
+%if "%{?_lib}" == "lib64"
+ -DTIZEN_ARCH_64=1 \
+%endif
-DLIB_PATH=%{_lib} \
-DBIN_DIR=%{_bindir} \
-DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
make %{?_smp_mflags}
-
%install
%make_install
+#Settings file
+mkdir -p %{buildroot}/%{_localstatedir}/lib/net-config
+cp resources/var/lib/net-config/settings %{buildroot}/%{_localstatedir}/lib/net-config/settings
+cp resources/var/lib/net-config/settings-robot %{buildroot}/%{_localstatedir}/lib/net-config/settings-robot
+
#Systemd service file
-mkdir -p %{buildroot}%{_libdir}/systemd/system/
-%if "%{?_lib}" == "lib64"
mkdir -p %{buildroot}%{_unitdir}
-%endif
-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
-%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
-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
-%if "%{?_lib}" == "lib64"
mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants/
ln -s ../net-config.service %{buildroot}%{_unitdir}/multi-user.target.wants/net-config.service
-%endif
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
#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
+cp resources/etc/dbus-1/system.d/net-config-robot.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/net-config-robot.conf
#log dump
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
+cp resources/opt/etc/dump.d/module.d/network_log_dump.sh %{buildroot}/opt/var/lib/net-config/network_log_dump.sh
#softreset scripts
mkdir -p %{buildroot}/usr/system/RestoreDir/softreset
mv %{_builddir}/%{name}-%{version}/net-config.wearable %{buildroot}%{_bindir}
+%ifarch arm armv7l aarch64
+#online-monitor
+cp plugin/online-monitor/online_monitor.conf %{buildroot}/%{_localstatedir}/lib/net-config
+cp plugin/online-monitor/common_info_dump.sh %{buildroot}/opt/var/lib/net-config/
+cp plugin/online-monitor/supp_log_dump.sh %{buildroot}/opt/var/lib/net-config/
+cp plugin/online-monitor/bpf_code %{buildroot}/opt/var/lib/net-config/
+%endif
+
%post
chsmack -a 'System::Shared' %{_sysconfdir}/resolv.conf
chsmack -a 'System::Shared' %{TZ_SYS_ETC}/resolv.conf
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/
-ln -sf %{_libdir}/systemd/system/net-config.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-%if "%{?_lib}" == "lib64"
-ln -sf %{_unitdir}/net-config.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-%endif
-
#systemctl daemon-reload
#systemctl restart net-config.service
%files
%manifest net-config.manifest
-%attr(500,network_fw,network_fw) %{_bindir}/*
+%attr(500,network_fw,network_fw) %{_bindir}/net-config
%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
+%exclude %{_sysconfdir}/dbus-1/system.d/net-config-robot.conf
%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
+%attr(644,root,root) /var/lib/net-config/settings
%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
-%if 0%{?gtests:1}
-%{_bindir}/gtest*
-%endif
+%attr(750,network_fw,network_fw) /opt/etc/dump.d/module.d/network_dump.sh
+%attr(750,network_fw,network_fw) /opt/var/lib/net-config/network_dump.sh
+%attr(750,network_fw,network_fw) /opt/var/lib/net-config/network_log_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
%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) %{_libdir}/udev/rules.d/99-wifiusb-dev.rules
%attr(644,root,root) %{_unitdir}/net-config.service.tv
-%endif
#### wearable profile ####
%preun profile_wearable
mv net-config.wearable net-config
%files profile_wearable
-%attr(644,root,root) %{_bindir}/net-config.wearable
+%attr(500,network_fw,network_fw) %{_bindir}/net-config.wearable
%attr(644,network_fw,network_fw) /usr/system/RestoreDir/softreset/network_softreset.sh
+#### robot profile ####
+%post profile_robot
+mv /var/lib/net-config/settings-robot /var/lib/net-config/settings
+mv %{_sysconfdir}/dbus-1/system.d/net-config-robot.conf %{_sysconfdir}/dbus-1/system.d/net-config.conf
+
+%files profile_robot
+%manifest net-config.manifest
+%attr(644,root,root) /var/lib/net-config/settings-robot
+%attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/net-config-robot.conf
+
+
#### plugin ####
%files plugin-headed
%manifest net-config.manifest
%files plugin-telephony
%manifest net-config.manifest
%attr(500,network_fw,network_fw) %{_libdir}/net-config-plugin-telephony.so
+
+%files plugin-stc
+%manifest net-config.manifest
+%attr(500,network_fw,network_fw) %{_libdir}/net-config-plugin-stc.so
+
+%files plugin-battery
+%manifest net-config.manifest
+%attr(500,network_fw,network_fw) %{_libdir}/net-config-plugin-battery.so
+
+%files haltests
+%manifest net-config.manifest
+%{_bindir}/hal/*haltests
+
+%ifarch arm armv7l aarch64
+%files plugin-online-monitor
+%manifest net-config.manifest
+%attr(500,network_fw,network_fw) %{_libdir}/net-config-plugin-online-monitor.so
+%attr(644,root,root) %{_localstatedir}/lib/net-config/online_monitor.conf
+%attr(750,network_fw,network_fw) /opt/var/lib/net-config/common_info_dump.sh
+%attr(750,network_fw,network_fw) /opt/var/lib/net-config/supp_log_dump.sh
+%attr(640,network_fw,network_fw) /opt/var/lib/net-config/bpf_code
+
+%post plugin-online-monitor
+/usr/bin/mkdir -p /opt/usr/data/network/online_mon
+%endif