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)
70 BuildRequires: pkgconfig(aul)
72 %if %{?_with_websockets:1}%{!?_with_websockets:0}
73 BuildRequires: libwebsockets-devel
75 BuildRequires: pkgconfig(json)
77 %if %{?_with_smack:1}%{!?_with_smack:0}
78 BuildRequires: pkgconfig(libsmack)
81 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
83 Summary: Murphy core runtime libraries
84 Group: System/Libraries
87 Summary: The basic set of Murphy plugins
89 Requires: %{name} = %{version}
90 Requires: %{name}-core = %{version}
94 Summary: The header files and libraries needed for Murphy development
95 Group: System/Libraries
96 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
97 Requires: %{name}-core = %{version}
99 Requires: %{name} = %{version}
101 Requires: libjson-devel
104 Summary: Documentation for Murphy
105 Group: SDK/Documentation
107 %if %{?_with_pulse:1}%{!?_with_pulse:0}
109 Summary: Murphy PulseAudio mainloop integration
110 Group: System/Libraries
111 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
112 Requires: %{name}-core = %{version}
114 Requires: %{name} = %{version}
118 Summary: Murphy PulseAudio mainloop integration development files
119 Group: System/Libraries
120 Requires: %{name}-pulse = %{version}
121 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
122 Requires: %{name}-core = %{version}
124 Requires: %{name} = %{version}
128 %if %{?_with_ecore:1}%{!?_with_ecore:0}
130 Summary: Murphy EFL/ecore mainloop integration
131 Group: System/Libraries
132 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
133 Requires: %{name}-core = %{version}
135 Requires: %{name} = %{version}
139 Summary: Murphy EFL/ecore mainloop integration development files
140 Group: System/Libraries
141 Requires: %{name}-ecore = %{version}
142 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
143 Requires: %{name}-core = %{version}
145 Requires: %{name} = %{version}
149 %if %{?_with_glib:1}%{!?_with_glib:0}
151 Summary: Murphy glib mainloop integration
152 Group: System/Libraries
153 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
154 Requires: %{name}-core = %{version}
156 Requires: %{name} = %{version}
160 Summary: Murphy glib mainloop integration development files
161 Group: System/Libraries
162 Requires: %{name}-glib = %{version}
163 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
164 Requires: %{name}-core = %{version}
166 Requires: %{name} = %{version}
170 %if %{?_with_qt:1}%{!?_with_qt:0}
172 Summary: Murphy Qt mainloop integration
173 Group: System/Libraries
174 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
175 Requires: %{name}-core = %{version}
177 Requires: %{name} = %{version}
181 Summary: Murphy Qt mainloop integration development files
182 Group: System/Libraries
183 Requires: %{name}-qt = %{version}
184 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
185 Requires: %{name}-core = %{version}
187 Requires: %{name} = %{version}
192 Summary: Various test binaries for Murphy
193 Group: System/Testing
194 Requires: %{name} = %{version}
195 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
196 Requires: %{name}-core = %{version}
198 Requires: %{name} = %{version}
202 This package contains the basic daemon.
204 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
206 This package contains the core runtime libraries.
208 %description plugins-base
209 This package contains a basic set of plugins.
213 This package contains header files and libraries necessary for development.
216 This package contains documentation.
218 %if %{?_with_pulse:1}%{!?_with_pulse:0}
220 This package contains the Murphy PulseAudio mainloop integration runtime files.
222 %description pulse-devel
223 This package contains the Murphy PulseAudio mainloop integration development
227 %if %{?_with_ecore:1}%{!?_with_ecore:0}
229 This package contains the Murphy EFL/ecore mainloop integration runtime files.
231 %description ecore-devel
232 This package contains the Murphy EFL/ecore mainloop integration development
236 %if %{?_with_glib:1}%{!?_with_glib:0}
238 This package contains the Murphy glib mainloop integration runtime files.
240 %description glib-devel
241 This package contains the Murphy glib mainloop integration development
245 %if %{?_with_qt:1}%{!?_with_qt:0}
247 This package contains the Murphy Qt mainloop integration runtime files.
249 %description qt-devel
250 This package contains the Murphy Qt mainloop integration development
255 This package contains various test binaries for Murphy.
261 %if %{?_with_debug:1}%{!?_with_debug:0}
262 export CFLAGS="-O0 -g3"
267 DYNAMIC_PLUGINS="domain-control"
269 %if %{?_with_pulse:1}%{!?_with_pulse:0}
270 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
272 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
275 %if %{?_with_ecore:1}%{!?_with_ecore:0}
276 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
278 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
281 %if %{?_with_glib:1}%{!?_with_glib:0}
282 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
284 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
287 %if %{?_with_qt:1}%{!?_with_qt:0}
288 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
290 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
293 %if %{?_with_dbus:1}%{!?_with_dbus:0}
294 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
296 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
299 %if %{?_with_telephony:1}%{!?_with_telephony:0}
300 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
302 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
305 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
306 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-resource-asm"
307 DYNAMIC_PLUGINS="$DYNAMIC_PLUGINS,resource-asm"
309 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-resource-asm"
312 %if %{?_with_websockets:1}%{!?_with_websockets:0}
313 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-websockets"
315 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
318 %if %{?_with_smack:1}%{!?_with_smack:0}
319 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-smack"
321 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
324 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
325 grep '^processor *:' | wc -l`"
326 [ -z "$NUM_CPUS" ] && NUM_CPUS=1
329 %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS && \
331 make -j$(($NUM_CPUS + 1)) $V
334 rm -rf $RPM_BUILD_ROOT
337 # Make sure we have a plugin dir even if all the basic plugins
338 # are configured to be built in.
339 mkdir -p $RPM_BUILD_ROOT%{_libdir}/murphy/plugins
341 # Get rid of any *.la files installed by libtool.
342 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
344 # Clean up also the murphy DB installation.
345 rm -f $RPM_BUILD_ROOT%{_libdir}/murphy/*.la
347 # Generate list of linkedin plugins (depends on the configuration).
349 pushd $RPM_BUILD_ROOT >& /dev/null && \
350 find ./%{_libdir}/murphy/plugins -name libmurphy-plugin-*.so* | \
351 sed 's#^./*#/#g' > $outdir/filelist.plugins-base && \
354 # Generate list of header files, filtering ones that go to subpackages.
356 pushd $RPM_BUILD_ROOT >& /dev/null && \
357 find ./%{_includedir}/murphy | \
358 egrep -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
359 sed 's#^./*#/#g' > $outdir/filelist.devel-includes && \
362 # Replace the default sample/test config files with the packaging ones.
363 cp packaging.in/murphy-lua.conf $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.conf
364 cp packaging.in/murphy.lua $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.lua
366 # Copy plugin configuration files in place.
367 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb
368 cp packaging.in/amb-config.lua \
369 $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb/config.lua
371 # Copy tmpfiles.d config file in place
372 mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
373 cp packaging.in/murphyd.conf $RPM_BUILD_ROOT%{_tmpfilesdir}
375 # Copy the systemd service file in place.
376 mkdir -p $RPM_BUILD_ROOT%{systemddir}/system
377 cp packaging.in/murphyd.service $RPM_BUILD_ROOT%{systemddir}/system
379 %if %{?_with_dbus:1}%{!?_with_dbus:0}
380 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
381 cp packaging.in/org.Murphy.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
385 rm -rf $RPM_BUILD_ROOT
388 /bin/systemctl enable murphyd.service
390 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
396 if [ "$1" = "0" ]; then
397 /bin/systemctl disable murphyd.service
400 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
405 %if %{?_with_glib:1}%{!?_with_glib:0}
413 %if %{?_with_pulse:1}%{!?_with_pulse:0}
421 %if %{?_with_ecore:1}%{!?_with_ecore:0}
429 %if %{?_with_qt:1}%{!?_with_qt:0}
437 %if %{?_with_squashpkg:1}%{!?_with_squashpkg:0}
438 %files -f filelist.plugins-base
442 %defattr(-,root,root,-)
444 %config %{_sysconfdir}/murphy
445 %{systemddir}/system/murphyd.service
446 %{_tmpfilesdir}/murphyd.conf
447 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
448 %{_sbindir}/asm-bridge
450 %if %{?_with_dbus:1}%{!?_with_dbus:0}
451 %{_sysconfdir}/dbus-1/system.d
452 %config %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
454 %if %{?_with_websockets:1}%{!?_with_websockets:0}
458 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
460 %defattr(-,root,root,-)
462 %{_libdir}/libmurphy-common.so.*
463 %{_libdir}/libmurphy-core.so.*
464 %{_libdir}/libmurphy-resolver.so.*
465 %{_libdir}/libmurphy-resource.so.*
466 %{_libdir}/libmurphy-resource-backend.so.*
467 %if %{?_with_lua:1}%{!?_with_lua:0}
468 %{_libdir}/libmurphy-lua-utils.so.*
469 %{_libdir}/libmurphy-lua-decision.so.*
471 %{_libdir}/libmurphy-domain-controller.so.*
472 %{_libdir}/murphy/*.so.*
473 %{_libdir}/libbreedline*.so.*
474 %if %{?_with_dbus:1}%{!?_with_dbus:0}
475 %{_libdir}/libmurphy-dbus.so.*
478 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
479 %files plugins-base -f filelist.plugins-base
480 %defattr(-,root,root,-)
482 %{_libdir}/murphy/plugins
484 %files devel -f filelist.devel-includes
485 %defattr(-,root,root,-)
486 # %{_includedir}/murphy/config.h
487 # %{_includedir}/murphy/common.h
488 # #%{_includedir}/murphy/core.h
489 # %{_includedir}/murphy/common
490 # %{_includedir}/murphy/core
491 # %{_includedir}/murphy/resolver
492 # %{_includedir}/murphy/resource
493 # # hmmm... should handle disabled plugins properly.
494 # %{_includedir}/murphy/domain-control
495 # %{_includedir}/murphy/plugins
496 %{_includedir}/murphy-db
497 %{_libdir}/libmurphy-common.so
498 %{_libdir}/libmurphy-core.so
499 %{_libdir}/libmurphy-resolver.so
500 %{_libdir}/libmurphy-resource.so
501 %{_libdir}/libmurphy-resource-backend.so
502 %if %{?_with_lua:1}%{!?_with_lua:0}
503 %{_libdir}/libmurphy-lua-utils.so
504 %{_libdir}/libmurphy-lua-decision.so
506 %{_libdir}/libmurphy-domain-controller.so
507 %{_libdir}/murphy/*.so
508 %{_libdir}/pkgconfig/murphy-common.pc
509 %{_libdir}/pkgconfig/murphy-core.pc
510 %{_libdir}/pkgconfig/murphy-resolver.pc
511 #%{_libdir}/pkgconfig/murphy-resource.pc
512 %if %{?_with_lua:1}%{!?_with_lua:0}
513 %{_libdir}/pkgconfig/murphy-lua-utils.pc
514 %{_libdir}/pkgconfig/murphy-lua-decision.pc
516 %{_libdir}/pkgconfig/murphy-domain-controller.pc
517 %{_libdir}/pkgconfig/murphy-db.pc
518 %{_libdir}/pkgconfig/murphy-resource.pc
519 %{_includedir}/breedline
520 %{_libdir}/libbreedline*.so
521 %{_libdir}/pkgconfig/breedline*.pc
522 %if %{?_with_dbus:1}%{!?_with_dbus:0}
523 #%{_includedir}/murphy/dbus
524 %{_libdir}/libmurphy-dbus.so
525 %{_libdir}/pkgconfig/murphy-dbus.pc
529 %defattr(-,root,root,-)
530 %doc %{_docdir}/../murphy/AUTHORS
531 %doc %{_docdir}/../murphy/CODING-STYLE
532 %license %{_docdir}/../murphy/COPYING
533 %doc %{_docdir}/../murphy/ChangeLog
534 %doc %{_docdir}/../murphy/INSTALL
535 %doc %{_docdir}/../murphy/NEWS
536 %doc %{_docdir}/../murphy/README
538 %if %{?_with_pulse:1}%{!?_with_pulse:0}
540 %defattr(-,root,root,-)
541 %{_libdir}/libmurphy-pulse.so.*
544 %defattr(-,root,root,-)
545 %{_includedir}/murphy/common/pulse-glue.h
546 %{_libdir}/libmurphy-pulse.so
547 %{_libdir}/pkgconfig/murphy-pulse.pc
550 %if %{?_with_ecore:1}%{!?_with_ecore:0}
552 %defattr(-,root,root,-)
553 %{_libdir}/libmurphy-ecore.so.*
556 %defattr(-,root,root,-)
557 %{_includedir}/murphy/common/ecore-glue.h
558 %{_libdir}/libmurphy-ecore.so
559 %{_libdir}/pkgconfig/murphy-ecore.pc
562 %if %{?_with_glib:1}%{!?_with_glib:0}
564 %defattr(-,root,root,-)
565 %{_libdir}/libmurphy-glib.so.*
568 %defattr(-,root,root,-)
569 %{_includedir}/murphy/common/glib-glue.h
570 %{_libdir}/libmurphy-glib.so
571 %{_libdir}/pkgconfig/murphy-glib.pc
574 %if %{?_with_qt:1}%{!?_with_qt:0}
576 %defattr(-,root,root,-)
577 %{_libdir}/libmurphy-qt.so.*
580 %defattr(-,root,root,-)
581 %{_includedir}/murphy/common/qt-glue.h
582 %{_libdir}/libmurphy-qt.so
583 %{_libdir}/pkgconfig/murphy-qt.pc
587 %defattr(-,root,root,-)
588 %{_bindir}/resource-client
589 %{_bindir}/resource-api-test
590 %{_bindir}/resource-api-fuzz
591 %{_bindir}/test-domain-controller
592 %{_bindir}/murphy-console
595 * Tue Nov 27 2012 Krisztian Litkey <krisztian.litkey@intel.com> -
596 - Initial build for 2.0alpha.