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_squashpkg:%{!?_without_squashpkg:%define _with_squashpkg 1}}
23 # TODO: take care of /lib vs /lib64...
24 %define systemddir /lib/systemd
26 Summary: Murphy policy framework
32 URL: http://01.org/murphy/
33 Source0: %{name}-%{version}.tar.gz
34 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
35 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
36 Requires: %{name}-core = %{version}
39 Requires(post): /bin/systemctl
40 Requires(postun): /bin/systemctl
44 BuildRequires: pkgconfig(lua)
45 BuildRequires: pkgconfig(libsystemd-daemon)
46 BuildRequires: pkgconfig(libsystemd-journal)
48 %if %{?_with_pulse:1}%{!?_with_pulse:0}
49 BuildRequires: pkgconfig(libpulse)
51 %if %{?_with_ecore:1}%{!?_with_ecore:0}
52 BuildRequires: pkgconfig(ecore)
53 BuildRequires: mesa-libEGL
54 BuildRequires: mesa-libGLESv2
56 %if %{?_with_glib:1}%{!?_with_glib:0}
57 BuildRequires: pkgconfig(glib-2.0)
59 %if %{?_with_qt:1}%{!?_with_qt:0}
60 BuildRequires: pkgconfig(QtCore)
62 %if %{?_with_dbus:1}%{!?_with_dbus:0}
63 BuildRequires: pkgconfig(dbus-1)
65 %if %{?_with_telephony:1}%{!?_with_telephony:0}
66 BuildRequires: pkgconfig(ofono)
68 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
69 BuildRequires: pkgconfig(audio-session-mgr)
71 %if %{?_with_websockets:1}%{!?_with_websockets:0}
72 BuildRequires: libwebsockets-devel
74 BuildRequires: pkgconfig(json)
76 %if %{?_with_smack:1}%{!?_with_smack:0}
77 BuildRequires: pkgconfig(libsmack)
80 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
82 Summary: Murphy core runtime libraries
83 Group: System/Libraries
86 Summary: The basic set of Murphy plugins
88 Requires: %{name} = %{version}
89 Requires: %{name}-core = %{version}
93 Summary: The header files and libraries needed for Murphy development
94 Group: System/Libraries
95 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
96 Requires: %{name}-core = %{version}
98 Requires: %{name} = %{version}
100 Requires: libjson-devel
103 Summary: Documentation for Murphy
104 Group: SDK/Documentation
106 %if %{?_with_pulse:1}%{!?_with_pulse:0}
108 Summary: Murphy PulseAudio mainloop integration
109 Group: System/Libraries
110 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
111 Requires: %{name}-core = %{version}
113 Requires: %{name} = %{version}
117 Summary: Murphy PulseAudio mainloop integration development files
118 Group: System/Libraries
119 Requires: %{name}-pulse = %{version}
120 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
121 Requires: %{name}-core = %{version}
123 Requires: %{name} = %{version}
127 %if %{?_with_ecore:1}%{!?_with_ecore:0}
129 Summary: Murphy EFL/ecore mainloop integration
130 Group: System/Libraries
131 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
132 Requires: %{name}-core = %{version}
134 Requires: %{name} = %{version}
138 Summary: Murphy EFL/ecore mainloop integration development files
139 Group: System/Libraries
140 Requires: %{name}-ecore = %{version}
141 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
142 Requires: %{name}-core = %{version}
144 Requires: %{name} = %{version}
148 %if %{?_with_glib:1}%{!?_with_glib:0}
150 Summary: Murphy glib mainloop integration
151 Group: System/Libraries
152 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
153 Requires: %{name}-core = %{version}
155 Requires: %{name} = %{version}
159 Summary: Murphy glib mainloop integration development files
160 Group: System/Libraries
161 Requires: %{name}-glib = %{version}
162 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
163 Requires: %{name}-core = %{version}
165 Requires: %{name} = %{version}
169 %if %{?_with_qt:1}%{!?_with_qt:0}
171 Summary: Murphy Qt mainloop integration
172 Group: System/Libraries
173 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
174 Requires: %{name}-core = %{version}
176 Requires: %{name} = %{version}
180 Summary: Murphy Qt mainloop integration development files
181 Group: System/Libraries
182 Requires: %{name}-qt = %{version}
183 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
184 Requires: %{name}-core = %{version}
186 Requires: %{name} = %{version}
191 Summary: Various test binaries for Murphy
192 Group: System/Testing
193 Requires: %{name} = %{version}
194 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
195 Requires: %{name}-core = %{version}
197 Requires: %{name} = %{version}
201 This package contains the basic daemon.
203 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
205 This package contains the core runtime libraries.
207 %description plugins-base
208 This package contains a basic set of plugins.
212 This package contains header files and libraries necessary for development.
215 This package contains documentation.
217 %if %{?_with_pulse:1}%{!?_with_pulse:0}
219 This package contains the Murphy PulseAudio mainloop integration runtime files.
221 %description pulse-devel
222 This package contains the Murphy PulseAudio mainloop integration development
226 %if %{?_with_ecore:1}%{!?_with_ecore:0}
228 This package contains the Murphy EFL/ecore mainloop integration runtime files.
230 %description ecore-devel
231 This package contains the Murphy EFL/ecore mainloop integration development
235 %if %{?_with_glib:1}%{!?_with_glib:0}
237 This package contains the Murphy glib mainloop integration runtime files.
239 %description glib-devel
240 This package contains the Murphy glib mainloop integration development
244 %if %{?_with_qt:1}%{!?_with_qt:0}
246 This package contains the Murphy Qt mainloop integration runtime files.
248 %description qt-devel
249 This package contains the Murphy Qt mainloop integration development
254 This package contains various test binaries for Murphy.
260 %if %{?_with_debug:1}%{!?_with_debug:0}
261 export CFLAGS="-O0 -g3"
266 DYNAMIC_PLUGINS="domain-control"
268 %if %{?_with_pulse:1}%{!?_with_pulse:0}
269 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
271 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
274 %if %{?_with_ecore:1}%{!?_with_ecore:0}
275 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
277 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
280 %if %{?_with_glib:1}%{!?_with_glib:0}
281 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
283 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
286 %if %{?_with_qt:1}%{!?_with_qt:0}
287 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
289 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
292 %if %{?_with_dbus:1}%{!?_with_dbus:0}
293 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
295 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
298 %if %{?_with_telephony:1}%{!?_with_telephony:0}
299 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
301 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
304 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
305 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-resource-asm"
306 DYNAMIC_PLUGINS="$DYNAMIC_PLUGINS,resource-asm"
308 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-resource-asm"
311 %if %{?_with_websockets:1}%{!?_with_websockets:0}
312 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-websockets"
314 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
317 %if %{?_with_smack:1}%{!?_with_smack:0}
318 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-smack"
320 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
323 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
324 grep '^processor *:' | wc -l`"
325 [ -z "$NUM_CPUS" ] && NUM_CPUS=1
328 %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS && \
330 make -j$(($NUM_CPUS + 1)) $V
333 rm -rf $RPM_BUILD_ROOT
336 # Make sure we have a plugin dir even if all the basic plugins
337 # are configured to be built in.
338 mkdir -p $RPM_BUILD_ROOT%{_libdir}/murphy/plugins
340 # Get rid of any *.la files installed by libtool.
341 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
343 # Clean up also the murphy DB installation.
344 rm -f $RPM_BUILD_ROOT%{_libdir}/murphy/*.la
346 # Generate list of linkedin plugins (depends on the configuration).
348 pushd $RPM_BUILD_ROOT >& /dev/null && \
349 find ./%{_libdir}/murphy/plugins -name libmurphy-plugin-*.so* | \
350 sed 's#^./*#/#g' > $outdir/filelist.plugins-base && \
353 # Generate list of header files, filtering ones that go to subpackages.
355 pushd $RPM_BUILD_ROOT >& /dev/null && \
356 find ./%{_includedir}/murphy | \
357 egrep -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
358 sed 's#^./*#/#g' > $outdir/filelist.devel-includes && \
361 # Replace the default sample/test config files with the packaging ones.
362 cp packaging.in/murphy-lua.conf $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.conf
363 cp packaging.in/murphy.lua $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.lua
365 # Copy plugin configuration files in place.
366 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb
367 cp packaging.in/amb-config.lua \
368 $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb/config.lua
370 # Copy tmpfiles.d config file in place
371 mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
372 cp packaging.in/murphyd.conf $RPM_BUILD_ROOT%{_tmpfilesdir}
374 # Copy the systemd service file in place.
375 mkdir -p $RPM_BUILD_ROOT%{systemddir}/system
376 cp packaging.in/murphyd.service $RPM_BUILD_ROOT%{systemddir}/system
378 %if %{?_with_dbus:1}%{!?_with_dbus:0}
379 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
380 cp packaging.in/org.Murphy.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
384 rm -rf $RPM_BUILD_ROOT
387 /bin/systemctl enable murphyd.service
389 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
395 if [ "$1" = "0" ]; then
396 /bin/systemctl disable murphyd.service
399 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
404 %if %{?_with_glib:1}%{!?_with_glib:0}
412 %if %{?_with_pulse:1}%{!?_with_pulse:0}
420 %if %{?_with_ecore:1}%{!?_with_ecore:0}
428 %if %{?_with_qt:1}%{!?_with_qt:0}
436 %if %{?_with_squashpkg:1}%{!?_with_squashpkg:0}
437 %files -f filelist.plugins-base
441 %defattr(-,root,root,-)
443 %config %{_sysconfdir}/murphy
444 %{systemddir}/system/murphyd.service
445 %{_tmpfilesdir}/murphyd.conf
446 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
447 %{_sbindir}/asm-bridge
449 %if %{?_with_dbus:1}%{!?_with_dbus:0}
450 %{_sysconfdir}/dbus-1/system.d
451 %config %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
453 %if %{?_with_websockets:1}%{!?_with_websockets:0}
457 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
459 %defattr(-,root,root,-)
461 %{_libdir}/libmurphy-common.so.*
462 %{_libdir}/libmurphy-core.so.*
463 %{_libdir}/libmurphy-resolver.so.*
464 %{_libdir}/libmurphy-resource.so.*
465 %{_libdir}/libmurphy-resource-backend.so.*
466 %if %{?_with_lua:1}%{!?_with_lua:0}
467 %{_libdir}/libmurphy-lua-utils.so.*
468 %{_libdir}/libmurphy-lua-decision.so.*
470 %{_libdir}/libmurphy-domain-controller.so.*
471 %{_libdir}/murphy/*.so.*
472 %{_libdir}/libbreedline*.so.*
473 %if %{?_with_dbus:1}%{!?_with_dbus:0}
474 %{_libdir}/libmurphy-dbus.so.*
477 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
478 %files plugins-base -f filelist.plugins-base
479 %defattr(-,root,root,-)
481 %{_libdir}/murphy/plugins
483 %files devel -f filelist.devel-includes
484 %defattr(-,root,root,-)
485 # %{_includedir}/murphy/config.h
486 # %{_includedir}/murphy/common.h
487 # #%{_includedir}/murphy/core.h
488 # %{_includedir}/murphy/common
489 # %{_includedir}/murphy/core
490 # %{_includedir}/murphy/resolver
491 # %{_includedir}/murphy/resource
492 # # hmmm... should handle disabled plugins properly.
493 # %{_includedir}/murphy/domain-control
494 # %{_includedir}/murphy/plugins
495 %{_includedir}/murphy-db
496 %{_libdir}/libmurphy-common.so
497 %{_libdir}/libmurphy-core.so
498 %{_libdir}/libmurphy-resolver.so
499 %{_libdir}/libmurphy-resource.so
500 %{_libdir}/libmurphy-resource-backend.so
501 %if %{?_with_lua:1}%{!?_with_lua:0}
502 %{_libdir}/libmurphy-lua-utils.so
503 %{_libdir}/libmurphy-lua-decision.so
505 %{_libdir}/libmurphy-domain-controller.so
506 %{_libdir}/murphy/*.so
507 %{_libdir}/pkgconfig/murphy-common.pc
508 %{_libdir}/pkgconfig/murphy-core.pc
509 %{_libdir}/pkgconfig/murphy-resolver.pc
510 #%{_libdir}/pkgconfig/murphy-resource.pc
511 %if %{?_with_lua:1}%{!?_with_lua:0}
512 %{_libdir}/pkgconfig/murphy-lua-utils.pc
513 %{_libdir}/pkgconfig/murphy-lua-decision.pc
515 %{_libdir}/pkgconfig/murphy-domain-controller.pc
516 %{_libdir}/pkgconfig/murphy-db.pc
517 %{_libdir}/pkgconfig/murphy-resource.pc
518 %{_includedir}/breedline
519 %{_libdir}/libbreedline*.so
520 %{_libdir}/pkgconfig/breedline*.pc
521 %if %{?_with_dbus:1}%{!?_with_dbus:0}
522 #%{_includedir}/murphy/dbus
523 %{_libdir}/libmurphy-dbus.so
524 %{_libdir}/pkgconfig/murphy-dbus.pc
528 %defattr(-,root,root,-)
529 %doc %{_docdir}/../murphy/AUTHORS
530 %doc %{_docdir}/../murphy/CODING-STYLE
531 %license %{_docdir}/../murphy/COPYING
532 %doc %{_docdir}/../murphy/ChangeLog
533 %doc %{_docdir}/../murphy/INSTALL
534 %doc %{_docdir}/../murphy/NEWS
535 %doc %{_docdir}/../murphy/README
537 %if %{?_with_pulse:1}%{!?_with_pulse:0}
539 %defattr(-,root,root,-)
540 %{_libdir}/libmurphy-pulse.so.*
543 %defattr(-,root,root,-)
544 %{_includedir}/murphy/common/pulse-glue.h
545 %{_libdir}/libmurphy-pulse.so
546 %{_libdir}/pkgconfig/murphy-pulse.pc
549 %if %{?_with_ecore:1}%{!?_with_ecore:0}
551 %defattr(-,root,root,-)
552 %{_libdir}/libmurphy-ecore.so.*
555 %defattr(-,root,root,-)
556 %{_includedir}/murphy/common/ecore-glue.h
557 %{_libdir}/libmurphy-ecore.so
558 %{_libdir}/pkgconfig/murphy-ecore.pc
561 %if %{?_with_glib:1}%{!?_with_glib:0}
563 %defattr(-,root,root,-)
564 %{_libdir}/libmurphy-glib.so.*
567 %defattr(-,root,root,-)
568 %{_includedir}/murphy/common/glib-glue.h
569 %{_libdir}/libmurphy-glib.so
570 %{_libdir}/pkgconfig/murphy-glib.pc
573 %if %{?_with_qt:1}%{!?_with_qt:0}
575 %defattr(-,root,root,-)
576 %{_libdir}/libmurphy-qt.so.*
579 %defattr(-,root,root,-)
580 %{_includedir}/murphy/common/qt-glue.h
581 %{_libdir}/libmurphy-qt.so
582 %{_libdir}/pkgconfig/murphy-qt.pc
586 %defattr(-,root,root,-)
587 %{_bindir}/resource-client
588 %{_bindir}/resource-api-test
589 %{_bindir}/resource-api-fuzz
590 %{_bindir}/test-domain-controller
591 %{_bindir}/murphy-console
594 * Tue Nov 27 2012 Krisztian Litkey <krisztian.litkey@intel.com> -
595 - Initial build for 2.0alpha.