4a6815e51f3d2f1001aaa82a32c5f391512e398a
[platform/upstream/connman.git] / packaging / connman.spec
1 %bcond_with     connman_openconnect
2 %bcond_without  connman_openvpn
3 %bcond_without  connman_ipsec
4 %bcond_without  connman_vpnd
5
6 Name:           connman
7 Version:        1.37
8 Release:        41
9 License:        GPL-2.0+
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-3.0)
22 BuildRequires:  pkgconfig(libnl-genl-3.0)
23 BuildRequires:  pkgconfig(libsystemd-daemon)
24 %if %{with connman_openconnect}
25 BuildRequires:  openconnect
26 %endif
27 %if %{with connman_openvpn}
28 BuildRequires:  openvpn
29 %endif
30 %if %{with connman_ipsec}
31 BuildRequires:  strongswan
32 %endif
33 BuildRequires:  readline-devel
34 #%systemd_requires
35 Requires:       iptables
36 Requires:         systemd
37 Requires(post):   systemd
38 Requires(preun):  systemd
39 Requires(postun): systemd
40 Requires:         net-config
41 Requires:         security-config
42 Provides:       %{name}-profile_common = %{version}-%{release}
43 Provides:       %{name}-profile_mobile = %{version}-%{release}
44 Provides:       %{name}-profile_wearable = %{version}-%{release}
45
46 %description
47 Connection Manager provides a daemon for managing Internet connections
48 within embedded devices running the Linux operating system.
49
50 %if %{with connman_openconnect}
51 %package plugin-openconnect
52 Summary:        Openconnect Support for Connman
53 Requires:       %{name} = %{version}
54 Requires:       openconnect
55
56 %description plugin-openconnect
57 Openconnect Support for Connman.
58 %endif
59
60 %if %{with connman_openvpn}
61 %package plugin-openvpn
62 Summary:        Openvpn Support for Connman
63 Requires:       %{name} = %{version}
64 Requires:       openvpn
65
66 %description plugin-openvpn
67 OpenVPN support for Connman.
68 %endif
69
70 %if %{with connman_ipsec}
71 %package plugin-ipsec
72 Summary:        IPsec Support for Connman
73 Requires:       %{name} = %{version}
74 Requires:       strongswan
75
76 %description plugin-ipsec
77 OpenVPN support for Connman.
78 %endif
79
80 %if %{with connman_vpnd}
81 %package connman-vpnd
82 Summary:        VPN Support for Connman
83 #BuildRequires:  %{name} = %{version}
84 Requires:       %{name} = %{version}
85
86 %description connman-vpnd
87 Provides VPN support for Connman
88 %endif
89
90 %package test
91 Summary:        Test Scripts for Connection Manager
92 Group:          Development/Tools
93 Requires:       %{name} = %{version}
94 Requires:       dbus-python
95 Requires:       pygobject
96 Requires:       python-xml
97
98 %description test
99 Scripts for testing Connman and its functionality
100
101 %package devel
102 Summary:        Development Files for connman
103 Group:          Development/Tools
104 Requires:       %{name} = %{version}
105
106 %description devel
107 Header files and development files for connman.
108
109 %package extension-tv
110 Summary:        Connman service script for TV profile
111 Requires:       %{name} = %{version}-%{release}
112 Provides:       %{name}-profile_tv = %{version}-%{release}
113 Conflicts:      %{name}-extension-ivi
114 Conflicts:      %{name}-extension-disable-eth
115 %description extension-tv
116 Supplies Tizen TV profile systemd service scripts instead of the default one.
117 This overwrites service script of %{name}.
118
119 %package extension-ivi
120 Summary:        Connman configuration for IVI profile
121 Requires:       %{name} = %{version}-%{release}
122 Provides:       %{name}-profile_ivi = %{version}-%{release}
123 Conflicts:      %{name}-extension-tv
124 Conflicts:      %{name}-extension-disable-eth
125 %description extension-ivi
126 Supplies Tizen IVI profile configuration instead of the default one.
127 This overwrites conf file of %{name}.
128
129 %package extension-disable-eth
130 Summary:        Connman configuration for testing which requires the ethernet to be disabled
131 Requires:       %{name} = %{version}-%{release}
132 Conflicts:      %{name}-extension-tv
133 Conflicts:      %{name}-extension-ivi
134 %description extension-disable-eth
135 Connman without ethernet support
136 This overwrites conf file of %{name}.
137
138 %prep
139 %setup -q
140
141
142 %build
143 %if %{with connman_vpnd}
144 VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
145 %endif
146
147 chmod +x bootstrap
148 ./bootstrap
149 %configure \
150             --sysconfdir=/etc \
151             --enable-client \
152             --enable-tizen-ext \
153             --disable-tizen-ext-ins \
154             --enable-tizen-ext-eap-on-ethernet \
155             --enable-pacrunner \
156             --enable-wifi=builtin \
157 %if %{with connman_openconnect}
158             --enable-openconnect \
159 %endif
160 %if %{with connman_openvpn}
161             --enable-openvpn \
162 %endif
163 %if %{with connman_ipsec}
164             --enable-ipsec \
165 %endif
166 %if 0%{?enable_connman_features}
167             %connman_features \
168 %endif
169             --disable-ofono \
170             --enable-telephony=builtin \
171             --enable-test \
172             --enable-loopback \
173             --enable-ethernet \
174             --with-systemdunitdir=%{_libdir}/systemd/system \
175             --enable-pie \
176             --disable-wispr \
177             --disable-backtrace \
178             --disable-tools
179
180 make %{?_smp_mflags}
181
182 %install
183 %make_install
184
185 #Systemd service file
186 mkdir -p %{buildroot}%{_libdir}/systemd/system/
187 %if "%{?_lib}" == "lib64"
188 mkdir -p %{buildroot}%{_unitdir}
189 %endif
190
191 %if "%{?_lib}" == "lib64"
192 cp src/connman_tv.service %{buildroot}%{_unitdir}/connman.service.tv
193 cp src/connman.service %{buildroot}%{_unitdir}/connman.service
194 cp vpn/connman-vpn.service %{buildroot}%{_unitdir}/connman-vpn.service
195 %else
196 cp src/connman_tv.service %{buildroot}%{_libdir}/systemd/system/connman.service.tv
197 %endif
198
199 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
200 ln -s ../connman.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/connman.service
201 %if "%{?_lib}" == "lib64"
202 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
203 ln -s ../connman.service %{buildroot}%{_unitdir}/multi-user.target.wants/connman.service
204 %endif
205
206 #Systemd socket file for DNS proxy
207 %if "%{?_lib}" == "lib64"
208 cp src/connman.socket %{buildroot}%{_unitdir}/connman.socket
209 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
210 ln -s ../connman.socket %{buildroot}%{_unitdir}/sockets.target.wants/connman.socket
211 %else
212 cp src/connman.socket %{buildroot}%{_libdir}/systemd/system/connman.socket
213 mkdir -p %{buildroot}%{_libdir}/systemd/system/sockets.target.wants
214 ln -s ../connman.socket %{buildroot}%{_libdir}/systemd/system/sockets.target.wants/connman.socket
215 %endif
216
217 mkdir -p %{buildroot}/%{_localstatedir}/lib/connman
218 cp resources/var/lib/connman/settings %{buildroot}/%{_localstatedir}/lib/connman/settings
219 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
220 cp resources/usr/share/dbus-1/system-services/net.connman.service %{buildroot}%{_datadir}/dbus-1/system-services/net.connman.service
221 mkdir -p %{buildroot}/etc/connman
222
223 cp src/main_ivi.conf %{buildroot}/etc/connman/main.conf.ivi
224 cp src/main_tv.conf %{buildroot}/etc/connman/main.conf.tv
225 cp src/main_disable_eth.conf %{buildroot}/etc/connman/main.conf.disable.eth
226 cp src/main.conf %{buildroot}/etc/connman/main.conf
227
228 rm %{buildroot}%{_sysconfdir}/dbus-1/system.d/*.conf
229 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d/
230 cp src/connman.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/
231
232 %if %{with connman_vpnd}
233 cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
234 %endif
235
236 %post
237 #chsmack -a 'System' /%{_localstatedir}/lib/connman
238 #chsmack -a 'System' /%{_localstatedir}/lib/connman/settings
239
240 %preun
241
242 %postun
243 systemctl daemon-reload
244
245 %docs_package
246
247 %files
248 %manifest connman.manifest
249 %attr(500,network_fw,network_fw) %{_bindir}/connmand
250 %attr(500,network_fw,network_fw) %{_bindir}/connmanctl
251 %attr(755,network_fw,network_fw) /%{_localstatedir}/lib/connman
252 %attr(600,network_fw,network_fw) /%{_localstatedir}/lib/connman/settings
253 %attr(644,root,root) %{_datadir}/dbus-1/system-services/net.connman.service
254 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*
255 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf
256 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/*.conf
257 %attr(644,root,root) %{_libdir}/systemd/system/connman.service
258 %attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/connman.service
259 %if "%{?_lib}" == "lib64"
260 %attr(644,root,root) %{_unitdir}/connman.service
261 %attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman.service
262 %attr(644,root,root) %{_unitdir}/connman.socket
263 %attr(644,root,root) %{_unitdir}/sockets.target.wants/connman.socket
264 %else
265 %attr(644,root,root) %{_libdir}/systemd/system/connman.socket
266 %attr(644,root,root) %{_libdir}/systemd/system/sockets.target.wants/connman.socket
267 %endif
268 %license COPYING
269
270 %files test
271 %manifest connman.manifest
272 %{_libdir}/%{name}/test/*
273
274 %files devel
275 %manifest connman.manifest
276 %{_includedir}/*
277 %{_libdir}/pkgconfig/*.pc
278
279 %if %{with connman_openconnect}
280 %files plugin-openconnect
281 %manifest %{name}.manifest
282 %{_libdir}/connman/plugins-vpn/openconnect.so
283 %{_libdir}/connman/scripts/openconnect-script
284 %license COPYING
285 %endif
286
287 %if %{with connman_openvpn}
288 %files plugin-openvpn
289 %manifest %{name}.manifest
290 %{_libdir}/%{name}/plugins-vpn/openvpn.so
291 %{_libdir}/%{name}/scripts/openvpn-script
292 %license COPYING
293 %endif
294
295 %if %{with connman_ipsec}
296 %files plugin-ipsec
297 %manifest %{name}.manifest
298 %{_libdir}/%{name}/plugins-vpn/ipsec.so
299 %{_libdir}/%{name}/scripts/ipsec-script
300 %license COPYING
301 %endif
302
303 %if %{with connman_vpnd}
304 %files connman-vpnd
305 %manifest %{name}.manifest
306 %{_bindir}/connman-vpnd
307 %dir %{_libdir}/%{name}
308 %dir %{_libdir}/%{name}/scripts
309 %dir %{_libdir}/%{name}/plugins-vpn
310 %attr(644,root,root) %config %{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
311 %{_datadir}/dbus-1/system-services/net.connman.vpn.service
312 %license COPYING
313 %attr(644,root,root) %{_libdir}/systemd/system/connman-vpn.service
314 %if "%{?_lib}" == "lib64"
315 %attr(644,root,root) %{_unitdir}/connman-vpn.service
316 %endif
317 %endif
318
319 %post extension-tv
320 mv -f %{_libdir}/systemd/system/connman.service.tv %{_libdir}/systemd/system/connman.service
321 mv -f %{_sysconfdir}/connman/main.conf.tv %{_sysconfdir}/connman/main.conf
322 %files extension-tv
323 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.tv
324 %license COPYING
325 %if "%{?_lib}" == "lib64"
326 %attr(644,root,root) %{_unitdir}/connman.service.tv
327 %else
328 %attr(644,root,root) %{_libdir}/systemd/system/connman.service.tv
329 %endif
330 %post extension-ivi
331 mv -f %{_sysconfdir}/connman/main.conf.ivi %{_sysconfdir}/connman/main.conf
332 %files extension-ivi
333 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.ivi
334 %license COPYING
335 %post extension-disable-eth
336 mv -f %{_sysconfdir}/connman/main.conf.disable.eth %{_sysconfdir}/connman/main.conf
337 %files extension-disable-eth
338 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.disable.eth
339 %license COPYING