1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
|
# These are on by default, unless explicitly disabled.
%bcond_without lua
%bcond_without pulse
%bcond_without ecore
%bcond_without glib
%bcond_with dbus
%bcond_without telephony
%bcond_without websockets
%bcond_without smack
%bcond_with sysmon
# These are off by default, unless explicitly enabled.
#
# Notes:
# By default we build with distro-default compilation flags which
# enables optimizations. If you want to build with full debugging
# ie. with optimization turned off and full debug info (-O0 -g3)
# pass '--with debug' to rpmbuild on the command line. Similary
# you can chose to compile with/without pulse, ecore, glib, qt,
# dbus, and telephony support.
#
# qt is the macro for controlling Qt4 support, which is not supported
# in Tizen any more. qt5 is the corrsponding macro for controlling
# Qt5 support.
#
#%bcond_with qt
#%bcond_with debug
Summary: Resource policy framework
Name: murphy
Version: 0.0.75
Release: 16
License: BSD-3-Clause
Group: System/Service
URL: http://01.org/murphy/
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
#Requires(post): libcap-tools
BuildRequires: flex
BuildRequires: bison
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(libsystemd-journal)
BuildRequires: pkgconfig(dlog)
#BuildRequires: pkgconfig(libcap)
#BuildRequires: pkgconfig(libtzplatform-config)
#%if %{with pulse}
#BuildRequires: pkgconfig(libpulse)
#%endif
#%if %{with ecore}
#BuildRequires: pkgconfig(ecore)
#BuildRequires: mesa-libEGL
#BuildRequires: mesa-libGLESv2
#%endif
%if %{with glib}
BuildRequires: pkgconfig(glib-2.0)
%endif
%if %{with qt}
BuildRequires: pkgconfig(QtCore)
%endif
%if %{with dbus}
BuildRequires: pkgconfig(dbus-1)
%endif
#%if %{with telephony}
#BuildRequires: pkgconfig(ofono)
#%endif
#%if %{with websockets}
#BuildRequires: libwebsockets-devel
#%endif
BuildRequires: pkgconfig(json-c)
#%if %{with smack}
#BuildRequires: pkgconfig(libsmack)
#%endif
%description
This package contains the basic Murphy daemon.
%package devel
Summary: The header files and libraries needed for Murphy development
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libjson-devel
%description devel
This package contains header files and libraries necessary for development.
%package doc
Summary: Documentation for Murphy
Group: SDK/Documentation
%description doc
This package contains documentation.
#%if %{with pulse}
#%package pulse
#Summary: Murphy PulseAudio mainloop integration
#Group: System/Libraries
#Requires: %{name} = %{version}-%{release}
#%description pulse
#This package contains the Murphy PulseAudio mainloop integration runtime files.
#%package pulse-devel
#Summary: Murphy PulseAudio mainloop integration development files
#Group: System/Libraries
#Requires: %{name}-pulse = %{version}-%{release}
#Requires: %{name} = %{version}-%{release}
#%description pulse-devel
#This package contains the Murphy PulseAudio mainloop integration development
#files.
#%endif
#%if %{with ecore}
#%package ecore
#Summary: Murphy EFL/ecore mainloop integration
#Group: System/Libraries
#Requires: %{name} = %{version}-%{release}
#%description ecore
#This package contains the Murphy EFL/ecore mainloop integration runtime files.
#%package ecore-devel
#Summary: Murphy EFL/ecore mainloop integration development files
#Group: System/Libraries
#Requires: %{name}-ecore = %{version}-%{release}
#Requires: %{name} = %{version}-%{release}
#%description ecore-devel
#This package contains the Murphy EFL/ecore mainloop integration development
#files.
#%endif
%if %{with glib}
%package glib
Summary: Murphy glib mainloop integration
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
%description glib
This package contains the Murphy glib mainloop integration runtime files.
%package glib-devel
Summary: Murphy glib mainloop integration development files
Group: System/Libraries
Requires: %{name}-glib = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
%description glib-devel
This package contains the Murphy glib mainloop integration development
files.
%endif
%if %{with qt}
%package qt
Summary: Murphy Qt mainloop integration
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
%description qt
This package contains the Murphy Qt mainloop integration runtime files.
%package qt-devel
Summary: Murphy Qt mainloop integration development files
Group: System/Libraries
Requires: %{name}-qt = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
%description qt-devel
This package contains the Murphy Qt mainloop integration development
files.
%endif
%package tests
Summary: Various test binaries for Murphy
Group: System/Testing
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
%description tests
This package contains various test binaries for Murphy.
%prep
%setup -q
cp %{SOURCE1001} .
%build
%if "%{asan}" == "1"
%restore_fcommon
export CFLAGS="-DTIZEN_DISABLE_MEMORY_CHECK"
%endif
%if %{with debug}
export CFLAGS="-O0 -g3"
V="V=1"
%endif
CONFIG_OPTIONS=""
DYNAMIC_PLUGINS="domain-control"
#%if %{with pulse}
#CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-pulse"
#%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-pulse"
#%endif
#%if %{with ecore}
#CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-ecore"
#%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-ecore"
#%endif
%if %{with glib}
CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-glib"
%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-glib"
%endif
%if %{with qt}
CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-qt"
%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-qt"
%endif
%if %{with dbus}
CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-libdbus"
%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-libdbus"
%endif
#%if %{with telephony}
#CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-telephony"
#%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-telephony"
#%endif
#%if %{with websockets}
#CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-websockets"
#%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
#%endif
#%if %{with smack}
#CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-smack"
#%else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
#%endif
#relro
CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-relro"
#dlog
CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-dlog"
./bootstrap
%configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS
%__make clean
%__make %{?_smp_mflags} $V
%install
rm -rf %{buildroot}
%make_install
# Make sure we have a plugin dir even if all the basic plugins
# are configured to be built in.
mkdir -p %{buildroot}%{_libdir}/murphy/plugins
# Get rid of any *.la files installed by libtool.
rm -f %{buildroot}%{_libdir}/*.la
# Clean up also the murphy DB installation.
rm -f %{buildroot}%{_libdir}/murphy/*.la
# Generate list of linkedin plugins (depends on the configuration).
outdir="`pwd`"
pushd %{buildroot}
find ./%{_libdir} -name libmurphy-plugin-*.so* | \
sed 's#^./*#/#g' > $outdir/filelist.plugins-base
popd
echo "Found the following linked-in plugin files:"
cat $outdir/filelist.plugins-base | sed 's/^/ /g'
# Generate list of header files, filtering ones that go to subpackages.
outdir="`pwd`"
pushd %{buildroot}
find ./%{_includedir}/murphy | \
grep -E -v '((pulse)|(ecore)|(glib)|(qt))-glue' | \
sed 's#^./*#/#g' > $outdir/filelist.devel-includes
popd
# Replace the default sample/test config files with the packaging ones.
rm -f %{buildroot}%{_sysconfdir}/murphy/*
cp packaging/murphy-lua.conf %{buildroot}%{_sysconfdir}/murphy/murphy.conf
# Copy tmpfiles.d config file in place
mkdir -p %{buildroot}%{_tmpfilesdir}
cp packaging/murphyd.conf %{buildroot}%{_tmpfilesdir}
# Copy the systemd files in place.
mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
cp packaging/murphyd.service %{buildroot}%{_unitdir}
ln -sf ../murphyd.service %{buildroot}%{_unitdir}/multi-user.target.wants/murphyd.service
%if %{with dbus}
mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
sed "s/@TZ_SYS_USER_GROUP@/%{TZ_SYS_USER_GROUP}/g" \
packaging/org.Murphy.conf.in > packaging/org.Murphy.conf
cp packaging/org.Murphy.conf \
%{buildroot}%{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
%endif
%clean
rm -rf %{buildroot}
%post
#setcap 'cap_net_admin=+ep' %{_bindir}/murphyd
ldconfig
%postun
ldconfig
%if %{with glib}
%post glib
ldconfig
%postun glib
ldconfig
%endif
#%if %{with pulse}
#%post pulse
#ldconfig
#%postun pulse
#ldconfig
#%endif
#%if %{with ecore}
#%post ecore
#ldconfig
#%postun ecore
#ldconfig
#%endif
%if %{with qt}
%post qt
ldconfig
%postun qt
ldconfig
%endif
%files -f filelist.plugins-base
%license COPYING LICENSE-BSD
%defattr(-,root,root,-)
%manifest murphy.manifest
%{_bindir}/murphyd
%config %{_sysconfdir}/murphy
%{_unitdir}/multi-user.target.wants/murphyd.service
%{_unitdir}/murphyd.service
%{_tmpfilesdir}/murphyd.conf
%if %{with dbus}
%{_sysconfdir}/dbus-1/system.d
%config %{_sysconfdir}/dbus-1/system.d/org.Murphy.conf
%endif
#%if %{with websockets}
#%{_datadir}/murphy
#%endif
%{_libdir}/libmurphy-common.so.*
%{_libdir}/libmurphy-core.so.*
%{_libdir}/libmurphy-resolver.so.*
%{_libdir}/libmurphy-resource.so.*
%{_libdir}/libmurphy-resource-backend.so.*
%if %{with lua}
%{_libdir}/libmurphy-lua-utils.so.*
%{_libdir}/libmurphy-lua-decision.so.*
%endif
%{_libdir}/libmurphy-domain-controller.so.*
%{_libdir}/murphy/*.so.*
%{_libdir}/libbreedline*.so.*
%if %{with dbus}
%{_libdir}/libmurphy-libdbus.so.*
%{_libdir}/libmurphy-dbus-libdbus.so.*
%endif
%if %{with sysmon}
%{_libdir}/libmurphy-libdbus.so.*
%endif
%{_libdir}/murphy/plugins/plugin-domain-control.so
%{_libdir}/murphy/plugins/plugin-resource-native.so
%files devel -f filelist.devel-includes
%defattr(-,root,root,-)
%{_includedir}/murphy-db
%{_libdir}/libmurphy-common.so
%{_libdir}/libmurphy-core.so
%{_libdir}/libmurphy-resolver.so
%{_libdir}/libmurphy-resource.so
%{_libdir}/libmurphy-resource-backend.so
%if %{with lua}
%{_libdir}/libmurphy-lua-utils.so
%{_libdir}/libmurphy-lua-decision.so
%endif
%{_libdir}/libmurphy-domain-controller.so
%{_libdir}/murphy/*.so
%{_libdir}/pkgconfig/murphy-common.pc
%{_libdir}/pkgconfig/murphy-core.pc
%{_libdir}/pkgconfig/murphy-resolver.pc
%if %{with lua}
%{_libdir}/pkgconfig/murphy-lua-utils.pc
%{_libdir}/pkgconfig/murphy-lua-decision.pc
%endif
%{_libdir}/pkgconfig/murphy-domain-controller.pc
%{_libdir}/pkgconfig/murphy-db.pc
%{_libdir}/pkgconfig/murphy-resource.pc
%{_includedir}/breedline
%{_libdir}/libbreedline*.so
%{_libdir}/pkgconfig/breedline*.pc
%if %{with dbus}
%{_libdir}/libmurphy-libdbus.so
%{_libdir}/libmurphy-dbus-libdbus.so
%{_libdir}/pkgconfig/murphy-libdbus.pc
%{_libdir}/pkgconfig/murphy-dbus-libdbus.pc
%endif
%files doc
%defattr(-,root,root,-)
%doc %{_datadir}/doc/murphy/AUTHORS
%doc %{_datadir}/doc/murphy/CODING-STYLE
%doc %{_datadir}/doc/murphy/ChangeLog
%doc %{_datadir}/doc/murphy/NEWS
%doc %{_datadir}/doc/murphy/README
%license COPYING LICENSE-BSD
#%if %{with pulse}
#%files pulse
#%defattr(-,root,root,-)
#%{_libdir}/libmurphy-pulse.so.*
#%manifest murphy.manifest
#%files pulse-devel
#%defattr(-,root,root,-)
#%{_includedir}/murphy/common/pulse-glue.h
#%{_libdir}/libmurphy-pulse.so
#%{_libdir}/pkgconfig/murphy-pulse.pc
#%endif
#%if %{with ecore}
#%files ecore
#%defattr(-,root,root,-)
#%{_libdir}/libmurphy-ecore.so.*
#%manifest murphy.manifest
#%files ecore-devel
#%defattr(-,root,root,-)
#%{_includedir}/murphy/common/ecore-glue.h
#%{_libdir}/libmurphy-ecore.so
#%{_libdir}/pkgconfig/murphy-ecore.pc
#%endif
%if %{with glib}
%files glib
%defattr(-,root,root,-)
%license COPYING LICENSE-BSD
%{_libdir}/libmurphy-glib.so.*
%manifest murphy.manifest
%files glib-devel
%defattr(-,root,root,-)
%{_includedir}/murphy/common/glib-glue.h
%{_libdir}/libmurphy-glib.so
%{_libdir}/pkgconfig/murphy-glib.pc
%endif
%if %{with qt}
%files qt
%defattr(-,root,root,-)
%{_libdir}/libmurphy-qt.so.*
%manifest murphy.manifest
%files qt-devel
%defattr(-,root,root,-)
%{_includedir}/murphy/common/qt-glue.h
%{_libdir}/libmurphy-qt.so
%{_libdir}/pkgconfig/murphy-qt.pc
%endif
%files tests
%defattr(-,root,root,-)
%{_bindir}/resource-client
%{_bindir}/resource-api-test
%{_bindir}/resource-api-fuzz
%{_bindir}/resource-context-create
%{_bindir}/test-domain-controller
%{_bindir}/murphy-console
%manifest murphy.manifest
|