30345d0a3d99a7d98ef0316165abe2f46803bb5d
[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.35
8 Release:        29
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-2.0)
22 BuildRequires:  pkgconfig(libsystemd-daemon)
23 %if %{with connman_openconnect}
24 BuildRequires:  openconnect
25 %endif
26 %if %{with connman_openvpn}
27 BuildRequires:  openvpn
28 %endif
29 %if %{with connman_ipsec}
30 BuildRequires:  strongswan
31 %endif
32 BuildRequires:  readline-devel
33 #%systemd_requires
34 Requires:       iptables
35 Requires:         systemd
36 Requires(post):   systemd
37 Requires(preun):  systemd
38 Requires(postun): systemd
39 Requires:         net-config
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}
44
45 %define upgrade_script_filename 500.connman_upgrade.sh
46 %define upgrade_script_path /usr/share/upgrade/scripts
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 %package test
93 Summary:        Test Scripts for Connection Manager
94 Group:          Development/Tools
95 Requires:       %{name} = %{version}
96 Requires:       dbus-python
97 Requires:       pygobject
98 Requires:       python-xml
99
100 %description test
101 Scripts for testing Connman and its functionality
102
103 %package devel
104 Summary:        Development Files for connman
105 Group:          Development/Tools
106 Requires:       %{name} = %{version}
107
108 %description devel
109 Header files and development files for connman.
110
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}.
120
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}.
130
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}.
139
140 %prep
141 %setup -q
142
143
144 %build
145 %if %{with connman_vpnd}
146 VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
147 %endif
148
149 chmod +x bootstrap
150 ./bootstrap
151 %configure \
152             --sysconfdir=/etc \
153             --enable-client \
154             --enable-tizen-ext \
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
178 make %{?_smp_mflags}
179
180 %install
181 %make_install
182
183 #Systemd service file
184 mkdir -p %{buildroot}%{_libdir}/systemd/system/
185 %if "%{?_lib}" == "lib64"
186 mkdir -p %{buildroot}%{_unitdir}
187 %endif
188
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
193 %else
194 cp src/connman_tv.service %{buildroot}%{_libdir}/systemd/system/connman.service.tv
195 %endif
196
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
202 %endif
203
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
209 %else
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
213 %endif
214
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
220
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
225
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/
229
230 %if %{with connman_vpnd}
231 cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
232 %endif
233
234 #OS Upgrade
235 mkdir -p %{buildroot}%{upgrade_script_path}
236 cp -f scripts/%{upgrade_script_filename} %{buildroot}%{upgrade_script_path}
237
238 %post
239 #chsmack -a 'System' /%{_localstatedir}/lib/connman
240 #chsmack -a 'System' /%{_localstatedir}/lib/connman/settings
241
242 %preun
243
244 %postun
245 systemctl daemon-reload
246
247 %docs_package
248
249 %files
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
266 %else
267 %attr(644,root,root) %{_libdir}/systemd/system/connman.socket
268 %attr(644,root,root) %{_libdir}/systemd/system/sockets.target.wants/connman.socket
269 %endif
270 %license COPYING
271 %{upgrade_script_path}/%{upgrade_script_filename}
272
273 %files test
274 %manifest connman.manifest
275 %{_libdir}/%{name}/test/*
276
277 %files devel
278 %manifest connman.manifest
279 %{_includedir}/*
280 %{_libdir}/pkgconfig/*.pc
281
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
287 %license COPYING
288 %endif
289
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
295 %license COPYING
296 %endif
297
298 %if %{with connman_ipsec}
299 %files plugin-ipsec
300 %manifest %{name}.manifest
301 %{_libdir}/%{name}/plugins-vpn/ipsec.so
302 %{_libdir}/%{name}/scripts/ipsec-script
303 %license COPYING
304 %endif
305
306 %if %{with connman_vpnd}
307 %files 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
315 %license COPYING
316 %attr(644,root,root) %{_libdir}/systemd/system/connman-vpn.service
317 %if "%{?_lib}" == "lib64"
318 %attr(644,root,root) %{_unitdir}/connman-vpn.service
319 %endif
320 %endif
321
322 %post extension-tv
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
325 %files extension-tv
326 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.tv
327 %license COPYING
328 %if "%{?_lib}" == "lib64"
329 %attr(644,root,root) %{_unitdir}/connman.service.tv
330 %else
331 %attr(644,root,root) %{_libdir}/systemd/system/connman.service.tv
332 %endif
333 %post extension-ivi
334 mv -f %{_sysconfdir}/connman/main.conf.ivi %{_sysconfdir}/connman/main.conf
335 %files extension-ivi
336 %attr(644,network_fw,network_fw) %{_sysconfdir}/connman/main.conf.ivi
337 %license COPYING
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
342 %license COPYING