1 %bcond_with connman_openconnect
2 %bcond_without connman_wireguard
3 %bcond_without connman_openvpn
4 %bcond_without connman_ipsec
5 %bcond_without connman_vpnd
11 Summary: Connection Manager
12 Url: http://connman.net
13 Group: Network & Connectivity/Connection Management
14 Source0: %{name}-%{version}.tar.gz
15 BuildRequires: systemd-devel
16 BuildRequires: pkgconfig(dlog)
17 BuildRequires: pkgconfig(dbus-1)
18 BuildRequires: pkgconfig(glib-2.0)
19 BuildRequires: pkgconfig(gio-2.0)
20 BuildRequires: pkgconfig(libiptc)
21 BuildRequires: pkgconfig(xtables)
22 BuildRequires: pkgconfig(libsmack)
23 BuildRequires: pkgconfig(libnl-3.0)
24 BuildRequires: pkgconfig(libnl-genl-3.0)
25 BuildRequires: pkgconfig(libsystemd)
26 %if %{with connman_openconnect}
27 BuildRequires: openconnect
29 %if %{with connman_openvpn}
30 BuildRequires: openvpn
32 %if %{with connman_ipsec}
33 BuildRequires: strongswan
35 BuildRequires: readline-devel
39 Requires(post): systemd
40 Requires(preun): systemd
41 Requires(postun): systemd
43 Requires: security-config
44 Provides: %{name}-profile_common = %{version}-%{release}
45 Provides: %{name}-profile_mobile = %{version}-%{release}
46 Provides: %{name}-profile_wearable = %{version}-%{release}
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
92 %if %{with connman_wireguard}
93 %package plugin-wireguard
94 Summary: Wireguard Support for Connman
95 BuildRequires: pkgconfig(libmnl)
96 Requires: %{name} = %{version}
98 %description plugin-wireguard
99 Wireguard Support for Connman.
103 Summary: Test Scripts for Connection Manager
104 Group: Development/Tools
105 Requires: %{name} = %{version}
106 Requires: dbus-python
111 Scripts for testing Connman and its functionality
114 Summary: Development files for connman
115 Group: Development/Tools
116 Requires: %{name} = %{version}
119 Header files and development files for connman.
121 %package extension-tv
122 Summary: Connman service script for TV profile
123 Requires: %{name} = %{version}-%{release}
124 Provides: %{name}-profile_tv = %{version}-%{release}
125 Conflicts: %{name}-extension-ivi
126 Conflicts: %{name}-extension-disable-eth
127 %description extension-tv
128 Supplies Tizen TV profile systemd service scripts instead of the default one.
129 This overwrites service script of %{name}.
131 %package extension-ivi
132 Summary: Connman configuration for IVI profile
133 Requires: %{name} = %{version}-%{release}
134 Provides: %{name}-profile_ivi = %{version}-%{release}
135 Conflicts: %{name}-extension-tv
136 Conflicts: %{name}-extension-disable-eth
137 %description extension-ivi
138 Supplies Tizen IVI profile configuration instead of the default one.
139 This overwrites conf file of %{name}.
141 %package extension-disable-eth
142 Summary: Connman configuration for testing which requires the ethernet to be disabled
143 Requires: %{name} = %{version}-%{release}
144 Conflicts: %{name}-extension-tv
145 Conflicts: %{name}-extension-ivi
146 %description extension-disable-eth
147 Connman without ethernet support
148 This overwrites conf file of %{name}.
150 %package extension-bpf
151 Summary: Files for BPF support
154 Requires: %{name} = %{version}-%{release}
155 %description extension-bpf
156 Files for BPF support
158 %package extension-bpf-devel
159 License: GPL-2.0+ and LGPL-2.1+
160 Summary: Development files for BPF support
161 Requires: %{name} = %{version}-%{release}
162 Requires: %{name}-extension-bpf
163 %description extension-bpf-devel
164 Header files and development files for BPF support
172 %if %{with connman_vpnd}
173 VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
182 --disable-tizen-ext-ins \
183 --enable-tizen-ext-eap-on-ethernet \
185 --enable-wifi=builtin \
186 %if %{with connman_openconnect}
187 --enable-openconnect \
189 %if %{with connman_openvpn}
192 %if %{with connman_ipsec}
195 %if %{without connman_wireguard}
196 --disable-wireguard \
198 %if 0%{?enable_connman_features}
202 --enable-telephony=builtin \
206 --with-systemdunitdir=%{_unitdir} \
209 --disable-backtrace \
217 #Systemd service file
218 mkdir -p %{buildroot}%{_unitdir}
220 cp src/connman_tv.service %{buildroot}%{_unitdir}/connman.service.tv
221 cp src/connman.service %{buildroot}%{_unitdir}/connman.service
222 cp vpn/connman-vpn.service %{buildroot}%{_unitdir}/connman-vpn.service
224 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
225 ln -s ../connman.service %{buildroot}%{_unitdir}/multi-user.target.wants/connman.service
227 #Systemd socket file for DNS proxy
228 cp src/connman.socket %{buildroot}%{_unitdir}/connman.socket
229 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
230 ln -s ../connman.socket %{buildroot}%{_unitdir}/sockets.target.wants/connman.socket
232 mkdir -p %{buildroot}/%{_localstatedir}/lib/connman
233 cp resources/var/lib/connman/settings %{buildroot}/%{_localstatedir}/lib/connman/settings
234 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
235 cp resources/usr/share/dbus-1/system-services/net.connman.service %{buildroot}%{_datadir}/dbus-1/system-services/net.connman.service
236 mkdir -p %{buildroot}/etc/connman
238 cp src/main_ivi.conf %{buildroot}/etc/connman/main.conf.ivi
239 cp src/main_tv.conf %{buildroot}/etc/connman/main.conf.tv
240 cp src/main_disable_eth.conf %{buildroot}/etc/connman/main.conf.disable.eth
241 cp src/main.conf %{buildroot}/etc/connman/main.conf
243 rm %{buildroot}%{_sysconfdir}/dbus-1/system.d/*.conf
244 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d/
245 cp src/connman.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/
247 %if %{with connman_vpnd}
248 cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
252 mkdir -p %{buildroot}/%{_includedir}/bpf
253 cp -rf resources/usr/include/bpf/* %{buildroot}/%{_includedir}/bpf
254 cp resources/var/lib/connman/bpf_code %{buildroot}/%{_localstatedir}/lib/connman/bpf_code
257 cp resources/usr/lib/libbpf.so.64 %{buildroot}/%{_libdir}/libbpf.so.0.2.0
259 cp resources/usr/lib/libbpf.so.32 %{buildroot}/%{_libdir}/libbpf.so.0.2.0
263 #chsmack -a 'System' /%{_localstatedir}/lib/connman
264 #chsmack -a 'System' /%{_localstatedir}/lib/connman/settings
269 systemctl daemon-reload
274 %manifest connman.manifest
275 %attr(500,network_fw,network_fw) %{_bindir}/connmand
276 %attr(500,network_fw,network_fw) %{_bindir}/connmanctl
277 %attr(600,network_fw,network_fw) /%{_localstatedir}/lib/connman/settings
278 %attr(644,root,root) %{_datadir}/dbus-1/system-services/net.connman.service
279 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
280 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf
281 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*.conf
282 %attr(644,root,root) %{_unitdir}/connman.service
283 %attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman.service
284 %attr(644,root,root) %{_unitdir}/connman.socket
285 %attr(644,root,root) %{_unitdir}/sockets.target.wants/connman.socket
289 %manifest connman.manifest
290 %{_libdir}/%{name}/test/*
293 %manifest connman.manifest
295 %{_libdir}/pkgconfig/*.pc
297 %if %{with connman_openconnect}
298 %files plugin-openconnect
299 %manifest %{name}.manifest
300 %{_libdir}/connman/plugins-vpn/openconnect.so
301 %{_libdir}/connman/scripts/openconnect-script
305 %if %{with connman_openvpn}
306 %files plugin-openvpn
307 %manifest %{name}.manifest
308 %{_libdir}/%{name}/plugins-vpn/openvpn.so
309 %{_libdir}/%{name}/scripts/openvpn-script
313 %if %{with connman_ipsec}
315 %manifest %{name}.manifest
316 %{_libdir}/%{name}/plugins-vpn/ipsec.so
317 %{_libdir}/%{name}/scripts/ipsec-script
321 %if %{with connman_vpnd}
323 %manifest %{name}.manifest
324 %{_bindir}/connman-vpnd
325 %dir %{_libdir}/%{name}
326 %dir %{_libdir}/%{name}/scripts
327 %dir %{_libdir}/%{name}/plugins-vpn
328 %attr(644,root,root) %config %{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
329 %{_datadir}/dbus-1/system-services/net.connman.vpn.service
331 %attr(644,root,root) %{_unitdir}/connman-vpn.service
334 %if %{with connman_wireguard}
335 %files plugin-wireguard
336 %manifest %{name}.manifest
337 %{_libdir}/%{name}/plugins-vpn/wireguard.so
342 mv -f %{_unitdir}/connman.service.tv %{_unitdir}/connman.service
343 mv -f %{_sysconfdir}/connman/main.conf.tv %{_sysconfdir}/connman/main.conf
346 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.tv
348 %attr(644,root,root) %{_unitdir}/connman.service.tv
351 mv -f %{_sysconfdir}/connman/main.conf.ivi %{_sysconfdir}/connman/main.conf
354 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.ivi
357 %post extension-disable-eth
358 mv -f %{_sysconfdir}/connman/main.conf.disable.eth %{_sysconfdir}/connman/main.conf
360 %files extension-disable-eth
361 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.disable.eth
365 %manifest %{name}.manifest
366 %attr(755,root,root) %{_libdir}/libbpf.so.0.2.0
367 %attr(640,network_fw,network_fw) %{_localstatedir}/lib/connman/bpf_code
370 ln -s %{_libdir}/libbpf.so.0.2.0 %{_libdir}/libbpf.so.0
371 ln -s %{_libdir}/libbpf.so.0.2.0 %{_libdir}/libbpf.so
373 %files extension-bpf-devel
374 %manifest %{name}.manifest
377 %license COPYING.LGPLv2