Fix bugs in managing the system group
[platform/core/system/system-server.git] / packaging / system-server.spec
1 %bcond_with x
2
3 Name:       system-server
4 Summary:    System server
5 Version:    2.0.0
6 Release:    0
7 Group:      System/Service
8 License:    Apache-2.0
9 Source0:    system-server-%{version}.tar.gz
10 Source1:    system-server.manifest
11 Source2:    deviced.manifest
12 Source3:    sysman.manifest
13 Source4:    libslp-pm.manifest
14 Source5:    haptic.manifest
15 Source6:    devman.manifest
16 Source8:    regpmon.service
17 Source9:    zbooting-done.service
18 BuildRequires:  cmake
19 BuildRequires:  libattr-devel
20 BuildRequires:  pkgconfig(ecore)
21 BuildRequires:  pkgconfig(heynoti)
22 BuildRequires:  pkgconfig(vconf)
23 BuildRequires:  pkgconfig(tapi)
24 BuildRequires:  pkgconfig(edbus)
25 BuildRequires:  pkgconfig(dlog)
26 %if %{with x}
27 BuildRequires:  pkgconfig(x11)
28 %endif
29 BuildRequires:  pkgconfig(notification)
30 BuildRequires:  pkgconfig(usbutils)
31 BuildRequires:  pkgconfig(udev)
32 BuildRequires:  pkgconfig(device-node)
33 BuildRequires:  pkgconfig(libsmack)
34 BuildRequires:  gettext
35 BuildRequires:  pkgconfig(sensor)
36 BuildRequires:  pkgconfig(libsystemd-daemon)
37 BuildRequires:  pkgconfig(capi-base-common)
38 BuildRequires:  pkgconfig(libtzplatform-config)
39
40 BuildRequires:  fdupes
41
42 %{?systemd_requires}
43 Requires(post): /usr/bin/vconftool
44
45 %description
46 system server files
47
48 %package -n sysman
49 Summary:    System manager interface library
50 Group:      System/Libraries
51 Requires:   %{name} = %{version}-%{release}
52
53 %description -n sysman
54 system manager internal library files
55
56 %package -n sysman-devel
57 Summary:    System Manager base (devel)
58 Group:      System/Development
59 Requires:   sysman = %{version}-%{release}
60
61 %description -n sysman-devel
62 System Manager base library (devel) files
63
64 %package -n sysman-internal-devel
65 Summary:    System Manager base (devel)
66 Group:      System/Development
67 Requires:   sysman = %{version}-%{release}
68
69 %description -n sysman-internal-devel
70 System Manager base library (devel) files
71
72 %package -n libslp-pm
73 Summary:    Power manager client
74 Group:      System/Libraries
75 Requires:   %{name} = %{version}-%{release}
76
77 %description -n libslp-pm
78 power-manager library files.
79
80 %package -n libslp-pm-devel
81 Summary:    Power manager client (devel)
82 Group:      System/Development
83 Requires:   libslp-pm = %{version}-%{release}
84
85 %description -n libslp-pm-devel
86 power-manager devel library files.
87
88 %package -n libhaptic
89 Summary:    Haptic library
90 Group:      Development/Libraries
91 Requires:   %{name} = %{version}-%{release}
92
93 %description -n libhaptic
94 Haptic library for device control
95
96 %package -n libhaptic-devel
97 Summary:    Haptic library for (devel)
98 Group:      Development/Libraries
99 Requires:   libhaptic = %{version}-%{release}
100
101 %description -n libhaptic-devel
102 Haptic library for device control (devel)
103
104 %package -n libhaptic-plugin-devel
105 Summary:    Haptic plugin library for (devel)
106 Group:      Development/Libraries
107 Requires:   libhaptic = %{version}-%{release}
108
109 %description -n libhaptic-plugin-devel
110 Haptic plugin library for device control (devel)
111
112 %package -n libdevman
113 Summary:    Device manager library
114 Group:      Development/Libraries
115 Requires:   %{name} = %{version}-%{release}
116
117 %description -n libdevman
118 Device manager library for device control
119
120 %package -n libdevman-devel
121 Summary:    Device manager library for (devel)
122 Group:      Development/Libraries
123 Requires:   libdevman = %{version}-%{release}
124
125 %description -n libdevman-devel
126 Device manager library for device control (devel)
127
128 %package -n libdevman-haptic-devel
129 Summary:    Haptic Device manager library for (devel)
130 Group:      Development/Libraries
131 Requires:   libdevman-devel = %{version}-%{release}
132
133 %description -n libdevman-haptic-devel
134 Haptic Device manager library for device control (devel)
135
136 %package -n libdeviced
137 Summary:    Deviced library
138 Group:      System/Libraries
139 Requires:   %{name} = %{version}-%{release}
140
141 %description -n libdeviced
142 Deviced library for device control
143
144 %package -n libdeviced-devel
145 Summary:    Deviced library for (devel)
146 Group:      System/Development
147 Requires:   libdeviced = %{version}-%{release}
148
149 %description -n libdeviced-devel
150 Deviced library for device control (devel)
151
152 %prep
153 %setup -q
154 cp %{SOURCE1} .
155 cp %{SOURCE2} .
156 cp %{SOURCE3} .
157 cp %{SOURCE4} .
158 cp %{SOURCE5} .
159 cp %{SOURCE6} .
160
161 %build
162 %cmake . \
163        -DTZ_SYS_ETC=%TZ_SYS_ETC \
164        -DSYSTEMD_DIR=%{_unitdir}
165
166 %install
167 %make_install
168
169 %install_service multi-user.target.wants system-server.service
170 %install_service sockets.target.wants system-server.socket
171
172 %install_service graphical.target.wants regpmon.service
173 install -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/regpmon.service
174
175 %install_service graphical.target.wants zbooting-done.service
176 install -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/zbooting-done.service
177
178 %if 0%{?simulator}
179 rm -f %{buildroot}%{_bindir}/restart
180 %endif
181
182 %fdupes %{buildroot}
183
184
185 %post
186 #memory type vconf key init
187 users_gid=$(getent group %{TZ_SYS_USER_GROUP} | cut -f3 -d':')
188
189 vconftool set -t int memory/sysman/usbhost_status -1 -i
190 vconftool set -t int memory/sysman/mmc 0 -i
191 vconftool set -t int memory/sysman/earjack_key 0 -i
192 vconftool set -t int memory/sysman/added_usb_storage 0 -i
193 vconftool set -t int memory/sysman/removed_usb_storage 0 -i
194 vconftool set -t int memory/sysman/charger_status -1 -i
195 vconftool set -t int memory/sysman/charge_now -1 -i
196 vconftool set -t int memory/sysman/battery_status_low -1 -i
197 vconftool set -t int memory/sysman/battery_capacity -1 -i
198 vconftool set -t int memory/sysman/usb_status -1 -i
199 vconftool set -t int memory/sysman/earjack -1 -i
200 vconftool set -t int memory/sysman/low_memory 1 -i
201 vconftool set -t int memory/sysman/sliding_keyboard -1 -i
202 vconftool set -t int memory/sysman/mmc_mount -1 -i
203 vconftool set -t int memory/sysman/mmc_unmount -1 -i
204 vconftool set -t int memory/sysman/mmc_format -1 -i
205 vconftool set -t int memory/sysman/mmc_format_progress 0 -i
206 vconftool set -t int memory/sysman/mmc_err_status 0 -i
207 vconftool set -t int memory/sysman/power_off 0 -g "$users_gid" -i -f
208 vconftool set -t int memory/sysman/battery_level_status -1 -i
209 vconftool set -t string memory/private/sysman/added_storage_uevent "" -i
210 vconftool set -t string memory/private/sysman/removed_storage_uevent "" -g "$users_gid" -i
211
212 vconftool set -t int memory/sysman/hdmi 0 -i
213
214 vconftool set -t int memory/sysman/stime_changed 0 -i
215
216 #db type vconf key init
217 vconftool set -t int db/sysman/mmc_dev_changed 0 -i
218
219 vconftool set -t int memory/pm/state 0 -i -g "$users_gid"
220 vconftool set -t int memory/pm/battery_timetofull -1 -i
221 vconftool set -t int memory/pm/battery_timetoempty -1 -i
222 vconftool set -t int memory/pm/sip_status 0 -i -g "$users_gid"
223 vconftool set -t int memory/pm/custom_brightness_status 0 -i -g "$users_gid"
224 vconftool set -t bool memory/pm/brt_changed_lpm 0 -i
225 vconftool set -t int memory/pm/current_brt 60 -i -g "$users_gid"
226
227 heynotitool set system_wakeup
228 heynotitool set pm_event
229
230 heynotitool set power_off_start
231
232 heynotitool set mmcblk_add
233 heynotitool set mmcblk_remove
234 heynotitool set device_charge_chgdet
235 heynotitool set device_usb_host_add
236 heynotitool set device_usb_host_remove
237 heynotitool set device_pci_keyboard_add
238 heynotitool set device_pci_keyboard_remove
239
240 heynotitool set device_usb_chgdet
241 heynotitool set device_ta_chgdet
242 heynotitool set device_earjack_chgdet
243 heynotitool set device_earkey_chgdet
244 heynotitool set device_tvout_chgdet
245 heynotitool set device_hdmi_chgdet
246 heynotitool set device_keyboard_chgdet
247
248
249 systemctl daemon-reload
250 if [ "$1" = "1" ]; then
251     systemctl restart system-server.service
252     systemctl restart regpmon.service
253     systemctl restart zbooting-done.service
254 fi
255 /sbin/ldconfig
256
257 %preun
258 if [ "$1" = "0" ]; then
259     systemctl stop system-server.service
260     systemctl stop regpmon.service
261     systemctl stop zbooting-done.service
262 fi
263
264 %postun
265 systemctl daemon-reload
266 /sbin/ldconfig
267
268 %post -n sysman -p /sbin/ldconfig
269
270 %postun -n sysman -p /sbin/ldconfig
271
272 %post -n libslp-pm -p /sbin/ldconfig
273
274 %postun -n libslp-pm -p /sbin/ldconfig
275
276 %post -n libhaptic -p /sbin/ldconfig
277
278 %postun -n libhaptic -p /sbin/ldconfig
279
280 %post -n libdevman -p /sbin/ldconfig
281
282 %postun -n libdevman -p /sbin/ldconfig
283
284 %post -n libdeviced -p /sbin/ldconfig
285
286 %postun -n libdeviced -p /sbin/ldconfig
287
288 %files
289 %manifest %{name}.manifest
290 %license LICENSE.APLv2
291 %config %{_sysconfdir}/dbus-1/system.d/deviced.conf
292 %{_bindir}/system_server
293 %{_libdir}/system-server/shutdown.sh
294 %if %{undefined simulator}
295 %{_bindir}/restart
296 %endif
297 %{_bindir}/movi_format.sh
298 %{_bindir}/sys_event
299 %{_bindir}/pm_event
300 %{_bindir}/regpmon
301 %{_bindir}/set_pmon
302 %{_bindir}/sys_pci_noti
303 %{_bindir}/mmc-smack-label
304 %{_bindir}/device-daemon
305 %{_bindir}/fsck_msdosfs
306 %{_unitdir}/multi-user.target.wants/system-server.service
307 %{_unitdir}/graphical.target.wants/regpmon.service
308 %{_unitdir}/sockets.target.wants/system-server.socket
309 %{_unitdir}/system-server.service
310 %{_unitdir}/system-server.socket
311 %{_unitdir}/regpmon.service
312 %{_unitdir}/graphical.target.wants/zbooting-done.service
313 %{_unitdir}/zbooting-done.service
314 %{_datadir}/system-server/sys_pci_noti/res/locale/*/LC_MESSAGES/*.mo
315 %{_datadir}/license/fsck_msdosfs
316
317 %files -n sysman
318 %manifest sysman.manifest
319 %defattr(-,root,root,-)
320 %{_libdir}/libsysman.so.*
321
322 %files -n sysman-devel
323 %defattr(-,root,root,-)
324 %{_includedir}/sysman/sysman.h
325 %{_includedir}/sysman/sysman_managed.h
326 %{_includedir}/sysman/sysman_PG.h
327 %{_libdir}/pkgconfig/sysman.pc
328 %{_libdir}/libsysman.so
329
330 %files -n sysman-internal-devel
331 %defattr(-,root,root,-)
332 %{_includedir}/sysman/sysman-internal.h
333
334 %files -n libslp-pm
335 %defattr(-,root,root,-)
336 %manifest libslp-pm.manifest
337 %{_libdir}/libpmapi.so.*
338
339 %files -n libslp-pm-devel
340 %defattr(-,root,root,-)
341 %{_includedir}/pmapi/pmapi.h
342 %{_includedir}/pmapi/pmapi_managed.h
343 %{_includedir}/pmapi/pm_PG.h
344 %{_libdir}/pkgconfig/pmapi.pc
345 %{_libdir}/libpmapi.so
346
347 %files -n libhaptic
348 %defattr(-,root,root,-)
349 %{_libdir}/libhaptic.so.*
350 %manifest haptic.manifest
351
352 %files -n libhaptic-devel
353 %defattr(-,root,root,-)
354 %{_includedir}/haptic/haptic.h
355 %{_libdir}/libhaptic.so
356 %{_libdir}/pkgconfig/haptic.pc
357
358 %files -n libhaptic-plugin-devel
359 %defattr(-,root,root,-)
360 %{_includedir}/haptic/haptic_module.h
361 %{_includedir}/haptic/haptic_plugin_intf.h
362 %{_includedir}/haptic/haptic_PG.h
363 %{_libdir}/pkgconfig/haptic-plugin.pc
364
365 %files -n libdevman
366 %{_bindir}/display_wd
367 %{_libdir}/libdevman.so.*
368 %manifest devman.manifest
369
370 %files -n libdevman-devel
371 %{_includedir}/devman/devman.h
372 %{_includedir}/devman/devman_image.h
373 %{_includedir}/devman/devman_managed.h
374 %{_includedir}/devman/devman_haptic.h
375 %{_includedir}/devman/devman_PG.h
376 %{_libdir}/pkgconfig/devman.pc
377 %{_libdir}/libdevman.so
378
379 %files -n libdevman-haptic-devel
380 %{_includedir}/devman/devman_haptic_ext.h
381 %{_includedir}/devman/devman_haptic_ext_core.h
382 %{_libdir}/pkgconfig/devman_haptic.pc
383
384 %files -n libdeviced
385 %defattr(-,root,root,-)
386 %{_libdir}/libdeviced.so.*
387 %manifest deviced.manifest
388
389 %files -n libdeviced-devel
390 %defattr(-,root,root,-)
391 %{_includedir}/deviced/dd-battery.h
392 %{_includedir}/deviced/dd-control.h
393 %{_includedir}/deviced/dd-deviced.h
394 %{_includedir}/deviced/dd-deviced-managed.h
395 %{_includedir}/deviced/dd-display.h
396 %{_includedir}/deviced/dd-haptic.h
397 %{_includedir}/deviced/dd-led.h
398 %{_includedir}/deviced/haptic-module.h
399 %{_includedir}/deviced/haptic-plugin-intf.h
400 %{_libdir}/libdeviced.so
401 %{_libdir}/pkgconfig/deviced.pc