91270e459b874c5a4406ae498e22dd08b6bf91c4
[platform/upstream/connman.git] / packaging / connman.spec
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
6
7 Name:           connman
8 Version:        1.38
9 Release:        10
10 License:        GPL-2.0+
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
28 %endif
29 %if %{with connman_openvpn}
30 BuildRequires:  openvpn
31 %endif
32 %if %{with connman_ipsec}
33 BuildRequires:  strongswan
34 %endif
35 BuildRequires:  readline-devel
36 #%systemd_requires
37 Requires:       iptables
38 Requires:         systemd
39 Requires(post):   systemd
40 Requires(preun):  systemd
41 Requires(postun): systemd
42 Requires:         net-config
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}
47
48 %description
49 Connection Manager provides a daemon for managing Internet connections
50 within embedded devices running the Linux operating system.
51
52 %if %{with connman_openconnect}
53 %package plugin-openconnect
54 Summary:        Openconnect Support for Connman
55 Requires:       %{name} = %{version}
56 Requires:       openconnect
57
58 %description plugin-openconnect
59 Openconnect Support for Connman.
60 %endif
61
62 %if %{with connman_openvpn}
63 %package plugin-openvpn
64 Summary:        Openvpn Support for Connman
65 Requires:       %{name} = %{version}
66 Requires:       openvpn
67
68 %description plugin-openvpn
69 OpenVPN support for Connman.
70 %endif
71
72 %if %{with connman_ipsec}
73 %package plugin-ipsec
74 Summary:        IPsec Support for Connman
75 Requires:       %{name} = %{version}
76 Requires:       strongswan
77
78 %description plugin-ipsec
79 OpenVPN support for Connman.
80 %endif
81
82 %if %{with connman_vpnd}
83 %package connman-vpnd
84 Summary:        VPN Support for Connman
85 #BuildRequires:  %{name} = %{version}
86 Requires:       %{name} = %{version}
87
88 %description connman-vpnd
89 Provides VPN support for Connman
90 %endif
91
92 %if %{with connman_wireguard}
93 %package plugin-wireguard
94 Summary:        Wireguard Support for Connman
95 BuildRequires:  pkgconfig(libmnl)
96 Requires:       %{name} = %{version}
97
98 %description plugin-wireguard
99 Wireguard Support for Connman.
100 %endif
101
102 %package test
103 Summary:        Test Scripts for Connection Manager
104 Group:          Development/Tools
105 Requires:       %{name} = %{version}
106 Requires:       dbus-python
107 Requires:       pygobject
108 Requires:       python-xml
109
110 %description test
111 Scripts for testing Connman and its functionality
112
113 %package devel
114 Summary:        Development files for connman
115 Group:          Development/Tools
116 Requires:       %{name} = %{version}
117
118 %description devel
119 Header files and development files for connman.
120
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}.
130
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}.
140
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}.
149
150 %package extension-bpf
151 Summary:        Files for BPF support
152 Requires:       libelf
153 Requires:       zlib
154 Requires:       %{name} = %{version}-%{release}
155 %description extension-bpf
156 Files for BPF support
157
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
165
166
167 %prep
168 %setup -q
169
170
171 %build
172 %if %{with connman_vpnd}
173 VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
174 %endif
175
176 chmod +x bootstrap
177 ./bootstrap
178 %configure \
179             --sysconfdir=/etc \
180             --enable-client \
181             --enable-tizen-ext \
182             --disable-tizen-ext-ins \
183             --enable-tizen-ext-eap-on-ethernet \
184             --enable-pacrunner \
185             --enable-wifi=builtin \
186 %if %{with connman_openconnect}
187             --enable-openconnect \
188 %endif
189 %if %{with connman_openvpn}
190             --enable-openvpn \
191 %endif
192 %if %{with connman_ipsec}
193             --enable-ipsec \
194 %endif
195 %if %{without connman_wireguard}
196             --disable-wireguard \
197 %endif
198 %if 0%{?enable_connman_features}
199             %connman_features \
200 %endif
201             --disable-ofono \
202             --enable-telephony=builtin \
203             --enable-test \
204             --enable-loopback \
205             --enable-ethernet \
206             --with-systemdunitdir=%{_unitdir} \
207             --enable-pie \
208             --disable-wispr \
209             --disable-backtrace \
210             --disable-tools
211
212 make %{?_smp_mflags}
213
214 %install
215 %make_install
216
217 #Systemd service file
218 mkdir -p %{buildroot}%{_unitdir}
219
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
223
224 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
225 ln -s ../connman.service %{buildroot}%{_unitdir}/multi-user.target.wants/connman.service
226
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
231
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
237
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
242
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/
246
247 %if %{with connman_vpnd}
248 cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
249 %endif
250
251 # BPF file
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
255
256 %ifarch aarch64
257 cp resources/usr/lib/libbpf.so.64 %{buildroot}/%{_libdir}/libbpf.so.0.2.0
258 %else
259 cp resources/usr/lib/libbpf.so.32 %{buildroot}/%{_libdir}/libbpf.so.0.2.0
260 %endif
261
262 %post
263 #chsmack -a 'System' /%{_localstatedir}/lib/connman
264 #chsmack -a 'System' /%{_localstatedir}/lib/connman/settings
265
266 %preun
267
268 %postun
269 systemctl daemon-reload
270
271 %docs_package
272
273 %files
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
286 %license COPYING
287
288 %files test
289 %manifest connman.manifest
290 %{_libdir}/%{name}/test/*
291
292 %files devel
293 %manifest connman.manifest
294 %{_includedir}/*
295 %{_libdir}/pkgconfig/*.pc
296
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
302 %license COPYING
303 %endif
304
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
310 %license COPYING
311 %endif
312
313 %if %{with connman_ipsec}
314 %files plugin-ipsec
315 %manifest %{name}.manifest
316 %{_libdir}/%{name}/plugins-vpn/ipsec.so
317 %{_libdir}/%{name}/scripts/ipsec-script
318 %license COPYING
319 %endif
320
321 %if %{with connman_vpnd}
322 %files 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
330 %license COPYING
331 %attr(644,root,root) %{_unitdir}/connman-vpn.service
332 %endif
333
334 %if %{with connman_wireguard}
335 %files plugin-wireguard
336 %manifest %{name}.manifest
337 %{_libdir}/%{name}/plugins-vpn/wireguard.so
338 %license COPYING
339 %endif
340
341 %post extension-tv
342 mv -f %{_unitdir}/connman.service.tv %{_unitdir}/connman.service
343 mv -f %{_sysconfdir}/connman/main.conf.tv %{_sysconfdir}/connman/main.conf
344
345 %files extension-tv
346 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.tv
347 %license COPYING
348 %attr(644,root,root) %{_unitdir}/connman.service.tv
349
350 %post extension-ivi
351 mv -f %{_sysconfdir}/connman/main.conf.ivi %{_sysconfdir}/connman/main.conf
352
353 %files extension-ivi
354 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.ivi
355 %license COPYING
356
357 %post extension-disable-eth
358 mv -f %{_sysconfdir}/connman/main.conf.disable.eth %{_sysconfdir}/connman/main.conf
359
360 %files extension-disable-eth
361 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.disable.eth
362 %license COPYING
363
364 %files extension-bpf
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
368
369 %post extension-bpf
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
372
373 %files extension-bpf-devel
374 %manifest %{name}.manifest
375 %{_includedir}/bpf/*
376 %license COPYING
377 %license COPYING.LGPLv2