packaging: bumped version, updated changelog.
[profile/ivi/murphy.git] / packaging / murphy.spec
1 # These are on by default, unless explicitly disabled.
2 %bcond_without lua
3 %bcond_without pulse
4 %bcond_without ecore
5 %bcond_without glib
6 %bcond_without dbus
7 %bcond_without telephony
8 %bcond_without audiosession
9 %bcond_without websockets
10 %bcond_without smack
11 %bcond_without sysmon
12
13 # These are off by default, unless explicitly enabled.
14 #
15 # Notes:
16 #   By default we build with distro-default compilation flags which
17 #   enables optimizations. If you want to build with full debugging
18 #   ie. with optimization turned off and full debug info (-O0 -g3)
19 #   pass '--with debug' to rpmbuild on the command line. Similary
20 #   you can chose to compile with/without pulse, ecore, glib, qt,
21 #   dbus, and telephony support.
22 #
23 #   qt is the macro for controlling Qt4 support, which is not supported
24 #   in Tizen any more. qt5 is the corrsponding macro for controlling
25 #   Qt5 support.
26 #
27 %bcond_with icosyscon
28 %bcond_with qt
29 %bcond_with debug
30
31
32 Summary: Resource policy framework
33 Name: murphy
34 Version: 0.0.70
35 Release: 1
36 License: BSD-3-Clause
37 Group: System/Service
38 URL: http://01.org/murphy/
39 Source0: %{name}-%{version}.tar.gz
40 Source1001: %{name}.manifest
41
42 Requires(post): /bin/systemctl
43 Requires(post): libcap-tools
44 Requires(postun): /bin/systemctl
45
46 BuildRequires: flex
47 BuildRequires: bison
48 BuildRequires: pkgconfig(lua)
49 BuildRequires: pkgconfig(libsystemd-daemon)
50 BuildRequires: pkgconfig(libsystemd-journal)
51 BuildRequires: pkgconfig(libcap)
52 BuildRequires: pkgconfig(libtzplatform-config)
53 %if %{with pulse}
54 BuildRequires: pkgconfig(libpulse)
55 %endif
56 %if %{with ecore}
57 BuildRequires: pkgconfig(ecore)
58 BuildRequires: mesa-libEGL
59 BuildRequires: mesa-libGLESv2
60 %endif
61 %if %{with glib}
62 BuildRequires: pkgconfig(glib-2.0)
63 %endif
64 %if %{with qt}
65 BuildRequires: pkgconfig(QtCore)
66 %endif
67 %if %{with dbus}
68 BuildRequires: pkgconfig(dbus-1)
69 %endif
70 %if %{with telephony}
71 BuildRequires: pkgconfig(ofono)
72 %endif
73 %if %{with audiosession}
74 BuildRequires: pkgconfig(audio-session-mgr)
75 BuildRequires: pkgconfig(aul)
76 %endif
77 %if %{with websockets}
78 BuildRequires: libwebsockets-devel
79 %endif
80 BuildRequires: pkgconfig(json)
81 %if %{with smack}
82 BuildRequires: pkgconfig(libsmack)
83 %endif
84 %if %{with icosyscon}
85 BuildRequires: ico-uxf-weston-plugin-devel
86 BuildRequires: weston-ivi-shell-devel
87 BuildRequires: genivi-shell-devel
88 BuildRequires: pkgconfig(ail)
89 BuildRequires: pkgconfig(aul)
90 BuildRequires: libxml2-devel
91 %endif
92
93 %description
94 This package contains the basic Murphy daemon.
95
96 %package devel
97 Summary: The header files and libraries needed for Murphy development
98 Group: System/Libraries
99 Requires: %{name} = %{version}
100 Requires: libjson-devel
101
102 %description devel
103 This package contains header files and libraries necessary for development.
104
105 %package doc
106 Summary: Documentation for Murphy
107 Group: SDK/Documentation
108
109 %description doc
110 This package contains documentation.
111
112 %if %{with pulse}
113 %package pulse
114 Summary: Murphy PulseAudio mainloop integration
115 Group: System/Libraries
116 Requires: %{name} = %{version}
117
118 %description pulse
119 This package contains the Murphy PulseAudio mainloop integration runtime files.
120
121 %package pulse-devel
122 Summary: Murphy PulseAudio mainloop integration development files
123 Group: System/Libraries
124 Requires: %{name}-pulse = %{version}
125 Requires: %{name} = %{version}
126
127 %description pulse-devel
128 This package contains the Murphy PulseAudio mainloop integration development
129 files.
130 %endif
131
132 %if %{with ecore}
133 %package ecore
134 Summary: Murphy EFL/ecore mainloop integration
135 Group: System/Libraries
136 Requires: %{name} = %{version}
137
138 %description ecore
139 This package contains the Murphy EFL/ecore mainloop integration runtime files.
140
141 %package ecore-devel
142 Summary: Murphy EFL/ecore mainloop integration development files
143 Group: System/Libraries
144 Requires: %{name}-ecore = %{version}
145 Requires: %{name} = %{version}
146
147 %description ecore-devel
148 This package contains the Murphy EFL/ecore mainloop integration development
149 files.
150 %endif
151
152 %if %{with glib}
153 %package glib
154 Summary: Murphy glib mainloop integration
155 Group: System/Libraries
156 Requires: %{name} = %{version}
157
158 %description glib
159 This package contains the Murphy glib mainloop integration runtime files.
160
161 %package glib-devel
162 Summary: Murphy glib mainloop integration development files
163 Group: System/Libraries
164 Requires: %{name}-glib = %{version}
165 Requires: %{name} = %{version}
166
167 %description glib-devel
168 This package contains the Murphy glib mainloop integration development
169 files.
170 %endif
171
172 %if %{with qt}
173 %package qt
174 Summary: Murphy Qt mainloop integration
175 Group: System/Libraries
176 Requires: %{name} = %{version}
177
178 %description qt
179 This package contains the Murphy Qt mainloop integration runtime files.
180
181 %package qt-devel
182 Summary: Murphy Qt mainloop integration development files
183 Group: System/Libraries
184 Requires: %{name}-qt = %{version}
185 Requires: %{name} = %{version}
186
187 %description qt-devel
188 This package contains the Murphy Qt mainloop integration development
189 files.
190 %endif
191
192 %package gam
193 Summary: Murphy support for Genivi Audio Manager
194 Group: System/Libraries
195 Requires: %{name} = %{version}
196
197 %description gam
198 This package contains the Murphy plugins for necessary for supporting
199 Genivi Audio Manager.
200
201 %package gam-devel
202 Summary: Murphy support for Genivi Audio Manager development files
203 Group: System/Libraries
204 Requires: %{name}-gam = %{version}
205
206 %description gam-devel
207 This package contains development files for Murphy Genivi Audio Manager
208 plugins.
209
210 %package tests
211 Summary: Various test binaries for Murphy
212 Group: System/Testing
213 Requires: %{name} = %{version}
214 Requires: %{name} = %{version}
215
216 %description tests
217 This package contains various test binaries for Murphy.
218
219 %if %{with icosyscon}
220 %package system-controller
221 Summary: Murphy IVI System Controller plugin
222 Group: System/Service
223 Requires: ico-uxf-homescreen
224 Conflicts: murphy-ivi-resource-manager
225 Provides: system-controller
226 Conflicts: ico-uxf-homescreen-system-controller
227
228 %description system-controller
229 This package contains the Murphy IVI resource manager plugin.
230 %endif
231
232 %prep
233 %setup -q
234 cp %{SOURCE1001} .
235 %if %{with icosyscon}
236 echo "Build with icosyscon"
237 %else
238 echo "Build without icosyscon"
239 %endif
240
241 %build
242 %if %{with debug}
243 export CFLAGS="-O0 -g3"
244 V="V=1"
245 %endif
246
247 CONFIG_OPTIONS=""
248 DYNAMIC_PLUGINS="domain-control,system-controller"
249
250 %if %{with pulse}
251 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
252 %else
253 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
254 %endif
255
256 %if %{with ecore}
257 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
258 %else
259 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
260 %endif
261
262 %if %{with glib}
263 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
264 %else
265 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
266 %endif
267
268 %if %{with qt}
269 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
270 %else
271 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
272 %endif
273
274 %if %{with dbus}
275 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-libdbus"
276 %else
277 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-libdbus"
278 %endif
279
280 %if %{with telephony}
281 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
282 %else
283 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
284 %endif
285
286 %if %{with audiosession}
287 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-resource-asm"
288 DYNAMIC_PLUGINS="$DYNAMIC_PLUGINS,resource-asm"
289 %else
290 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-resource-asm"
291 %endif
292
293 %if %{with websockets}
294 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-websockets"
295 %else
296 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
297 %endif
298
299 %if %{with smack}
300 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-smack"
301 %else
302 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
303 %endif
304
305 %if %{with icosyscon}
306 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-system-controller"
307 %else
308 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-system-controller"
309 %endif
310
311 %if %{with sysmon}
312 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-system-monitor"
313 %else
314 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-system-monitor"
315 %endif
316
317 ./bootstrap
318 %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS
319 %__make clean
320 %__make %{?_smp_mflags} $V
321
322 %install
323 rm -rf %{buildroot}
324 %make_install
325
326 # Make sure we have a plugin dir even if all the basic plugins
327 # are configured to be built in.
328 mkdir -p %{buildroot}%{_libdir}/murphy/plugins
329
330 # Get rid of any *.la files installed by libtool.
331 rm -f %{buildroot}%{_libdir}/*.la
332
333 # Clean up also the murphy DB installation.
334 rm -f %{buildroot}%{_libdir}/murphy/*.la
335
336 # Generate list of linkedin plugins (depends on the configuration).
337 outdir="`pwd`"
338 pushd %{buildroot}
339 find ./%{_libdir} -name libmurphy-plugin-*.so* | \
340 sed 's#^./*#/#g' > $outdir/filelist.plugins-base
341 popd
342 echo "Found the following linked-in plugin files:"
343 cat $outdir/filelist.plugins-base | sed 's/^/    /g'
344
345 # Generate list of header files, filtering ones that go to subpackages.
346 outdir="`pwd`"
347 pushd %{buildroot}
348 find ./%{_includedir}/murphy | \
349 grep -E -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
350 sed 's#^./*#/#g' > $outdir/filelist.devel-includes
351 popd
352
353 # Replace the default sample/test config files with the packaging ones.
354 rm -f %{buildroot}%{_sysconfdir}/murphy/*
355 cp packaging.in/murphy-lua.conf %{buildroot}%{_sysconfdir}/murphy/murphy.conf
356 cp packaging.in/murphy.lua      %{buildroot}%{_sysconfdir}/murphy/murphy.lua
357
358 # Copy plugin configuration files in place.
359 mkdir -p %{buildroot}%{_sysconfdir}/murphy/plugins/amb
360 cp packaging.in/amb-config.lua \
361 %{buildroot}%{_sysconfdir}/murphy/plugins/amb/config.lua
362
363 # Copy tmpfiles.d config file in place
364 mkdir -p %{buildroot}%{_tmpfilesdir}
365 cp packaging.in/murphyd.conf %{buildroot}%{_tmpfilesdir}
366
367 # Copy the systemd files in place.
368 #mkdir -p %%{buildroot}%%{_unitdir}
369 mkdir -p %{buildroot}%{_unitdir_user}
370 cp packaging.in/murphyd.service %{buildroot}%{_unitdir_user}
371
372 %if %{with dbus}
373 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
374 sed "s/@TZ_SYS_USER_GROUP@/%{TZ_SYS_USER_GROUP}/g" \
375     packaging.in/org.Murphy.conf.in > packaging.in/org.Murphy.conf
376 cp packaging.in/org.Murphy.conf \
377     %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
378 %endif
379
380 # copy (experimental) GAM resource backend configuration files
381 mkdir -p %{buildroot}%{_sysconfdir}/murphy/gam
382 cp packaging.in/gam-*.names packaging.in/gam-*.tree \
383     %{buildroot}%{_sysconfdir}/murphy/gam
384
385 %clean
386 rm -rf %{buildroot}
387
388 %post
389 /bin/systemctl --user enable --global murphyd.service
390 setcap 'cap_net_admin=+ep' %{_bindir}/murphyd
391 ldconfig
392
393 %postun
394 if [ "$1" = "0" ]; then
395 systemctl --user disable --global murphyd.service
396 fi
397 ldconfig
398
399 %if %{with glib}
400 %post glib
401 ldconfig
402
403 %postun glib
404 ldconfig
405 %endif
406
407 %if %{with pulse}
408 %post pulse
409 ldconfig
410
411 %postun pulse
412 ldconfig
413 %endif
414
415 %if %{with ecore}
416 %post ecore
417 ldconfig
418
419 %postun ecore
420 ldconfig
421 %endif
422
423 %if %{with qt}
424 %post qt
425 ldconfig
426
427 %postun qt
428 ldconfig
429 %endif
430
431 %post gam
432 ldconfig
433
434 %postun gam
435 ldconfig
436
437 %files -f filelist.plugins-base
438 %defattr(-,root,root,-)
439 %manifest murphy.manifest
440 %{_bindir}/murphyd
441 %config %{_sysconfdir}/murphy
442 %{_unitdir_user}/murphyd.service
443 %{_tmpfilesdir}/murphyd.conf
444 %if %{with audiosession}
445 %{_sbindir}/asm-bridge
446 %endif
447 %if %{with dbus}
448 %{_sysconfdir}/dbus-1/system.d
449 %config %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
450 %endif
451 %if %{with websockets}
452 %{_datadir}/murphy
453 %endif
454
455 %{_libdir}/libmurphy-common.so.*
456 %{_libdir}/libmurphy-core.so.*
457 %{_libdir}/libmurphy-resolver.so.*
458 %{_libdir}/libmurphy-resource.so.*
459 %{_libdir}/libmurphy-resource-backend.so.*
460 %if %{with lua}
461 %{_libdir}/libmurphy-lua-utils.so.*
462 %{_libdir}/libmurphy-lua-decision.so.*
463 %endif
464 %{_libdir}/libmurphy-domain-controller.so.*
465 %{_libdir}/murphy/*.so.*
466 %{_libdir}/libbreedline*.so.*
467 %if %{with dbus}
468 %{_libdir}/libmurphy-libdbus.so.*
469 %{_libdir}/libmurphy-dbus-libdbus.so.*
470 %endif
471 %if %{with sysmon}
472 %{_libdir}/libmurphy-libdbus.so.*
473 %endif
474
475 %{_libdir}/murphy/plugins/plugin-domain-control.so
476 %{_libdir}/murphy/plugins/plugin-resource-asm.so
477 %{_libdir}/murphy/plugins/plugin-resource-native.so
478
479 %files devel -f filelist.devel-includes
480 %defattr(-,root,root,-)
481 %{_includedir}/murphy-db
482 %{_libdir}/libmurphy-common.so
483 %{_libdir}/libmurphy-core.so
484 %{_libdir}/libmurphy-resolver.so
485 %{_libdir}/libmurphy-resource.so
486 %{_libdir}/libmurphy-resource-backend.so
487 %if %{with lua}
488 %{_libdir}/libmurphy-lua-utils.so
489 %{_libdir}/libmurphy-lua-decision.so
490 %endif
491 %{_libdir}/libmurphy-domain-controller.so
492 %{_libdir}/murphy/*.so
493 %{_libdir}/pkgconfig/murphy-common.pc
494 %{_libdir}/pkgconfig/murphy-core.pc
495 %{_libdir}/pkgconfig/murphy-resolver.pc
496 %if %{with lua}
497 %{_libdir}/pkgconfig/murphy-lua-utils.pc
498 %{_libdir}/pkgconfig/murphy-lua-decision.pc
499 %endif
500 %{_libdir}/pkgconfig/murphy-domain-controller.pc
501 %{_libdir}/pkgconfig/murphy-db.pc
502 %{_libdir}/pkgconfig/murphy-resource.pc
503 %{_includedir}/breedline
504 %{_libdir}/libbreedline*.so
505 %{_libdir}/pkgconfig/breedline*.pc
506 %if %{with dbus}
507 %{_libdir}/libmurphy-libdbus.so
508 %{_libdir}/libmurphy-dbus-libdbus.so
509 %{_libdir}/pkgconfig/murphy-libdbus.pc
510 %{_libdir}/pkgconfig/murphy-dbus-libdbus.pc
511 %endif
512
513 %files doc
514 %defattr(-,root,root,-)
515 %doc %{_datadir}/doc/murphy/AUTHORS
516 %doc %{_datadir}/doc/murphy/CODING-STYLE
517 %doc %{_datadir}/doc/murphy/ChangeLog
518 %doc %{_datadir}/doc/murphy/NEWS
519 %doc %{_datadir}/doc/murphy/README
520 %license COPYING LICENSE-BSD
521
522 %if %{with pulse}
523 %files pulse
524 %defattr(-,root,root,-)
525 %{_libdir}/libmurphy-pulse.so.*
526 %manifest murphy.manifest
527
528 %files pulse-devel
529 %defattr(-,root,root,-)
530 %{_includedir}/murphy/common/pulse-glue.h
531 %{_libdir}/libmurphy-pulse.so
532 %{_libdir}/pkgconfig/murphy-pulse.pc
533 %endif
534
535 %if %{with ecore}
536 %files ecore
537 %defattr(-,root,root,-)
538 %{_libdir}/libmurphy-ecore.so.*
539 %manifest murphy.manifest
540
541 %files ecore-devel
542 %defattr(-,root,root,-)
543 %{_includedir}/murphy/common/ecore-glue.h
544 %{_libdir}/libmurphy-ecore.so
545 %{_libdir}/pkgconfig/murphy-ecore.pc
546 %endif
547
548 %if %{with glib}
549 %files glib
550 %defattr(-,root,root,-)
551 %{_libdir}/libmurphy-glib.so.*
552 %manifest murphy.manifest
553
554 %files glib-devel
555 %defattr(-,root,root,-)
556 %{_includedir}/murphy/common/glib-glue.h
557 %{_libdir}/libmurphy-glib.so
558 %{_libdir}/pkgconfig/murphy-glib.pc
559 %endif
560
561 %if %{with qt}
562 %files qt
563 %defattr(-,root,root,-)
564 %{_libdir}/libmurphy-qt.so.*
565 %manifest murphy.manifest
566
567 %files qt-devel
568 %defattr(-,root,root,-)
569 %{_includedir}/murphy/common/qt-glue.h
570 %{_libdir}/libmurphy-qt.so
571 %{_libdir}/pkgconfig/murphy-qt.pc
572 %endif
573
574 %files gam
575 %defattr(-,root,root,-)
576 %{_libdir}/libmurphy-decision-tree.so.*
577 %{_libdir}/libmurphy-decision-tree.so.0.0.0
578 %{_libdir}/murphy/plugins/plugin-gam-resource-manager.so
579
580 %files gam-devel
581 %defattr(-,root,root,-)
582 %{_bindir}/decision-test
583 %{_bindir}/pattern-generator
584 %{_libdir}/libmurphy-decision-tree.so
585
586 %files tests
587 %defattr(-,root,root,-)
588 %{_bindir}/resource-client
589 %{_bindir}/resource-api-test
590 %{_bindir}/resource-api-fuzz
591 %{_bindir}/resource-context-create
592 %{_bindir}/test-domain-controller
593 %{_bindir}/murphy-console
594 %manifest murphy.manifest
595
596 %if %{with icosyscon}
597 %files system-controller
598 %defattr(-,root,root,-)
599 %{_libdir}/murphy/plugins/plugin-system-controller.so
600 %manifest murphy.manifest
601 %endif