1 # These are on by default, unless explicitly disabled.
7 %bcond_without telephony
8 %bcond_without audiosession
9 %bcond_without websockets
13 # These are off by default, unless explicitly enabled.
16 # By default we build with distro-default compilation flags which
17 # enables optimizations. If you want to build with full debugging
18 # ie. with optimization turned off and full debug info (-O0 -g3)
19 # pass '--with debug' to rpmbuild on the command line. Similary
20 # you can chose to compile with/without pulse, ecore, glib, qt,
21 # dbus, and telephony support.
23 # qt is the macro for controlling Qt4 support, which is not supported
24 # in Tizen any more. qt5 is the corrsponding macro for controlling
32 Summary: Resource policy framework
38 URL: http://01.org/murphy/
39 Source0: %{name}-%{version}.tar.gz
40 Source1001: %{name}.manifest
42 Requires(post): /bin/systemctl
43 Requires(post): libcap-tools
44 Requires(postun): /bin/systemctl
48 BuildRequires: pkgconfig(lua)
49 BuildRequires: pkgconfig(libsystemd-daemon)
50 BuildRequires: pkgconfig(libsystemd-journal)
51 BuildRequires: pkgconfig(libcap)
52 BuildRequires: pkgconfig(libtzplatform-config)
54 BuildRequires: pkgconfig(libpulse)
57 BuildRequires: pkgconfig(ecore)
58 BuildRequires: mesa-libEGL
59 BuildRequires: mesa-libGLESv2
62 BuildRequires: pkgconfig(glib-2.0)
65 BuildRequires: pkgconfig(QtCore)
68 BuildRequires: pkgconfig(dbus-1)
71 BuildRequires: pkgconfig(ofono)
73 %if %{with audiosession}
74 BuildRequires: pkgconfig(audio-session-mgr)
75 BuildRequires: pkgconfig(aul)
77 %if %{with websockets}
78 BuildRequires: libwebsockets-devel
80 BuildRequires: pkgconfig(json)
82 BuildRequires: pkgconfig(libsmack)
85 BuildRequires: ico-uxf-weston-plugin-devel
86 BuildRequires: weston-ivi-shell-devel
87 BuildRequires: genivi-shell-devel
88 BuildRequires: pkgconfig(ail)
89 BuildRequires: pkgconfig(aul)
90 BuildRequires: libxml2-devel
94 This package contains the basic Murphy daemon.
97 Summary: The header files and libraries needed for Murphy development
98 Group: System/Libraries
99 Requires: %{name} = %{version}-%{release}
100 Requires: libjson-devel
103 This package contains header files and libraries necessary for development.
106 Summary: Documentation for Murphy
107 Group: SDK/Documentation
110 This package contains documentation.
114 Summary: Murphy PulseAudio mainloop integration
115 Group: System/Libraries
116 Requires: %{name} = %{version}-%{release}
119 This package contains the Murphy PulseAudio mainloop integration runtime files.
122 Summary: Murphy PulseAudio mainloop integration development files
123 Group: System/Libraries
124 Requires: %{name}-pulse = %{version}-%{release}
125 Requires: %{name} = %{version}-%{release}
127 %description pulse-devel
128 This package contains the Murphy PulseAudio mainloop integration development
134 Summary: Murphy EFL/ecore mainloop integration
135 Group: System/Libraries
136 Requires: %{name} = %{version}-%{release}
139 This package contains the Murphy EFL/ecore mainloop integration runtime files.
142 Summary: Murphy EFL/ecore mainloop integration development files
143 Group: System/Libraries
144 Requires: %{name}-ecore = %{version}-%{release}
145 Requires: %{name} = %{version}-%{release}
147 %description ecore-devel
148 This package contains the Murphy EFL/ecore mainloop integration development
154 Summary: Murphy glib mainloop integration
155 Group: System/Libraries
156 Requires: %{name} = %{version}-%{release}
159 This package contains the Murphy glib mainloop integration runtime files.
162 Summary: Murphy glib mainloop integration development files
163 Group: System/Libraries
164 Requires: %{name}-glib = %{version}-%{release}
165 Requires: %{name} = %{version}-%{release}
167 %description glib-devel
168 This package contains the Murphy glib mainloop integration development
174 Summary: Murphy Qt mainloop integration
175 Group: System/Libraries
176 Requires: %{name} = %{version}-%{release}
179 This package contains the Murphy Qt mainloop integration runtime files.
182 Summary: Murphy Qt mainloop integration development files
183 Group: System/Libraries
184 Requires: %{name}-qt = %{version}-%{release}
185 Requires: %{name} = %{version}-%{release}
187 %description qt-devel
188 This package contains the Murphy Qt mainloop integration development
193 Summary: Murphy support for Genivi Audio Manager
194 Group: System/Libraries
195 Requires: %{name} = %{version}-%{release}
198 This package contains the Murphy plugins for necessary for supporting
199 Genivi Audio Manager.
202 Summary: Murphy support for Genivi Audio Manager development files
203 Group: System/Libraries
204 Requires: %{name}-gam = %{version}-%{release}
206 %description gam-devel
207 This package contains development files for Murphy Genivi Audio Manager
211 Summary: Various test binaries for Murphy
212 Group: System/Testing
213 Requires: %{name} = %{version}-%{release}
214 Requires: %{name} = %{version}-%{release}
217 This package contains various test binaries for Murphy.
219 %if %{with icosyscon}
220 %package system-controller
221 Summary: Murphy IVI System Controller plugin
222 Group: System/Service
223 Requires: ico-uxf-homescreen
224 Conflicts: murphy-ivi-resource-manager
225 Provides: system-controller
226 Conflicts: ico-uxf-homescreen-system-controller
228 %description system-controller
229 This package contains the Murphy IVI resource manager plugin.
235 %if %{with icosyscon}
236 echo "Build with icosyscon"
238 echo "Build without icosyscon"
243 export CFLAGS="-O0 -g3"
248 DYNAMIC_PLUGINS="domain-control,system-controller"
251 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
253 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
257 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
259 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
263 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
265 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
269 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
271 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
275 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-libdbus"
277 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-libdbus"
280 %if %{with telephony}
281 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
283 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
286 %if %{with audiosession}
287 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-resource-asm"
288 DYNAMIC_PLUGINS="$DYNAMIC_PLUGINS,resource-asm"
290 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-resource-asm"
293 %if %{with websockets}
294 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-websockets"
296 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
300 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-smack"
302 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
305 %if %{with icosyscon}
306 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-system-controller"
308 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-system-controller"
312 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-system-monitor"
314 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-system-monitor"
318 %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS
320 %__make %{?_smp_mflags} $V
326 # Make sure we have a plugin dir even if all the basic plugins
327 # are configured to be built in.
328 mkdir -p %{buildroot}%{_libdir}/murphy/plugins
330 # Get rid of any *.la files installed by libtool.
331 rm -f %{buildroot}%{_libdir}/*.la
333 # Clean up also the murphy DB installation.
334 rm -f %{buildroot}%{_libdir}/murphy/*.la
336 # Generate list of linkedin plugins (depends on the configuration).
339 find ./%{_libdir} -name libmurphy-plugin-*.so* | \
340 sed 's#^./*#/#g' > $outdir/filelist.plugins-base
342 echo "Found the following linked-in plugin files:"
343 cat $outdir/filelist.plugins-base | sed 's/^/ /g'
345 # Generate list of header files, filtering ones that go to subpackages.
348 find ./%{_includedir}/murphy | \
349 grep -E -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
350 sed 's#^./*#/#g' > $outdir/filelist.devel-includes
353 # Replace the default sample/test config files with the packaging ones.
354 rm -f %{buildroot}%{_sysconfdir}/murphy/*
355 cp packaging.in/murphy-lua.conf %{buildroot}%{_sysconfdir}/murphy/murphy.conf
356 cp packaging.in/murphy.lua %{buildroot}%{_sysconfdir}/murphy/murphy.lua
358 # Copy plugin configuration files in place.
359 mkdir -p %{buildroot}%{_sysconfdir}/murphy/plugins/amb
360 cp packaging.in/amb-config.lua \
361 %{buildroot}%{_sysconfdir}/murphy/plugins/amb/config.lua
363 # Copy tmpfiles.d config file in place
364 mkdir -p %{buildroot}%{_tmpfilesdir}
365 cp packaging.in/murphyd.conf %{buildroot}%{_tmpfilesdir}
367 # Copy the systemd files in place.
368 #mkdir -p %%{buildroot}%%{_unitdir}
369 mkdir -p %{buildroot}%{_unitdir_user}
370 cp packaging.in/murphyd.service %{buildroot}%{_unitdir_user}
373 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
374 sed "s/@TZ_SYS_USER_GROUP@/%{TZ_SYS_USER_GROUP}/g" \
375 packaging.in/org.Murphy.conf.in > packaging.in/org.Murphy.conf
376 cp packaging.in/org.Murphy.conf \
377 %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
380 # copy (experimental) GAM resource backend configuration files
381 mkdir -p %{buildroot}%{_sysconfdir}/murphy/gam
382 cp packaging.in/gam-*.names packaging.in/gam-*.tree \
383 %{buildroot}%{_sysconfdir}/murphy/gam
389 /bin/systemctl --user enable --global murphyd.service
390 setcap 'cap_net_admin=+ep' %{_bindir}/murphyd
394 if [ "$1" = "0" ]; then
395 systemctl --user disable --global murphyd.service
437 %files -f filelist.plugins-base
438 %defattr(-,root,root,-)
439 %manifest murphy.manifest
441 %config %{_sysconfdir}/murphy
442 %{_unitdir_user}/murphyd.service
443 %{_tmpfilesdir}/murphyd.conf
444 %if %{with audiosession}
445 %{_sbindir}/asm-bridge
448 %{_sysconfdir}/dbus-1/system.d
449 %config %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
451 %if %{with websockets}
455 %{_libdir}/libmurphy-common.so.*
456 %{_libdir}/libmurphy-core.so.*
457 %{_libdir}/libmurphy-resolver.so.*
458 %{_libdir}/libmurphy-resource.so.*
459 %{_libdir}/libmurphy-resource-backend.so.*
461 %{_libdir}/libmurphy-lua-utils.so.*
462 %{_libdir}/libmurphy-lua-decision.so.*
464 %{_libdir}/libmurphy-domain-controller.so.*
465 %{_libdir}/murphy/*.so.*
466 %{_libdir}/libbreedline*.so.*
468 %{_libdir}/libmurphy-libdbus.so.*
469 %{_libdir}/libmurphy-dbus-libdbus.so.*
472 %{_libdir}/libmurphy-libdbus.so.*
475 %{_libdir}/murphy/plugins/plugin-domain-control.so
476 %{_libdir}/murphy/plugins/plugin-resource-asm.so
477 %{_libdir}/murphy/plugins/plugin-resource-native.so
479 %files devel -f filelist.devel-includes
480 %defattr(-,root,root,-)
481 %{_includedir}/murphy-db
482 %{_libdir}/libmurphy-common.so
483 %{_libdir}/libmurphy-core.so
484 %{_libdir}/libmurphy-resolver.so
485 %{_libdir}/libmurphy-resource.so
486 %{_libdir}/libmurphy-resource-backend.so
488 %{_libdir}/libmurphy-lua-utils.so
489 %{_libdir}/libmurphy-lua-decision.so
491 %{_libdir}/libmurphy-domain-controller.so
492 %{_libdir}/murphy/*.so
493 %{_libdir}/pkgconfig/murphy-common.pc
494 %{_libdir}/pkgconfig/murphy-core.pc
495 %{_libdir}/pkgconfig/murphy-resolver.pc
497 %{_libdir}/pkgconfig/murphy-lua-utils.pc
498 %{_libdir}/pkgconfig/murphy-lua-decision.pc
500 %{_libdir}/pkgconfig/murphy-domain-controller.pc
501 %{_libdir}/pkgconfig/murphy-db.pc
502 %{_libdir}/pkgconfig/murphy-resource.pc
503 %{_includedir}/breedline
504 %{_libdir}/libbreedline*.so
505 %{_libdir}/pkgconfig/breedline*.pc
507 %{_libdir}/libmurphy-libdbus.so
508 %{_libdir}/libmurphy-dbus-libdbus.so
509 %{_libdir}/pkgconfig/murphy-libdbus.pc
510 %{_libdir}/pkgconfig/murphy-dbus-libdbus.pc
514 %defattr(-,root,root,-)
515 %doc %{_datadir}/doc/murphy/AUTHORS
516 %doc %{_datadir}/doc/murphy/CODING-STYLE
517 %doc %{_datadir}/doc/murphy/ChangeLog
518 %doc %{_datadir}/doc/murphy/NEWS
519 %doc %{_datadir}/doc/murphy/README
520 %license COPYING LICENSE-BSD
524 %defattr(-,root,root,-)
525 %{_libdir}/libmurphy-pulse.so.*
526 %manifest murphy.manifest
529 %defattr(-,root,root,-)
530 %{_includedir}/murphy/common/pulse-glue.h
531 %{_libdir}/libmurphy-pulse.so
532 %{_libdir}/pkgconfig/murphy-pulse.pc
537 %defattr(-,root,root,-)
538 %{_libdir}/libmurphy-ecore.so.*
539 %manifest murphy.manifest
542 %defattr(-,root,root,-)
543 %{_includedir}/murphy/common/ecore-glue.h
544 %{_libdir}/libmurphy-ecore.so
545 %{_libdir}/pkgconfig/murphy-ecore.pc
550 %defattr(-,root,root,-)
551 %{_libdir}/libmurphy-glib.so.*
552 %manifest murphy.manifest
555 %defattr(-,root,root,-)
556 %{_includedir}/murphy/common/glib-glue.h
557 %{_libdir}/libmurphy-glib.so
558 %{_libdir}/pkgconfig/murphy-glib.pc
563 %defattr(-,root,root,-)
564 %{_libdir}/libmurphy-qt.so.*
565 %manifest murphy.manifest
568 %defattr(-,root,root,-)
569 %{_includedir}/murphy/common/qt-glue.h
570 %{_libdir}/libmurphy-qt.so
571 %{_libdir}/pkgconfig/murphy-qt.pc
575 %defattr(-,root,root,-)
576 %{_libdir}/libmurphy-decision-tree.so.*
577 %{_libdir}/libmurphy-decision-tree.so.0.0.0
578 %{_libdir}/murphy/plugins/plugin-gam-resource-manager.so
581 %defattr(-,root,root,-)
582 %{_bindir}/decision-test
583 %{_bindir}/pattern-generator
584 %{_libdir}/libmurphy-decision-tree.so
587 %defattr(-,root,root,-)
588 %{_bindir}/resource-client
589 %{_bindir}/resource-api-test
590 %{_bindir}/resource-api-fuzz
591 %{_bindir}/resource-context-create
592 %{_bindir}/test-domain-controller
593 %{_bindir}/murphy-console
594 %manifest murphy.manifest
596 %if %{with icosyscon}
597 %files system-controller
598 %defattr(-,root,root,-)
599 %{_libdir}/murphy/plugins/plugin-system-controller.so
600 %manifest murphy.manifest