1 # By default we build with distro-default compilation flags which
2 # enables optimizations. If you want to build with full debugging
3 # ie. with optimization turned off and full debug info (-O0 -g3)
4 # pass '--with debug' to rpmbuild on the command line. Similary
5 # you can chose to compile with/without pulse, ecore, glib, qt,
6 # dbus, and telephony support. --without squashpkg will prevent
7 # squashing the -core and -plugins-base packages into the base
10 %{!?_with_debug:%{!?_without_debug:%define _without_debug 0}}
11 %{!?_with_lua:%{!?_without_lua:%define _with_lua 1}}
12 %{!?_with_pulse:%{!?_without_pulse:%define _with_pulse 1}}
13 %{!?_with_ecore:%{!?_without_ecore:%define _with_ecore 1}}
14 %{!?_with_glib:%{!?_without_glib:%define _with_glib 1}}
15 %{!?_with_qt:%{!?_without_qt:%define _without_qt 1}}
16 %{!?_with_dbus:%{!?_without_dbus:%define _with_dbus 1}}
17 %{!?_with_telephony:%{!?_without_telephony:%define _with_telephony 1}}
18 %{!?_with_audiosession:%{!?_without_audiosession:%define _with_audiosession 1}}
19 %{!?_with_websockets:%{!?_without_websockets:%define _with_websockets 1}}
20 %{!?_with_smack:%{!?_without_smack:%define _with_smack 1}}
21 %{!?_with_icosyscon:%{!?_without_icosyscon:%define _with_icosyscon 1}}
22 %{!?_with_squashpkg:%{!?_without_squashpkg:%define _with_squashpkg 1}}
24 # TODO: take care of /lib vs /lib64...
25 %define systemddir /lib/systemd
27 Summary: Murphy policy framework
33 URL: http://01.org/murphy/
34 Source0: %{name}-%{version}.tar.gz
35 Source1: murphy.manifest
36 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
37 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
38 Requires: %{name}-core = %{version}
41 Requires(post): /bin/systemctl
42 Requires(postun): /bin/systemctl
46 BuildRequires: pkgconfig(lua)
47 BuildRequires: pkgconfig(libsystemd-daemon)
48 BuildRequires: pkgconfig(libsystemd-journal)
50 %if %{?_with_pulse:1}%{!?_with_pulse:0}
51 BuildRequires: pkgconfig(libpulse)
53 %if %{?_with_ecore:1}%{!?_with_ecore:0}
54 BuildRequires: pkgconfig(ecore)
55 BuildRequires: mesa-libEGL
56 BuildRequires: mesa-libGLESv2
58 %if %{?_with_glib:1}%{!?_with_glib:0}
59 BuildRequires: pkgconfig(glib-2.0)
61 %if %{?_with_qt:1}%{!?_with_qt:0}
62 BuildRequires: pkgconfig(QtCore)
64 %if %{?_with_dbus:1}%{!?_with_dbus:0}
65 BuildRequires: pkgconfig(dbus-1)
67 %if %{?_with_telephony:1}%{!?_with_telephony:0}
68 BuildRequires: pkgconfig(ofono)
70 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
71 BuildRequires: pkgconfig(audio-session-mgr)
72 BuildRequires: pkgconfig(aul)
74 %if %{?_with_websockets:1}%{!?_with_websockets:0}
75 BuildRequires: libwebsockets-devel
77 BuildRequires: pkgconfig(json)
79 %if %{?_with_smack:1}%{!?_with_smack:0}
80 BuildRequires: pkgconfig(libsmack)
83 %if %{?_with_icosyscon:1}%{!?_with_icosyscon:0}
84 BuildRequires: ico-uxf-weston-plugin-devel
85 BuildRequires: pkgconfig(ail)
88 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
90 Summary: Murphy core runtime libraries
91 Group: System/Libraries
94 Summary: The basic set of Murphy plugins
96 Requires: %{name} = %{version}
97 Requires: %{name}-core = %{version}
101 Summary: The header files and libraries needed for Murphy development
102 Group: System/Libraries
103 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
104 Requires: %{name}-core = %{version}
106 Requires: %{name} = %{version}
108 Requires: libjson-devel
111 Summary: Documentation for Murphy
112 Group: SDK/Documentation
114 %if %{?_with_pulse:1}%{!?_with_pulse:0}
116 Summary: Murphy PulseAudio mainloop integration
117 Group: System/Libraries
118 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
119 Requires: %{name}-core = %{version}
121 Requires: %{name} = %{version}
125 Summary: Murphy PulseAudio mainloop integration development files
126 Group: System/Libraries
127 Requires: %{name}-pulse = %{version}
128 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
129 Requires: %{name}-core = %{version}
131 Requires: %{name} = %{version}
135 %if %{?_with_ecore:1}%{!?_with_ecore:0}
137 Summary: Murphy EFL/ecore mainloop integration
138 Group: System/Libraries
139 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
140 Requires: %{name}-core = %{version}
142 Requires: %{name} = %{version}
146 Summary: Murphy EFL/ecore mainloop integration development files
147 Group: System/Libraries
148 Requires: %{name}-ecore = %{version}
149 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
150 Requires: %{name}-core = %{version}
152 Requires: %{name} = %{version}
156 %if %{?_with_glib:1}%{!?_with_glib:0}
158 Summary: Murphy glib mainloop integration
159 Group: System/Libraries
160 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
161 Requires: %{name}-core = %{version}
163 Requires: %{name} = %{version}
167 Summary: Murphy glib mainloop integration development files
168 Group: System/Libraries
169 Requires: %{name}-glib = %{version}
170 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
171 Requires: %{name}-core = %{version}
173 Requires: %{name} = %{version}
177 %if %{?_with_qt:1}%{!?_with_qt:0}
179 Summary: Murphy Qt mainloop integration
180 Group: System/Libraries
181 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
182 Requires: %{name}-core = %{version}
184 Requires: %{name} = %{version}
188 Summary: Murphy Qt mainloop integration development files
189 Group: System/Libraries
190 Requires: %{name}-qt = %{version}
191 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
192 Requires: %{name}-core = %{version}
194 Requires: %{name} = %{version}
199 Summary: Various test binaries for Murphy
200 Group: System/Testing
201 Requires: %{name} = %{version}
202 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
203 Requires: %{name}-core = %{version}
205 Requires: %{name} = %{version}
208 %package ivi-resource-manager
209 Summary: Murphy IVI resource manager plugin
210 Group: System/Service
212 %if %{?_with_icosyscon:1}%{!?_with_icosyscon:0}
213 %package system-controller
214 Summary: Murphy IVI resource manager plugin
215 Group: System/Service
219 This package contains the basic daemon.
221 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
223 This package contains the core runtime libraries.
225 %description plugins-base
226 This package contains a basic set of plugins.
230 This package contains header files and libraries necessary for development.
233 This package contains documentation.
235 %if %{?_with_pulse:1}%{!?_with_pulse:0}
237 This package contains the Murphy PulseAudio mainloop integration runtime files.
239 %description pulse-devel
240 This package contains the Murphy PulseAudio mainloop integration development
244 %if %{?_with_ecore:1}%{!?_with_ecore:0}
246 This package contains the Murphy EFL/ecore mainloop integration runtime files.
248 %description ecore-devel
249 This package contains the Murphy EFL/ecore mainloop integration development
253 %if %{?_with_glib:1}%{!?_with_glib:0}
255 This package contains the Murphy glib mainloop integration runtime files.
257 %description glib-devel
258 This package contains the Murphy glib mainloop integration development
262 %if %{?_with_qt:1}%{!?_with_qt:0}
264 This package contains the Murphy Qt mainloop integration runtime files.
266 %description qt-devel
267 This package contains the Murphy Qt mainloop integration development
272 This package contains various test binaries for Murphy.
274 %description ivi-resource-manager
275 This package contains the Murphy IVI resource manager plugin.
277 %if %{?_with_icosyscon:1}%{!?_with_icosyscon:0}
278 %description system-controller
279 This package contains the Murphy IVI resource manager plugin.
286 %if %{?_with_debug:1}%{!?_with_debug:0}
287 export CFLAGS="-O0 -g3"
292 DYNAMIC_PLUGINS="domain-control,system-controller,ivi-resource-manager"
294 %if %{?_with_pulse:1}%{!?_with_pulse:0}
295 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
297 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
300 %if %{?_with_ecore:1}%{!?_with_ecore:0}
301 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
303 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
306 %if %{?_with_glib:1}%{!?_with_glib:0}
307 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
309 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
312 %if %{?_with_qt:1}%{!?_with_qt:0}
313 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
315 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
318 %if %{?_with_dbus:1}%{!?_with_dbus:0}
319 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
321 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
324 %if %{?_with_telephony:1}%{!?_with_telephony:0}
325 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
327 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
330 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
331 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-resource-asm"
332 DYNAMIC_PLUGINS="$DYNAMIC_PLUGINS,resource-asm"
334 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-resource-asm"
337 %if %{?_with_websockets:1}%{!?_with_websockets:0}
338 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-websockets"
340 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
343 %if %{?_with_smack:1}%{!?_with_smack:0}
344 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-smack"
346 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
349 %if %{?_with_icosyscon:1}%{!?_with_icosyscon:0}
350 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-system-controller"
352 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-system-controller"
355 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
356 grep '^processor *:' | wc -l`"
357 [ -z "$NUM_CPUS" ] && NUM_CPUS=1
360 %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS && \
362 make -j$(($NUM_CPUS + 1)) $V
365 rm -rf $RPM_BUILD_ROOT
368 # Make sure we have a plugin dir even if all the basic plugins
369 # are configured to be built in.
370 mkdir -p $RPM_BUILD_ROOT%{_libdir}/murphy/plugins
372 # Get rid of any *.la files installed by libtool.
373 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
375 # Clean up also the murphy DB installation.
376 rm -f $RPM_BUILD_ROOT%{_libdir}/murphy/*.la
378 # Generate list of linkedin plugins (depends on the configuration).
380 pushd $RPM_BUILD_ROOT >& /dev/null && \
381 find ./%{_libdir}/murphy/plugins -name libmurphy-plugin-*.so* | \
382 sed 's#^./*#/#g' > $outdir/filelist.plugins-base && \
385 # Generate list of header files, filtering ones that go to subpackages.
387 pushd $RPM_BUILD_ROOT >& /dev/null && \
388 find ./%{_includedir}/murphy | \
389 egrep -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
390 sed 's#^./*#/#g' > $outdir/filelist.devel-includes && \
393 # Replace the default sample/test config files with the packaging ones.
394 cp packaging.in/murphy-lua.conf $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.conf
395 cp packaging.in/murphy.lua $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.lua
397 # Copy plugin configuration files in place.
398 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb
399 cp packaging.in/amb-config.lua \
400 $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb/config.lua
402 # Copy tmpfiles.d config file in place
403 mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
404 cp packaging.in/murphyd.conf $RPM_BUILD_ROOT%{_tmpfilesdir}
406 # Copy the systemd service file in place.
407 mkdir -p $RPM_BUILD_ROOT%{systemddir}/system
408 cp packaging.in/murphyd.service $RPM_BUILD_ROOT%{systemddir}/system
410 %if %{?_with_dbus:1}%{!?_with_dbus:0}
411 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
412 cp packaging.in/org.Murphy.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
415 # copy the manifest file
416 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy.manifest
417 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy-tests.manifest
418 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy-ivi-resource-manager.manifest
419 %if %{?_with_qt:1}%{!?_with_qt:0}
420 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy-qt.manifest
422 %if %{?_with_glib:1}%{!?_with_glib:0}
423 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy-glib.manifest
425 %if %{?_with_pulse:1}%{!?_with_pulse:0}
426 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy-pulse.manifest
428 %if %{?_with_ecore:1}%{!?_with_ecore:0}
429 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy-ecore.manifest
431 %if %{?_with_icosyscon:1}%{!?_with_icosyscon:0}
432 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/murphy-system-controller.manifest
436 rm -rf $RPM_BUILD_ROOT
439 /bin/systemctl enable murphyd.service
441 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
447 if [ "$1" = "0" ]; then
448 /bin/systemctl disable murphyd.service
451 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
456 %if %{?_with_glib:1}%{!?_with_glib:0}
464 %if %{?_with_pulse:1}%{!?_with_pulse:0}
472 %if %{?_with_ecore:1}%{!?_with_ecore:0}
480 %if %{?_with_qt:1}%{!?_with_qt:0}
488 %if %{?_with_squashpkg:1}%{!?_with_squashpkg:0}
489 %files -f filelist.plugins-base
493 %defattr(-,root,root,-)
494 %manifest %{_datadir}/murphy.manifest
496 %config %{_sysconfdir}/murphy
497 %{systemddir}/system/murphyd.service
498 %{_tmpfilesdir}/murphyd.conf
499 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
500 %{_sbindir}/asm-bridge
502 %if %{?_with_dbus:1}%{!?_with_dbus:0}
503 %{_sysconfdir}/dbus-1/system.d
504 %config %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
506 %if %{?_with_websockets:1}%{!?_with_websockets:0}
510 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
512 %defattr(-,root,root,-)
514 %{_libdir}/libmurphy-common.so.*
515 %{_libdir}/libmurphy-core.so.*
516 %{_libdir}/libmurphy-resolver.so.*
517 %{_libdir}/libmurphy-resource.so.*
518 %{_libdir}/libmurphy-resource-backend.so.*
519 %if %{?_with_lua:1}%{!?_with_lua:0}
520 %{_libdir}/libmurphy-lua-utils.so.*
521 %{_libdir}/libmurphy-lua-decision.so.*
523 %{_libdir}/libmurphy-domain-controller.so.*
524 %{_libdir}/murphy/*.so.*
525 %{_libdir}/libbreedline*.so.*
526 %if %{?_with_dbus:1}%{!?_with_dbus:0}
527 %{_libdir}/libmurphy-dbus.so.*
530 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
531 %files plugins-base -f filelist.plugins-base
532 %defattr(-,root,root,-)
534 %{_libdir}/murphy/plugins/plugin-domain-control.so
535 %{_libdir}/murphy/plugins/plugin-resource-asm.so
536 %{_libdir}/murphy/plugins/plugin-resource-native.so
538 %files devel -f filelist.devel-includes
539 %defattr(-,root,root,-)
540 # %{_includedir}/murphy/config.h
541 # %{_includedir}/murphy/common.h
542 # #%{_includedir}/murphy/core.h
543 # %{_includedir}/murphy/common
544 # %{_includedir}/murphy/core
545 # %{_includedir}/murphy/resolver
546 # %{_includedir}/murphy/resource
547 # # hmmm... should handle disabled plugins properly.
548 # %{_includedir}/murphy/domain-control
549 # %{_includedir}/murphy/plugins
550 %{_includedir}/murphy-db
551 %{_libdir}/libmurphy-common.so
552 %{_libdir}/libmurphy-core.so
553 %{_libdir}/libmurphy-resolver.so
554 %{_libdir}/libmurphy-resource.so
555 %{_libdir}/libmurphy-resource-backend.so
556 %if %{?_with_lua:1}%{!?_with_lua:0}
557 %{_libdir}/libmurphy-lua-utils.so
558 %{_libdir}/libmurphy-lua-decision.so
560 %{_libdir}/libmurphy-domain-controller.so
561 %{_libdir}/murphy/*.so
562 %{_libdir}/pkgconfig/murphy-common.pc
563 %{_libdir}/pkgconfig/murphy-core.pc
564 %{_libdir}/pkgconfig/murphy-resolver.pc
565 #%{_libdir}/pkgconfig/murphy-resource.pc
566 %if %{?_with_lua:1}%{!?_with_lua:0}
567 %{_libdir}/pkgconfig/murphy-lua-utils.pc
568 %{_libdir}/pkgconfig/murphy-lua-decision.pc
570 %{_libdir}/pkgconfig/murphy-domain-controller.pc
571 %{_libdir}/pkgconfig/murphy-db.pc
572 %{_libdir}/pkgconfig/murphy-resource.pc
573 %{_includedir}/breedline
574 %{_libdir}/libbreedline*.so
575 %{_libdir}/pkgconfig/breedline*.pc
576 %if %{?_with_dbus:1}%{!?_with_dbus:0}
577 #%{_includedir}/murphy/dbus
578 %{_libdir}/libmurphy-dbus.so
579 %{_libdir}/pkgconfig/murphy-dbus.pc
583 %defattr(-,root,root,-)
584 %doc %{_docdir}/../murphy/AUTHORS
585 %doc %{_docdir}/../murphy/CODING-STYLE
586 %license %{_docdir}/../murphy/COPYING
587 %doc %{_docdir}/../murphy/ChangeLog
588 %doc %{_docdir}/../murphy/INSTALL
589 %doc %{_docdir}/../murphy/NEWS
590 %doc %{_docdir}/../murphy/README
592 %if %{?_with_pulse:1}%{!?_with_pulse:0}
594 %defattr(-,root,root,-)
595 %{_libdir}/libmurphy-pulse.so.*
596 %manifest %{_datadir}/murphy-pulse.manifest
599 %defattr(-,root,root,-)
600 %{_includedir}/murphy/common/pulse-glue.h
601 %{_libdir}/libmurphy-pulse.so
602 %{_libdir}/pkgconfig/murphy-pulse.pc
605 %if %{?_with_ecore:1}%{!?_with_ecore:0}
607 %defattr(-,root,root,-)
608 %{_libdir}/libmurphy-ecore.so.*
609 %manifest %{_datadir}/murphy-ecore.manifest
612 %defattr(-,root,root,-)
613 %{_includedir}/murphy/common/ecore-glue.h
614 %{_libdir}/libmurphy-ecore.so
615 %{_libdir}/pkgconfig/murphy-ecore.pc
618 %if %{?_with_glib:1}%{!?_with_glib:0}
620 %defattr(-,root,root,-)
621 %{_libdir}/libmurphy-glib.so.*
622 %manifest %{_datadir}/murphy-glib.manifest
625 %defattr(-,root,root,-)
626 %{_includedir}/murphy/common/glib-glue.h
627 %{_libdir}/libmurphy-glib.so
628 %{_libdir}/pkgconfig/murphy-glib.pc
631 %if %{?_with_qt:1}%{!?_with_qt:0}
633 %defattr(-,root,root,-)
634 %{_libdir}/libmurphy-qt.so.*
635 %manifest %{_datadir}/murphy-qt.manifest
638 %defattr(-,root,root,-)
639 %{_includedir}/murphy/common/qt-glue.h
640 %{_libdir}/libmurphy-qt.so
641 %{_libdir}/pkgconfig/murphy-qt.pc
645 %defattr(-,root,root,-)
646 %{_bindir}/resource-client
647 %{_bindir}/resource-api-test
648 %{_bindir}/resource-api-fuzz
649 %{_bindir}/test-domain-controller
650 %{_bindir}/murphy-console
651 %manifest %{_datadir}/murphy-tests.manifest
653 %files ivi-resource-manager
654 %defattr(-,root,root,-)
655 %{_libdir}/murphy/plugins/plugin-ivi-resource-manager.so
656 %manifest %{_datadir}/murphy-ivi-resource-manager.manifest
658 %if %{?_with_icosyscon:1}%{!?_with_icosyscon:0}
659 %files system-controller
660 %defattr(-,root,root,-)
661 %{_libdir}/murphy/plugins/plugin-system-controller.so
662 %manifest %{_datadir}/murphy-system-controller.manifest
666 * Tue Nov 27 2012 Krisztian Litkey <krisztian.litkey@intel.com> -
667 - Initial build for 2.0alpha.