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 the systemd service file in place.
371 mkdir -p $RPM_BUILD_ROOT%{systemddir}/system
372 cp packaging.in/murphyd.service $RPM_BUILD_ROOT%{systemddir}/system
374 %if %{?_with_dbus:1}%{!?_with_dbus:0}
375 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
376 cp packaging.in/org.Murphy.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
380 rm -rf $RPM_BUILD_ROOT
383 /bin/systemctl enable murphyd.service
385 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
391 if [ "$1" = "0" ]; then
392 /bin/systemctl disable murphyd.service
395 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
400 %if %{?_with_glib:1}%{!?_with_glib:0}
408 %if %{?_with_pulse:1}%{!?_with_pulse:0}
416 %if %{?_with_ecore:1}%{!?_with_ecore:0}
424 %if %{?_with_qt:1}%{!?_with_qt:0}
432 %if %{?_with_squashpkg:1}%{!?_with_squashpkg:0}
433 %files -f filelist.plugins-base
437 %defattr(-,root,root,-)
439 %config %{_sysconfdir}/murphy
440 %{systemddir}/system/murphyd.service
441 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
442 %{_sbindir}/asm-bridge
444 %if %{?_with_dbus:1}%{!?_with_dbus:0}
445 %{_sysconfdir}/dbus-1/system.d
446 %config %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
448 %if %{?_with_websockets:1}%{!?_with_websockets:0}
452 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
454 %defattr(-,root,root,-)
456 %{_libdir}/libmurphy-common.so.*
457 %{_libdir}/libmurphy-core.so.*
458 %{_libdir}/libmurphy-resolver.so.*
459 %{_libdir}/libmurphy-resource.so.*
460 %{_libdir}/libmurphy-resource-backend.so.*
461 %if %{?_with_lua:1}%{!?_with_lua:0}
462 %{_libdir}/libmurphy-lua-utils.so.*
463 %{_libdir}/libmurphy-lua-decision.so.*
465 %{_libdir}/libmurphy-domain-controller.so.*
466 %{_libdir}/murphy/*.so.*
467 %{_libdir}/libbreedline*.so.*
468 %if %{?_with_dbus:1}%{!?_with_dbus:0}
469 %{_libdir}/libmurphy-dbus.so.*
472 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
473 %files plugins-base -f filelist.plugins-base
474 %defattr(-,root,root,-)
476 %{_libdir}/murphy/plugins
478 %files devel -f filelist.devel-includes
479 %defattr(-,root,root,-)
480 # %{_includedir}/murphy/config.h
481 # %{_includedir}/murphy/common.h
482 # #%{_includedir}/murphy/core.h
483 # %{_includedir}/murphy/common
484 # %{_includedir}/murphy/core
485 # %{_includedir}/murphy/resolver
486 # %{_includedir}/murphy/resource
487 # # hmmm... should handle disabled plugins properly.
488 # %{_includedir}/murphy/domain-control
489 # %{_includedir}/murphy/plugins
490 %{_includedir}/murphy-db
491 %{_libdir}/libmurphy-common.so
492 %{_libdir}/libmurphy-core.so
493 %{_libdir}/libmurphy-resolver.so
494 %{_libdir}/libmurphy-resource.so
495 %{_libdir}/libmurphy-resource-backend.so
496 %if %{?_with_lua:1}%{!?_with_lua:0}
497 %{_libdir}/libmurphy-lua-utils.so
498 %{_libdir}/libmurphy-lua-decision.so
500 %{_libdir}/libmurphy-domain-controller.so
501 %{_libdir}/murphy/*.so
502 %{_libdir}/pkgconfig/murphy-common.pc
503 %{_libdir}/pkgconfig/murphy-core.pc
504 %{_libdir}/pkgconfig/murphy-resolver.pc
505 #%{_libdir}/pkgconfig/murphy-resource.pc
506 %if %{?_with_lua:1}%{!?_with_lua:0}
507 %{_libdir}/pkgconfig/murphy-lua-utils.pc
508 %{_libdir}/pkgconfig/murphy-lua-decision.pc
510 %{_libdir}/pkgconfig/murphy-domain-controller.pc
511 %{_libdir}/pkgconfig/murphy-db.pc
512 %{_libdir}/pkgconfig/murphy-resource.pc
513 %{_includedir}/breedline
514 %{_libdir}/libbreedline*.so
515 %{_libdir}/pkgconfig/breedline*.pc
516 %if %{?_with_dbus:1}%{!?_with_dbus:0}
517 #%{_includedir}/murphy/dbus
518 %{_libdir}/libmurphy-dbus.so
519 %{_libdir}/pkgconfig/murphy-dbus.pc
523 %defattr(-,root,root,-)
524 %doc %{_docdir}/../murphy/AUTHORS
525 %doc %{_docdir}/../murphy/CODING-STYLE
526 %license %{_docdir}/../murphy/COPYING
527 %doc %{_docdir}/../murphy/ChangeLog
528 %doc %{_docdir}/../murphy/INSTALL
529 %doc %{_docdir}/../murphy/NEWS
530 %doc %{_docdir}/../murphy/README
532 %if %{?_with_pulse:1}%{!?_with_pulse:0}
534 %defattr(-,root,root,-)
535 %{_libdir}/libmurphy-pulse.so.*
538 %defattr(-,root,root,-)
539 %{_includedir}/murphy/common/pulse-glue.h
540 %{_libdir}/libmurphy-pulse.so
541 %{_libdir}/pkgconfig/murphy-pulse.pc
544 %if %{?_with_ecore:1}%{!?_with_ecore:0}
546 %defattr(-,root,root,-)
547 %{_libdir}/libmurphy-ecore.so.*
550 %defattr(-,root,root,-)
551 %{_includedir}/murphy/common/ecore-glue.h
552 %{_libdir}/libmurphy-ecore.so
553 %{_libdir}/pkgconfig/murphy-ecore.pc
556 %if %{?_with_glib:1}%{!?_with_glib:0}
558 %defattr(-,root,root,-)
559 %{_libdir}/libmurphy-glib.so.*
562 %defattr(-,root,root,-)
563 %{_includedir}/murphy/common/glib-glue.h
564 %{_libdir}/libmurphy-glib.so
565 %{_libdir}/pkgconfig/murphy-glib.pc
568 %if %{?_with_qt:1}%{!?_with_qt:0}
570 %defattr(-,root,root,-)
571 %{_libdir}/libmurphy-qt.so.*
574 %defattr(-,root,root,-)
575 %{_includedir}/murphy/common/qt-glue.h
576 %{_libdir}/libmurphy-qt.so
577 %{_libdir}/pkgconfig/murphy-qt.pc
581 %defattr(-,root,root,-)
582 %{_bindir}/resource-client
583 %{_bindir}/resource-api-test
584 %{_bindir}/resource-api-fuzz
585 %{_bindir}/test-domain-controller
586 %{_bindir}/murphy-console
589 * Tue Nov 27 2012 Krisztian Litkey <krisztian.litkey@intel.com> -
590 - Initial build for 2.0alpha.