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
35 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
36 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
37 Requires: %{name}-core = %{version}
40 Requires(post): /bin/systemctl
41 Requires(postun): /bin/systemctl
45 BuildRequires: pkgconfig(lua)
46 BuildRequires: pkgconfig(libsystemd-daemon)
47 BuildRequires: pkgconfig(libsystemd-journal)
49 BuildRequires: pkgconfig(wayland-client)
50 BuildRequires: pkgconfig(ivi-extension-protocol)
51 BuildRequires: ico-uxf-weston-plugin-devel
53 %if %{?_with_pulse:1}%{!?_with_pulse:0}
54 BuildRequires: pkgconfig(libpulse)
56 %if %{?_with_ecore:1}%{!?_with_ecore:0}
57 BuildRequires: pkgconfig(ecore)
58 BuildRequires: mesa-libEGL
59 BuildRequires: mesa-libGLESv2
61 %if %{?_with_glib:1}%{!?_with_glib:0}
62 BuildRequires: pkgconfig(glib-2.0)
64 %if %{?_with_qt:1}%{!?_with_qt:0}
65 BuildRequires: pkgconfig(QtCore)
67 %if %{?_with_dbus:1}%{!?_with_dbus:0}
68 BuildRequires: pkgconfig(dbus-1)
70 %if %{?_with_telephony:1}%{!?_with_telephony:0}
71 BuildRequires: pkgconfig(ofono)
73 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
74 BuildRequires: pkgconfig(audio-session-mgr)
76 %if %{?_with_websockets:1}%{!?_with_websockets:0}
77 BuildRequires: libwebsockets-devel
79 BuildRequires: pkgconfig(json)
81 %if %{?_with_smack:1}%{!?_with_smack:0}
82 BuildRequires: pkgconfig(libsmack)
85 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
87 Summary: Murphy core runtime libraries
88 Group: System/Libraries
91 Summary: The basic set of Murphy plugins
93 Requires: %{name} = %{version}
94 Requires: %{name}-core = %{version}
98 Summary: The header files and libraries needed for Murphy development
99 Group: System/Libraries
100 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
101 Requires: %{name}-core = %{version}
103 Requires: %{name} = %{version}
105 Requires: libjson-devel
108 Summary: Documentation for Murphy
109 Group: SDK/Documentation
111 %if %{?_with_pulse:1}%{!?_with_pulse:0}
113 Summary: Murphy PulseAudio mainloop integration
114 Group: System/Libraries
115 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
116 Requires: %{name}-core = %{version}
118 Requires: %{name} = %{version}
122 Summary: Murphy PulseAudio mainloop integration development files
123 Group: System/Libraries
124 Requires: %{name}-pulse = %{version}
125 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
126 Requires: %{name}-core = %{version}
128 Requires: %{name} = %{version}
132 %if %{?_with_ecore:1}%{!?_with_ecore:0}
134 Summary: Murphy EFL/ecore mainloop integration
135 Group: System/Libraries
136 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
137 Requires: %{name}-core = %{version}
139 Requires: %{name} = %{version}
143 Summary: Murphy EFL/ecore mainloop integration development files
144 Group: System/Libraries
145 Requires: %{name}-ecore = %{version}
146 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
147 Requires: %{name}-core = %{version}
149 Requires: %{name} = %{version}
153 %if %{?_with_glib:1}%{!?_with_glib:0}
155 Summary: Murphy glib mainloop integration
156 Group: System/Libraries
157 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
158 Requires: %{name}-core = %{version}
160 Requires: %{name} = %{version}
164 Summary: Murphy glib mainloop integration development files
165 Group: System/Libraries
166 Requires: %{name}-glib = %{version}
167 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
168 Requires: %{name}-core = %{version}
170 Requires: %{name} = %{version}
174 %if %{?_with_qt:1}%{!?_with_qt:0}
176 Summary: Murphy Qt mainloop integration
177 Group: System/Libraries
178 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
179 Requires: %{name}-core = %{version}
181 Requires: %{name} = %{version}
185 Summary: Murphy Qt mainloop integration development files
186 Group: System/Libraries
187 Requires: %{name}-qt = %{version}
188 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
189 Requires: %{name}-core = %{version}
191 Requires: %{name} = %{version}
196 Summary: Various test binaries for Murphy
197 Group: System/Testing
198 Requires: %{name} = %{version}
199 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
200 Requires: %{name}-core = %{version}
202 Requires: %{name} = %{version}
206 This package contains the basic daemon.
208 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
210 This package contains the core runtime libraries.
212 %description plugins-base
213 This package contains a basic set of plugins.
217 This package contains header files and libraries necessary for development.
220 This package contains documentation.
222 %if %{?_with_pulse:1}%{!?_with_pulse:0}
224 This package contains the Murphy PulseAudio mainloop integration runtime files.
226 %description pulse-devel
227 This package contains the Murphy PulseAudio mainloop integration development
231 %if %{?_with_ecore:1}%{!?_with_ecore:0}
233 This package contains the Murphy EFL/ecore mainloop integration runtime files.
235 %description ecore-devel
236 This package contains the Murphy EFL/ecore mainloop integration development
240 %if %{?_with_glib:1}%{!?_with_glib:0}
242 This package contains the Murphy glib mainloop integration runtime files.
244 %description glib-devel
245 This package contains the Murphy glib mainloop integration development
249 %if %{?_with_qt:1}%{!?_with_qt:0}
251 This package contains the Murphy Qt mainloop integration runtime files.
253 %description qt-devel
254 This package contains the Murphy Qt mainloop integration development
259 This package contains various test binaries for Murphy.
266 %if %{?_with_debug:1}%{!?_with_debug:0}
267 export CFLAGS="-O0 -g3"
272 DYNAMIC_PLUGINS="domain-control"
274 %if %{?_with_pulse:1}%{!?_with_pulse:0}
275 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
277 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
280 %if %{?_with_ecore:1}%{!?_with_ecore:0}
281 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
283 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
286 %if %{?_with_glib:1}%{!?_with_glib:0}
287 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
289 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
292 %if %{?_with_qt:1}%{!?_with_qt:0}
293 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
295 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
298 %if %{?_with_dbus:1}%{!?_with_dbus:0}
299 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
301 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
304 %if %{?_with_telephony:1}%{!?_with_telephony:0}
305 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
307 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
310 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
311 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-resource-asm"
312 DYNAMIC_PLUGINS="$DYNAMIC_PLUGINS,resource-asm"
314 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-resource-asm"
317 %if %{?_with_websockets:1}%{!?_with_websockets:0}
318 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-websockets"
320 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
323 %if %{?_with_smack:1}%{!?_with_smack:0}
324 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-smack"
326 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
329 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
330 grep '^processor *:' | wc -l`"
331 [ -z "$NUM_CPUS" ] && NUM_CPUS=1
334 %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS && \
336 make -j$(($NUM_CPUS + 1)) $V
339 rm -rf $RPM_BUILD_ROOT
342 # Make sure we have a plugin dir even if all the basic plugins
343 # are configured to be built in.
344 mkdir -p $RPM_BUILD_ROOT%{_libdir}/murphy/plugins
346 # Get rid of any *.la files installed by libtool.
347 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
349 # Clean up also the murphy DB installation.
350 rm -f $RPM_BUILD_ROOT%{_libdir}/murphy/*.la
352 # Generate list of linkedin plugins (depends on the configuration).
354 pushd $RPM_BUILD_ROOT >& /dev/null && \
355 find ./%{_libdir}/murphy/plugins -name libmurphy-plugin-*.so* | \
356 sed 's#^./*#/#g' > $outdir/filelist.plugins-base && \
359 # Generate list of header files, filtering ones that go to subpackages.
361 pushd $RPM_BUILD_ROOT >& /dev/null && \
362 find ./%{_includedir}/murphy | \
363 egrep -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
364 sed 's#^./*#/#g' > $outdir/filelist.devel-includes && \
367 # Replace the default sample/test config files with the packaging ones.
368 cp packaging.in/murphy-lua.conf $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.conf
369 cp packaging.in/murphy.lua $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.lua
371 # Copy plugin configuration files in place.
372 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb
373 cp packaging.in/amb-config.lua \
374 $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb/config.lua
376 # Copy the systemd service file in place.
377 mkdir -p $RPM_BUILD_ROOT%{systemddir}/system
378 cp packaging.in/murphyd.service $RPM_BUILD_ROOT%{systemddir}/system
380 %if %{?_with_dbus:1}%{!?_with_dbus:0}
381 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
382 cp packaging.in/org.Murphy.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
386 rm -rf $RPM_BUILD_ROOT
389 /bin/systemctl enable murphyd.service
391 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
397 if [ "$1" = "0" ]; then
398 /bin/systemctl disable murphyd.service
401 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
406 %if %{?_with_glib:1}%{!?_with_glib:0}
414 %if %{?_with_pulse:1}%{!?_with_pulse:0}
422 %if %{?_with_ecore:1}%{!?_with_ecore:0}
430 %if %{?_with_qt:1}%{!?_with_qt:0}
438 %if %{?_with_squashpkg:1}%{!?_with_squashpkg:0}
439 %files -f filelist.plugins-base
443 %defattr(-,root,root,-)
445 %config %{_sysconfdir}/murphy
446 %{systemddir}/system/murphyd.service
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.