32bf24c19dc5989c56cb6bc6cecae03ecf93645b
[platform/core/system/power-manager.git] / packaging / power-manager.spec
1 Name:       power-manager
2 Summary:    Power manager
3 Version:    1.3.23
4 Release:    9
5 Group:      framework/system
6 License:    APLv2
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: packaging/power-manager.manifest 
9 Requires(post): /usr/bin/vconftool
10 Source1:        power-manager.service
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(glib-2.0)
13 BuildRequires:  pkgconfig(vconf)
14 BuildRequires:  pkgconfig(sysman)
15 BuildRequires:  pkgconfig(aul)
16 BuildRequires:  pkgconfig(dlog)
17 BuildRequires:  pkgconfig(sensor)
18 BuildRequires:  pkgconfig(devman)
19 BuildRequires:  pkgconfig(device-node)
20 BuildRequires:  pkgconfig(heynoti)
21 Requires(post): system-server
22
23 %description
24 Description: Power manager
25
26
27 %prep
28 %setup -q 
29
30 %build
31 cp %{SOURCE1001} .
32 %ifnarch %arm
33 %if 0%{?simulator}
34 #for emulator
35 CFLAGS+=" -DTIZEN_EMUL"
36 %else
37 #for real device
38 CFLAGS+=" -DX86"
39 %endif
40 export CFLAGS
41 %endif
42 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
43
44 make %{?jobs:-j%jobs}
45
46 %install
47 rm -rf %{buildroot}
48 %make_install
49
50 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
51 install -m 0644 %{SOURCE1} %{buildroot}%{_libdir}/systemd/system/power-manager.service
52 ln -s ../power-manager.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/power-manager.service
53
54 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d/
55 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d/
56 ln -s %{_sysconfdir}/init.d/pmctrl %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S35power-manager
57 ln -s %{_sysconfdir}/init.d/pmctrl %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S00power-manager
58
59 %post
60 vconftool set -t int memory/pm/state 0 -i
61 vconftool set -t int memory/pm/battery_timetofull -1 -i
62 vconftool set -t int memory/pm/battery_timetoempty -1 -i
63 vconftool set -t int memory/pm/custom_brightness_status 0 -i -g 5000
64 vconftool set -t bool memory/pm/brt_changed_lpm 0 -i
65 vconftool set -t int memory/pm/current_brt 60 -i -g 5000
66 vconftool set -t int memory/pm/sip_status 0 -i -g 5000
67
68 heynotitool set system_wakeup
69 heynotitool set pm_event
70
71 mkdir -p /etc/udev/rules.d
72 if ! [ -L /etc/udev/rules.d/91-power-manager.rules ]; then
73         ln -s %{_datadir}/power-manager/udev-rules/91-power-manager.rules /etc/udev/rules.d/91-power-manager.rules
74 fi
75
76 %files
77 %manifest power-manager.manifest
78 %{_sysconfdir}/rc.d/init.d/pmctrl
79 %{_sysconfdir}/rc.d/rc3.d/S35power-manager
80 %{_sysconfdir}/rc.d/rc5.d/S00power-manager
81 %{_bindir}/pm_event
82 %{_bindir}/pmctrl
83 %{_bindir}/power_manager
84 %{_libdir}/systemd/system/power-manager.service
85 %{_libdir}/systemd/system/multi-user.target.wants/power-manager.service
86 %{_datadir}/power-manager/udev-rules/91-power-manager.rules