1 %bcond_with connman_openconnect
2 %bcond_without connman_openvpn
3 %bcond_without connman_ipsec
4 %bcond_without connman_vpnd
10 Summary: Connection Manager
11 Url: http://connman.net
12 Group: Network & Connectivity/Connection Management
13 Source0: %{name}-%{version}.tar.gz
14 BuildRequires: systemd-devel
15 BuildRequires: pkgconfig(dbus-1)
16 BuildRequires: pkgconfig(glib-2.0)
17 BuildRequires: pkgconfig(gio-2.0)
18 BuildRequires: pkgconfig(libiptc)
19 BuildRequires: pkgconfig(xtables)
20 BuildRequires: pkgconfig(libsmack)
21 BuildRequires: pkgconfig(libnl-2.0)
22 BuildRequires: pkgconfig(libsystemd-daemon)
23 %if %{with connman_openconnect}
24 BuildRequires: openconnect
26 %if %{with connman_openvpn}
27 BuildRequires: openvpn
29 %if %{with connman_ipsec}
30 BuildRequires: strongswan
32 BuildRequires: readline-devel
36 Requires(post): systemd
37 Requires(preun): systemd
38 Requires(postun): systemd
40 Requires: security-config
41 Provides: %{name}-profile_common = %{version}-%{release}
42 Provides: %{name}-profile_mobile = %{version}-%{release}
43 Provides: %{name}-profile_wearable = %{version}-%{release}
45 %define upgrade_script_filename 500.connman_upgrade.sh
46 %define upgrade_script_path /usr/share/upgrade/scripts
49 Connection Manager provides a daemon for managing Internet connections
50 within embedded devices running the Linux operating system.
52 %if %{with connman_openconnect}
53 %package plugin-openconnect
54 Summary: Openconnect Support for Connman
55 Requires: %{name} = %{version}
58 %description plugin-openconnect
59 Openconnect Support for Connman.
62 %if %{with connman_openvpn}
63 %package plugin-openvpn
64 Summary: Openvpn Support for Connman
65 Requires: %{name} = %{version}
68 %description plugin-openvpn
69 OpenVPN support for Connman.
72 %if %{with connman_ipsec}
74 Summary: IPsec Support for Connman
75 Requires: %{name} = %{version}
78 %description plugin-ipsec
79 OpenVPN support for Connman.
82 %if %{with connman_vpnd}
84 Summary: VPN Support for Connman
85 #BuildRequires: %{name} = %{version}
86 Requires: %{name} = %{version}
88 %description connman-vpnd
89 Provides VPN support for Connman
93 Summary: Test Scripts for Connection Manager
94 Group: Development/Tools
95 Requires: %{name} = %{version}
101 Scripts for testing Connman and its functionality
104 Summary: Development Files for connman
105 Group: Development/Tools
106 Requires: %{name} = %{version}
109 Header files and development files for connman.
111 %package extension-tv
112 Summary: Connman service script for TV profile
113 Requires: %{name} = %{version}-%{release}
114 Provides: %{name}-profile_tv = %{version}-%{release}
115 Conflicts: %{name}-extension-ivi
116 Conflicts: %{name}-extension-disable-eth
117 %description extension-tv
118 Supplies Tizen TV profile systemd service scripts instead of the default one.
119 This overwrites service script of %{name}.
121 %package extension-ivi
122 Summary: Connman configuration for IVI profile
123 Requires: %{name} = %{version}-%{release}
124 Provides: %{name}-profile_ivi = %{version}-%{release}
125 Conflicts: %{name}-extension-tv
126 Conflicts: %{name}-extension-disable-eth
127 %description extension-ivi
128 Supplies Tizen IVI profile configuration instead of the default one.
129 This overwrites conf file of %{name}.
131 %package extension-disable-eth
132 Summary: Connman configuration for testing which requires the ethernet to be disabled
133 Requires: %{name} = %{version}-%{release}
134 Conflicts: %{name}-extension-tv
135 Conflicts: %{name}-extension-ivi
136 %description extension-disable-eth
137 Connman without ethernet support
138 This overwrites conf file of %{name}.
145 %if %{with connman_vpnd}
146 VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
156 --enable-wifi=builtin \
157 %if %{with connman_openconnect}
158 --enable-openconnect \
160 %if %{with connman_openvpn}
163 %if %{with connman_ipsec}
166 %if 0%{?enable_connman_features}
170 --enable-telephony=builtin \
174 --with-systemdunitdir=%{_libdir}/systemd/system \
183 #Systemd service file
184 mkdir -p %{buildroot}%{_libdir}/systemd/system/
185 %if "%{?_lib}" == "lib64"
186 mkdir -p %{buildroot}%{_unitdir}
189 %if "%{?_lib}" == "lib64"
190 cp src/connman_tv.service %{buildroot}%{_unitdir}/connman.service.tv
191 cp src/connman.service %{buildroot}%{_unitdir}/connman.service
192 cp vpn/connman-vpn.service %{buildroot}%{_unitdir}/connman-vpn.service
194 cp src/connman_tv.service %{buildroot}%{_libdir}/systemd/system/connman.service.tv
197 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
198 ln -s ../connman.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/connman.service
199 %if "%{?_lib}" == "lib64"
200 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
201 ln -s ../connman.service %{buildroot}%{_unitdir}/multi-user.target.wants/connman.service
204 #Systemd socket file for DNS proxy
205 %if "%{?_lib}" == "lib64"
206 cp src/connman.socket %{buildroot}%{_unitdir}/connman.socket
207 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
208 ln -s ../connman.socket %{buildroot}%{_unitdir}/sockets.target.wants/connman.socket
210 cp src/connman.socket %{buildroot}%{_libdir}/systemd/system/connman.socket
211 mkdir -p %{buildroot}%{_libdir}/systemd/system/sockets.target.wants
212 ln -s ../connman.socket %{buildroot}%{_libdir}/systemd/system/sockets.target.wants/connman.socket
215 mkdir -p %{buildroot}/%{_localstatedir}/lib/connman
216 cp resources/var/lib/connman/settings %{buildroot}/%{_localstatedir}/lib/connman/settings
217 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
218 cp resources/usr/share/dbus-1/system-services/net.connman.service %{buildroot}%{_datadir}/dbus-1/system-services/net.connman.service
219 mkdir -p %{buildroot}/etc/connman
221 cp src/main_ivi.conf %{buildroot}/etc/connman/main.conf.ivi
222 cp src/main_tv.conf %{buildroot}/etc/connman/main.conf.tv
223 cp src/main_disable_eth.conf %{buildroot}/etc/connman/main.conf.disable.eth
224 cp src/main.conf %{buildroot}/etc/connman/main.conf
226 rm %{buildroot}%{_sysconfdir}/dbus-1/system.d/*.conf
227 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d/
228 cp src/connman.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/
230 %if %{with connman_vpnd}
231 cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
235 mkdir -p %{buildroot}%{upgrade_script_path}
236 cp -f scripts/%{upgrade_script_filename} %{buildroot}%{upgrade_script_path}
239 #chsmack -a 'System' /%{_localstatedir}/lib/connman
240 #chsmack -a 'System' /%{_localstatedir}/lib/connman/settings
245 systemctl daemon-reload
250 %manifest connman.manifest
251 %attr(500,network_fw,network_fw) %{_bindir}/connmand
252 %attr(500,network_fw,network_fw) %{_bindir}/connmanctl
253 %attr(755,network_fw,network_fw) /%{_localstatedir}/lib/connman
254 %attr(600,network_fw,network_fw) /%{_localstatedir}/lib/connman/settings
255 %attr(644,root,root) %{_datadir}/dbus-1/system-services/net.connman.service
256 %{_sysconfdir}/dbus-1/system.d/*
257 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf
258 %{_sysconfdir}/dbus-1/system.d/*.conf
259 %attr(644,root,root) %{_libdir}/systemd/system/connman.service
260 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/connman.service
261 %if "%{?_lib}" == "lib64"
262 %attr(644,root,root) %{_unitdir}/connman.service
263 %attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman.service
264 %attr(644,root,root) %{_unitdir}/connman.socket
265 %attr(644,root,root) %{_unitdir}/sockets.target.wants/connman.socket
267 %attr(644,root,root) %{_libdir}/systemd/system/connman.socket
268 %attr(644,root,root) %{_libdir}/systemd/system/sockets.target.wants/connman.socket
271 %{upgrade_script_path}/%{upgrade_script_filename}
274 %manifest connman.manifest
275 %{_libdir}/%{name}/test/*
278 %manifest connman.manifest
280 %{_libdir}/pkgconfig/*.pc
282 %if %{with connman_openconnect}
283 %files plugin-openconnect
284 %manifest %{name}.manifest
285 %{_libdir}/connman/plugins-vpn/openconnect.so
286 %{_libdir}/connman/scripts/openconnect-script
290 %if %{with connman_openvpn}
291 %files plugin-openvpn
292 %manifest %{name}.manifest
293 %{_libdir}/%{name}/plugins-vpn/openvpn.so
294 %{_libdir}/%{name}/scripts/openvpn-script
298 %if %{with connman_ipsec}
300 %manifest %{name}.manifest
301 %{_libdir}/%{name}/plugins-vpn/ipsec.so
302 %{_libdir}/%{name}/scripts/ipsec-script
306 %if %{with connman_vpnd}
308 %manifest %{name}.manifest
309 %{_bindir}/connman-vpnd
310 %dir %{_libdir}/%{name}
311 %dir %{_libdir}/%{name}/scripts
312 %dir %{_libdir}/%{name}/plugins-vpn
313 %attr(644,root,root) %config %{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
314 %{_datadir}/dbus-1/system-services/net.connman.vpn.service
316 %attr(644,root,root) %{_libdir}/systemd/system/connman-vpn.service
317 %if "%{?_lib}" == "lib64"
318 %attr(644,root,root) %{_unitdir}/connman-vpn.service
323 mv -f %{_libdir}/systemd/system/connman.service.tv %{_libdir}/systemd/system/connman.service
324 mv -f %{_sysconfdir}/connman/main.conf.tv %{_sysconfdir}/connman/main.conf
326 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.tv
328 %if "%{?_lib}" == "lib64"
329 %attr(644,root,root) %{_unitdir}/connman.service.tv
331 %attr(644,root,root) %{_libdir}/systemd/system/connman.service.tv
334 mv -f %{_sysconfdir}/connman/main.conf.ivi %{_sysconfdir}/connman/main.conf
336 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.ivi
338 %post extension-disable-eth
339 mv -f %{_sysconfdir}/connman/main.conf.disable.eth %{_sysconfdir}/connman/main.conf
340 %files extension-disable-eth
341 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.disable.eth