packaging: fixed lost application classes, added AMB plugin config file.
[profile/ivi/murphy.git] / packaging.in / murphy.spec.in
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
8 # murphy package.
9
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 _without_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_squashpkg:%{!?_without_squashpkg:%define _with_squashpkg 1}}
20
21 Summary: Murphy policy framework
22 Name: murphy
23 Version: @VERSION@
24 Release: 1
25 License: BSD
26 Group: System Environment/Daemons
27 URL: http://01.org/murphy/
28 Source0: %{name}-%{version}.tar.gz
29 @DECLARE_PATCHES@
30 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
31 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
32 Requires: %{name}-core = %{version}
33 %endif
34
35 BuildRequires: flex
36 BuildRequires: bison
37 BuildRequires: pkgconfig(lua)
38
39 %if %{?_with_pulse:1}%{!?_with_pulse:0}
40 BuildRequires: pkgconfig(libpulse)
41 %endif
42 %if %{?_with_ecore:1}%{!?_with_ecore:0}
43 BuildRequires: pkgconfig(ecore)
44 BuildRequires: mesa-libEGL
45 BuildRequires: mesa-libGLESv2
46 BuildRequires: mesa-libgbm
47 %endif
48 %if %{?_with_glib:1}%{!?_with_glib:0}
49 BuildRequires: pkgconfig(glib-2.0)
50 %endif
51 %if %{?_with_qt:1}%{!?_with_qt:0}
52 BuildRequires: pkgconfig(QtCore)
53 %endif
54 %if %{?_with_dbus:1}%{!?_with_dbus:0}
55 BuildRequires: pkgconfig(dbus-1)
56 %endif
57 %if %{?_with_telephony:1}%{!?_with_telephony:0}
58 BuildRequires: pkgconfig(ofono)
59 %endif
60 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
61 BuildRequires: pkgconfig(audio-session-mgr)
62 %endif
63
64 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
65 %package core
66 Summary: Murphy core runtime libraries
67 Group: System Environment/Libraries
68
69 %package plugins-base
70 Summary: The basic set of Murphy plugins.
71 Group: System Environment/Daemons
72 Requires: %{name} = %{version}
73 Requires: %{name}-core = %{version}
74 %endif
75
76 %package devel
77 Summary: The header files and libraries needed for Murphy development
78 Group: Development/Libraries
79 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
80 Requires: %{name}-core = %{version}
81 %else
82 Requires: %{name} = %{version}
83 %endif
84
85 %package doc
86 Summary: Documentation for Murphy
87 Group: Documentation
88
89 %if %{?_with_pulse:1}%{!?_with_pulse:0}
90 %package pulse
91 Summary: Murphy PulseAudio mainloop integration.
92 Group: Development/Libraries
93 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
94 Requires: %{name}-core = %{version}
95 %else
96 Requires: %{name} = %{version}
97 %endif
98
99 %package pulse-devel
100 Summary: Murphy PulseAudio mainloop integration development files.
101 Group: Development/Libraries
102 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
103 Requires: %{name}-core = %{version}
104 %else
105 Requires: %{name} = %{version}
106 %endif
107 %endif
108
109 %if %{?_with_ecore:1}%{!?_with_ecore:0}
110 %package ecore
111 Summary: Murphy EFL/ecore mainloop integration.
112 Group: Development/Libraries
113 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
114 Requires: %{name}-core = %{version}
115 %else
116 Requires: %{name} = %{version}
117 %endif
118
119 %package ecore-devel
120 Summary: Murphy EFL/ecore mainloop integration development files.
121 Group: Development/Libraries
122 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
123 Requires: %{name}-core = %{version}
124 %else
125 Requires: %{name} = %{version}
126 %endif
127 %endif
128
129 %if %{?_with_glib:1}%{!?_with_glib:0}
130 %package glib
131 Summary: Murphy glib mainloop integration.
132 Group: Development/Libraries
133 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
134 Requires: %{name}-core = %{version}
135 %else
136 Requires: %{name} = %{version}
137 %endif
138
139 %package glib-devel
140 Summary: Murphy glib mainloop integration development files.
141 Group: Development/Libraries
142 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
143 Requires: %{name}-core = %{version}
144 %else
145 Requires: %{name} = %{version}
146 %endif
147 %endif
148
149 %if %{?_with_qt:1}%{!?_with_qt:0}
150 %package qt
151 Summary: Murphy Qt mainloop integration.
152 Group: Development/Libraries
153 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
154 Requires: %{name}-core = %{version}
155 %else
156 Requires: %{name} = %{version}
157 %endif
158
159 %package qt-devel
160 Summary: Murphy Qt mainloop integration development files.
161 Group: Development/Libraries
162 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
163 Requires: %{name}-core = %{version}
164 %else
165 Requires: %{name} = %{version}
166 %endif
167 %endif
168
169 %package tests
170 Summary: Various test binaries for Murphy.
171 Group: Development/Debug
172 Requires: %{name} = %{version}
173 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
174 Requires: %{name}-core = %{version}
175 %else
176 Requires: %{name} = %{version}
177 %endif
178
179 %description
180 This package contains the basic daemon.
181
182 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
183 %description core
184 This package contains the core runtime libraries.
185
186 %description plugins-base
187 This package contains a basic set of plugins.
188 %endif
189
190 %description devel
191 This package contains header files and libraries necessary for development.
192
193 %description doc
194 This package contains documentation.
195
196 %if %{?_with_pulse:1}%{!?_with_pulse:0}
197 %description pulse
198 This package contains the Murphy PulseAudio mainloop integration runtime files.
199
200 %description pulse-devel
201 This package contains the Murphy PulseAudio mainloop integration development
202 files.
203 %endif
204
205 %if %{?_with_ecore:1}%{!?_with_ecore:0}
206 %description ecore
207 This package contains the Murphy EFL/ecore mainloop integration runtime files.
208
209 %description ecore-devel
210 This package contains the Murphy EFL/ecore mainloop integration development
211 files.
212 %endif
213
214 %if %{?_with_glib:1}%{!?_with_glib:0}
215 %description glib
216 This package contains the Murphy glib mainloop integration runtime files.
217
218 %description glib-devel
219 This package contains the Murphy glib mainloop integration development
220 files.
221 %endif
222
223 %if %{?_with_qt:1}%{!?_with_qt:0}
224 %description qt
225 This package contains the Murphy Qt mainloop integration runtime files.
226
227 %description qt-devel
228 This package contains the Murphy Qt mainloop integration development
229 files.
230 %endif
231
232 %description tests
233 This package contains various test binaries for Murphy.
234
235 %prep
236 %setup -q
237 @APPLY_PATCHES@
238
239 %build
240 %if %{?_with_debug:1}%{!?_with_debug:0}
241 export CFLAGS="-O0 -g3"
242 V="V=1"
243 %endif
244
245 CONFIG_OPTIONS=""
246 DYNAMIC_PLUGINS="domain-control"
247
248 %if %{?_with_pulse:1}%{!?_with_pulse:0}
249 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
250 %else
251 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
252 %endif
253
254 %if %{?_with_ecore:1}%{!?_with_ecore:0}
255 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
256 %else
257 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
258 %endif
259
260 %if %{?_with_glib:1}%{!?_with_glib:0}
261 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
262 %else
263 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
264 %endif
265
266 %if %{?_with_qt:1}%{!?_with_qt:0}
267 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
268 %else
269 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
270 %endif
271
272 %if %{?_with_dbus:1}%{!?_with_dbus:0}
273 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
274 %else
275 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
276 %endif
277
278 %if %{?_with_telephony:1}%{!?_with_telephony:0}
279 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
280 %else
281 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
282 %endif
283
284 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
285 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-resource-asm"
286 DYNAMIC_PLUGINS="$DYNAMIC_PLUGINS,resource-asm"
287 %else
288 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-resource-asm"
289 %endif
290
291 NUM_CPUS="`cat /proc/cpuinfo | tr -s '\t' ' ' | \
292                grep '^processor *:' | wc -l`"
293 [ -z "$NUM_CPUS" ] && NUM_CPUS=1
294
295 ./bootstrap && \
296     %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS && \
297     make clean && \
298     make -j$(($NUM_CPUS + 1)) $V
299
300 %install
301 rm -rf $RPM_BUILD_ROOT
302 %make_install
303
304 # Make sure we have a plugin dir even if all the basic plugins
305 # are configured to be built in.
306 mkdir -p $RPM_BUILD_ROOT%{_libdir}/murphy/plugins
307
308 # Get rid of any *.la files installed by libtool.
309 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
310
311 # Clean up also the murphy DB installation.
312 rm -f $RPM_BUILD_ROOT%{_libdir}/murphy/*.la
313
314 # Generate list of linkedin plugins (depends on the configuration).
315 outdir="`pwd`"
316 pushd $RPM_BUILD_ROOT >& /dev/null && \
317     find ./%{_libdir}/murphy/plugins -name libmurphy-plugin-*.so* | \
318         sed 's#^./*#/#g' > $outdir/filelist.plugins-base && \
319 popd >& /dev/null
320
321 # Generate list of header files, filtering ones that go to subpackages.
322 outdir="`pwd`"
323 pushd $RPM_BUILD_ROOT >& /dev/null && \
324     find ./%{_includedir}/murphy | \
325     egrep -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
326         sed 's#^./*#/#g' > $outdir/filelist.devel-includes && \
327 popd >& /dev/null
328
329 # Replace the default sample/test config files with the packaging ones.
330 cp packaging.in/murphy-lua.conf $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.conf
331 cp packaging.in/murphy.lua      $RPM_BUILD_ROOT%{_sysconfdir}/murphy/murphy.lua
332
333 # Copy plugin configuration files in place.
334 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb
335 cp packaging.in/amb-config.lua \
336     $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb/config.lua
337
338 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
339 cp packaging.in/murphyd.init $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/murphyd
340 chmod a+x $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/murphyd
341
342 %if %{?_with_dbus:1}%{!?_with_dbus:0}
343 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
344 cp packaging.in/org.Murphy.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
345 %endif
346
347 %clean
348 rm -rf $RPM_BUILD_ROOT
349
350 %post
351 ln -sf %{_sysconfdir}/rc.d/init.d/murphyd %{_sysconfdir}/rc.d/rc3.d/S21murphyd
352
353 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
354 %post core
355 %endif
356 ldconfig
357
358 %postun
359 if [ "$1" = "0" ]; then
360     rm -f %{_sysconfdir}/rc.d/rc3.d/S21murphyd
361 fi
362
363 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
364 %postun core
365 %endif
366 ldconfig
367
368 %if %{?_with_squashpkg:1}%{!?_with_squashpkg:0}
369 %files -f filelist.plugins-base
370 %else
371 %files
372 %endif
373 %defattr(-,root,root,-)
374 %{_bindir}/murphyd
375 %{_sysconfdir}/murphy
376 %{_sysconfdir}/rc.d/init.d/murphyd
377 %if %{?_with_audiosession:1}%{!?_with_audiosession:0}
378 %{_sbindir}/asm-bridge
379 %endif
380 %if %{?_with_dbus:1}%{!?_with_dbus:0}
381 %{_sysconfdir}/dbus-1/system.d
382 %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
383 %endif
384
385 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
386 %files core
387 %defattr(-,root,root,-)
388 %endif
389 %{_libdir}/libmurphy-common.so.*
390 %{_libdir}/libmurphy-core.so.*
391 %{_libdir}/libmurphy-resolver.so.*
392 %{_libdir}/libmurphy-resource.so.*
393 %{_libdir}/libmurphy-resource-backend.so.*
394 %if %{?_with_lua:1}%{!?_with_lua:0}
395 %{_libdir}/libmurphy-lua-utils.so.*
396 %{_libdir}/libmurphy-lua-decision.so.*
397 %endif
398 %{_libdir}/libmurphy-domain-controller.so.*
399 %{_libdir}/murphy/*.so.*
400 %{_libdir}/libbreedline*.so.*
401 %if %{?_with_dbus:1}%{!?_with_dbus:0}
402 %{_libdir}/libmurphy-dbus.so.*
403 %endif
404
405 %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1}
406 %files plugins-base -f filelist.plugins-base
407 %defattr(-,root,root,-)
408 %endif
409 %{_libdir}/murphy/plugins
410
411 %files devel -f filelist.devel-includes
412 %defattr(-,root,root,-)
413 # %{_includedir}/murphy/config.h
414 # %{_includedir}/murphy/common.h
415 # #%{_includedir}/murphy/core.h
416 # %{_includedir}/murphy/common
417 # %{_includedir}/murphy/core
418 # %{_includedir}/murphy/resolver
419 # %{_includedir}/murphy/resource
420 # # hmmm... should handle disabled plugins properly.
421 # %{_includedir}/murphy/domain-control
422 # %{_includedir}/murphy/plugins
423 %{_includedir}/murphy-db
424 %{_libdir}/libmurphy-common.so
425 %{_libdir}/libmurphy-core.so
426 %{_libdir}/libmurphy-resolver.so
427 %{_libdir}/libmurphy-resource.so
428 %{_libdir}/libmurphy-resource-backend.so
429 %if %{?_with_lua:1}%{!?_with_lua:0}
430 %{_libdir}/libmurphy-lua-utils.so
431 %{_libdir}/libmurphy-lua-decision.so
432 %endif
433 %{_libdir}/libmurphy-domain-controller.so
434 %{_libdir}/murphy/*.so
435 %{_libdir}/pkgconfig/murphy-common.pc
436 %{_libdir}/pkgconfig/murphy-core.pc
437 %{_libdir}/pkgconfig/murphy-resolver.pc
438 #%{_libdir}/pkgconfig/murphy-resource.pc
439 %if %{?_with_lua:1}%{!?_with_lua:0}
440 %{_libdir}/pkgconfig/murphy-lua-utils.pc
441 %{_libdir}/pkgconfig/murphy-lua-decision.pc
442 %endif
443 %{_libdir}/pkgconfig/murphy-domain-controller.pc
444 %{_libdir}/pkgconfig/murphy-db.pc
445 %{_includedir}/breedline
446 %{_libdir}/libbreedline*.so
447 %{_libdir}/pkgconfig/breedline*.pc
448 %if %{?_with_dbus:1}%{!?_with_dbus:0}
449 #%{_includedir}/murphy/dbus
450 %{_libdir}/libmurphy-dbus.so
451 %{_libdir}/pkgconfig/murphy-dbus.pc
452 %endif
453
454 %files doc
455 %defattr(-,root,root,-)
456 %doc %{_docdir}/%{name}/*
457
458 %if %{?_with_pulse:1}%{!?_with_pulse:0}
459 %files pulse
460 %defattr(-,root,root,-)
461 %{_libdir}/libmurphy-pulse.so.*
462
463 %files pulse-devel
464 %defattr(-,root,root,-)
465 %{_includedir}/murphy/common/pulse-glue.h
466 %{_libdir}/libmurphy-pulse.so
467 %{_libdir}/pkgconfig/murphy-pulse.pc
468 %endif
469
470 %if %{?_with_ecore:1}%{!?_with_ecore:0}
471 %files ecore
472 %defattr(-,root,root,-)
473 %{_libdir}/libmurphy-ecore.so.*
474
475 %files ecore-devel
476 %defattr(-,root,root,-)
477 %{_includedir}/murphy/common/ecore-glue.h
478 %{_libdir}/libmurphy-ecore.so
479 %{_libdir}/pkgconfig/murphy-ecore.pc
480 %endif
481
482 %if %{?_with_glib:1}%{!?_with_glib:0}
483 %files glib
484 %defattr(-,root,root,-)
485 %{_libdir}/libmurphy-glib.so.*
486
487 %files glib-devel
488 %defattr(-,root,root,-)
489 %{_includedir}/murphy/common/glib-glue.h
490 %{_libdir}/libmurphy-glib.so
491 %{_libdir}/pkgconfig/murphy-glib.pc
492 %endif
493
494 %if %{?_with_qt:1}%{!?_with_qt:0}
495 %files qt
496 %defattr(-,root,root,-)
497 %{_libdir}/libmurphy-qt.so.*
498
499 %files qt-devel
500 %defattr(-,root,root,-)
501 %{_includedir}/murphy/common/qt-glue.h
502 %{_libdir}/libmurphy-qt.so
503 %{_libdir}/pkgconfig/murphy-qt.pc
504 %endif
505
506 %files tests
507 %defattr(-,root,root,-)
508 %{_bindir}/resource-client
509 %{_bindir}/resource-api-test
510 %{_bindir}/test-domain-controller
511 %{_bindir}/murphy-console
512
513 %changelog
514 * Tue Nov 27 2012 Krisztian Litkey <krisztian.litkey@intel.com> -
515 - Initial build for 2.0alpha.