%bcond_with connman_openconnect
-%bcond_with connman_openvpn
-%bcond_with connman_vpnd
-%bcond_with connman_ntp
+%bcond_without connman_openvpn
+%bcond_without connman_ipsec
+%bcond_without connman_vpnd
Name: connman
-Version: 1.26
-Release: 1
-License: GPL-2.0
+Version: 1.37
+Release: 41
+License: GPL-2.0+
Summary: Connection Manager
Url: http://connman.net
Group: Network & Connectivity/Connection Management
Source0: %{name}-%{version}.tar.gz
-Source10: 40-connman-ntp.list
-Source11: connman-ntp.service
-Source1001: connman.manifest
-BuildRequires: systemd-devel
+BuildRequires: systemd-devel
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(libiptc)
BuildRequires: pkgconfig(xtables)
BuildRequires: pkgconfig(libsmack)
-BuildRequires: pkgconfig(gnutls)
+BuildRequires: pkgconfig(libnl-3.0)
+BuildRequires: pkgconfig(libnl-genl-3.0)
+BuildRequires: pkgconfig(libsystemd-daemon)
%if %{with connman_openconnect}
BuildRequires: openconnect
%endif
%if %{with connman_openvpn}
BuildRequires: openvpn
%endif
+%if %{with connman_ipsec}
+BuildRequires: strongswan
+%endif
BuildRequires: readline-devel
-%systemd_requires
+#%systemd_requires
Requires: iptables
+Requires: systemd
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+Requires: net-config
+Requires: security-config
+Provides: %{name}-profile_common = %{version}-%{release}
+Provides: %{name}-profile_mobile = %{version}-%{release}
+Provides: %{name}-profile_wearable = %{version}-%{release}
%description
Connection Manager provides a daemon for managing Internet connections
OpenVPN support for Connman.
%endif
+%if %{with connman_ipsec}
+%package plugin-ipsec
+Summary: IPsec Support for Connman
+Requires: %{name} = %{version}
+Requires: strongswan
+
+%description plugin-ipsec
+OpenVPN support for Connman.
+%endif
+
%if %{with connman_vpnd}
%package connman-vpnd
Summary: VPN Support for Connman
-BuildRequires: %{name} = %{version}
+#BuildRequires: %{name} = %{version}
Requires: %{name} = %{version}
%description connman-vpnd
%package test
Summary: Test Scripts for Connection Manager
+Group: Development/Tools
Requires: %{name} = %{version}
Requires: dbus-python
Requires: pygobject
%package devel
Summary: Development Files for connman
+Group: Development/Tools
Requires: %{name} = %{version}
%description devel
Header files and development files for connman.
+%package extension-tv
+Summary: Connman service script for TV profile
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-profile_tv = %{version}-%{release}
+Conflicts: %{name}-extension-ivi
+Conflicts: %{name}-extension-disable-eth
+%description extension-tv
+Supplies Tizen TV profile systemd service scripts instead of the default one.
+This overwrites service script of %{name}.
+
+%package extension-ivi
+Summary: Connman configuration for IVI profile
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-profile_ivi = %{version}-%{release}
+Conflicts: %{name}-extension-tv
+Conflicts: %{name}-extension-disable-eth
+%description extension-ivi
+Supplies Tizen IVI profile configuration instead of the default one.
+This overwrites conf file of %{name}.
+
+%package extension-disable-eth
+Summary: Connman configuration for testing which requires the ethernet to be disabled
+Requires: %{name} = %{version}-%{release}
+Conflicts: %{name}-extension-tv
+Conflicts: %{name}-extension-ivi
+%description extension-disable-eth
+Connman without ethernet support
+This overwrites conf file of %{name}.
+
%prep
%setup -q
-cp %{SOURCE1001} .
+
%build
+%if %{with connman_vpnd}
+VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
+%endif
chmod +x bootstrap
./bootstrap
%configure \
- --enable-threads \
- --enable-client \
- --enable-tizen-ext \
- --enable-pacrunner \
+ --sysconfdir=/etc \
+ --enable-client \
+ --enable-tizen-ext \
+ --disable-tizen-ext-ins \
+ --enable-tizen-ext-eap-on-ethernet \
+ --enable-pacrunner \
--enable-wifi=builtin \
%if %{with connman_openconnect}
--enable-openconnect \
%if %{with connman_openvpn}
--enable-openvpn \
%endif
+%if %{with connman_ipsec}
+ --enable-ipsec \
+%endif
+%if 0%{?enable_connman_features}
+ %connman_features \
+%endif
+ --disable-ofono \
+ --enable-telephony=builtin \
--enable-test \
- --enable-loopback \
- --enable-ethernet \
- --with-systemdunitdir=%{_unitdir}
+ --enable-loopback \
+ --enable-ethernet \
+ --with-systemdunitdir=%{_libdir}/systemd/system \
+ --enable-pie \
+ --disable-wispr \
+ --disable-backtrace \
+ --disable-tools
make %{?_smp_mflags}
%install
%make_install
-%if %{with connman_ntp}
-mkdir -p %{buildroot}/usr/lib/systemd/ntp-units.d
-install -m644 %{SOURCE10} %{buildroot}/usr/lib/systemd/ntp-units.d
-install -m644 %{SOURCE11} %{buildroot}%{_unitdir}
-%install_service multi-user.target.wants connman-ntp.service
+#Systemd service file
+mkdir -p %{buildroot}%{_libdir}/systemd/system/
+%if "%{?_lib}" == "lib64"
+mkdir -p %{buildroot}%{_unitdir}
+%endif
+
+%if "%{?_lib}" == "lib64"
+cp src/connman_tv.service %{buildroot}%{_unitdir}/connman.service.tv
+cp src/connman.service %{buildroot}%{_unitdir}/connman.service
+cp vpn/connman-vpn.service %{buildroot}%{_unitdir}/connman-vpn.service
+%else
+cp src/connman_tv.service %{buildroot}%{_libdir}/systemd/system/connman.service.tv
+%endif
+
+mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
+ln -s ../connman.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/connman.service
+%if "%{?_lib}" == "lib64"
+mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+ln -s ../connman.service %{buildroot}%{_unitdir}/multi-user.target.wants/connman.service
%endif
-mkdir -p %{buildroot}%{_localstatedir}/lib/connman
-cp resources/var/lib/connman/settings %{buildroot}%{_localstatedir}/lib/connman/settings
+#Systemd socket file for DNS proxy
+%if "%{?_lib}" == "lib64"
+cp src/connman.socket %{buildroot}%{_unitdir}/connman.socket
+mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
+ln -s ../connman.socket %{buildroot}%{_unitdir}/sockets.target.wants/connman.socket
+%else
+cp src/connman.socket %{buildroot}%{_libdir}/systemd/system/connman.socket
+mkdir -p %{buildroot}%{_libdir}/systemd/system/sockets.target.wants
+ln -s ../connman.socket %{buildroot}%{_libdir}/systemd/system/sockets.target.wants/connman.socket
+%endif
+
+mkdir -p %{buildroot}/%{_localstatedir}/lib/connman
+cp resources/var/lib/connman/settings %{buildroot}/%{_localstatedir}/lib/connman/settings
+mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
+cp resources/usr/share/dbus-1/system-services/net.connman.service %{buildroot}%{_datadir}/dbus-1/system-services/net.connman.service
+mkdir -p %{buildroot}/etc/connman
-mkdir -p %{buildroot}%{_sysconfdir}/connman
-cp src/main.conf %{buildroot}%{_sysconfdir}/connman/main.conf
+cp src/main_ivi.conf %{buildroot}/etc/connman/main.conf.ivi
+cp src/main_tv.conf %{buildroot}/etc/connman/main.conf.tv
+cp src/main_disable_eth.conf %{buildroot}/etc/connman/main.conf.disable.eth
+cp src/main.conf %{buildroot}/etc/connman/main.conf
-%install_service multi-user.target.wants connman.service
+rm %{buildroot}%{_sysconfdir}/dbus-1/system.d/*.conf
+mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d/
+cp src/connman.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/
%if %{with connman_vpnd}
-%install_service multi-user.target.wants connman-vpn.service
+cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
%endif
%post
-systemctl daemon-reload
-systemctl restart connman.service
-%if %{with connman_vpnd}
-systemctl restart connman-vpn.service
-%endif
+#chsmack -a 'System' /%{_localstatedir}/lib/connman
+#chsmack -a 'System' /%{_localstatedir}/lib/connman/settings
%preun
-systemctl stop connman.service
-%if %{with connman_vpnd}
-systemctl stop connman-vpn.service
-%endif
%postun
systemctl daemon-reload
%docs_package
%files
-%manifest %{name}.manifest
-%license COPYING
-%{_sbindir}/*
-%{_libdir}/connman/plugins/*.so
-%{_datadir}/man/*
-%attr(600,root,root) %{_localstatedir}/lib/connman/settings
-%config %{_sysconfdir}/connman/main.conf
-%config %{_sysconfdir}/dbus-1/system.d/*
-%{_unitdir}/connman.service
-%{_unitdir}/multi-user.target.wants/connman.service
-%if %{with connman_ntp}
-%dir /usr/lib/systemd/ntp-units.d
-%{_unitdir}/connman-ntp.service
-%{_unitdir}/multi-user.target.wants/connman-ntp.service
-/usr/lib/systemd/ntp-units.d/40-connman-ntp.list
+%manifest connman.manifest
+%attr(500,network_fw,network_fw) %{_bindir}/connmand
+%attr(500,network_fw,network_fw) %{_bindir}/connmanctl
+%attr(755,network_fw,network_fw) /%{_localstatedir}/lib/connman
+%attr(600,network_fw,network_fw) /%{_localstatedir}/lib/connman/settings
+%attr(644,root,root) %{_datadir}/dbus-1/system-services/net.connman.service
+%attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
+%attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf
+%attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*.conf
+%attr(644,root,root) %{_libdir}/systemd/system/connman.service
+%attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/connman.service
+%if "%{?_lib}" == "lib64"
+%attr(644,root,root) %{_unitdir}/connman.service
+%attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman.service
+%attr(644,root,root) %{_unitdir}/connman.socket
+%attr(644,root,root) %{_unitdir}/sockets.target.wants/connman.socket
+%else
+%attr(644,root,root) %{_libdir}/systemd/system/connman.socket
+%attr(644,root,root) %{_libdir}/systemd/system/sockets.target.wants/connman.socket
%endif
+%license COPYING
%files test
-%manifest %{name}.manifest
+%manifest connman.manifest
%{_libdir}/%{name}/test/*
%files devel
-%manifest %{name}.manifest
-%{_includedir}/connman/*.h
+%manifest connman.manifest
+%{_includedir}/*
%{_libdir}/pkgconfig/*.pc
%if %{with connman_openconnect}
%files plugin-openconnect
%manifest %{name}.manifest
-%{_unitdir}/connman-vpn.service
%{_libdir}/connman/plugins-vpn/openconnect.so
%{_libdir}/connman/scripts/openconnect-script
-%{_datadir}/dbus-1/system-services/net.connman.vpn.service
+%license COPYING
%endif
%if %{with connman_openvpn}
%files plugin-openvpn
%manifest %{name}.manifest
-%{_unitdir}/connman-vpn.service
%{_libdir}/%{name}/plugins-vpn/openvpn.so
%{_libdir}/%{name}/scripts/openvpn-script
-%{_datadir}/dbus-1/system-services/net.connman.vpn.service
+%license COPYING
+%endif
+
+%if %{with connman_ipsec}
+%files plugin-ipsec
+%manifest %{name}.manifest
+%{_libdir}/%{name}/plugins-vpn/ipsec.so
+%{_libdir}/%{name}/scripts/ipsec-script
+%license COPYING
%endif
%if %{with connman_vpnd}
%files connman-vpnd
%manifest %{name}.manifest
-%{_sbindir}/connman-vpnd
-%{_unitdir}/connman-vpn.service
-%{_unitdir}/multi-user.target.wants/connman-vpn.service
+%{_bindir}/connman-vpnd
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/scripts
%dir %{_libdir}/%{name}/plugins-vpn
-%config %{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
+%attr(644,root,root) %config %{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
%{_datadir}/dbus-1/system-services/net.connman.vpn.service
+%license COPYING
+%attr(644,root,root) %{_libdir}/systemd/system/connman-vpn.service
+%if "%{?_lib}" == "lib64"
+%attr(644,root,root) %{_unitdir}/connman-vpn.service
+%endif
%endif
-%changelog
+%post extension-tv
+mv -f %{_libdir}/systemd/system/connman.service.tv %{_libdir}/systemd/system/connman.service
+mv -f %{_sysconfdir}/connman/main.conf.tv %{_sysconfdir}/connman/main.conf
+%files extension-tv
+%attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.tv
+%license COPYING
+%if "%{?_lib}" == "lib64"
+%attr(644,root,root) %{_unitdir}/connman.service.tv
+%else
+%attr(644,root,root) %{_libdir}/systemd/system/connman.service.tv
+%endif
+%post extension-ivi
+mv -f %{_sysconfdir}/connman/main.conf.ivi %{_sysconfdir}/connman/main.conf
+%files extension-ivi
+%attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.ivi
+%license COPYING
+%post extension-disable-eth
+mv -f %{_sysconfdir}/connman/main.conf.disable.eth %{_sysconfdir}/connman/main.conf
+%files extension-disable-eth
+%attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.disable.eth
+%license COPYING