Remove initscripts and add PIDFile to service file
[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:      System/Power Management
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: 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 .
43
44 make %{?jobs:-j%jobs}
45
46 %install
47 rm -rf %{buildroot}
48 %make_install
49
50 mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
51 install -m 0644 %{SOURCE1} %{buildroot}/usr/lib/systemd/system/power-manager.service
52 ln -s ../power-manager.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/power-manager.service
53
54 %post
55 vconftool set -t int memory/pm/state 0 -i
56 vconftool set -t int memory/pm/battery_timetofull -1 -i
57 vconftool set -t int memory/pm/battery_timetoempty -1 -i
58 vconftool set -t int memory/pm/custom_brightness_status 0 -i -g 5000
59 vconftool set -t bool memory/pm/brt_changed_lpm 0 -i
60 vconftool set -t int memory/pm/current_brt 60 -i -g 5000
61 vconftool set -t int memory/pm/sip_status 0 -i -g 5000
62
63 heynotitool set system_wakeup
64 heynotitool set pm_event
65
66 mkdir -p /etc/udev/rules.d
67 if ! [ -L /etc/udev/rules.d/91-power-manager.rules ]; then
68         ln -s %{_datadir}/power-manager/udev-rules/91-power-manager.rules /etc/udev/rules.d/91-power-manager.rules
69 fi
70
71 %files
72 %manifest %{name}.manifest
73 %license LICENSE.APLv2
74 %{_bindir}/pm_event
75 %{_bindir}/pmctrl
76 %{_bindir}/power_manager
77 /usr/lib/systemd/system/power-manager.service
78 /usr/lib/systemd/system/multi-user.target.wants/power-manager.service
79 %{_datadir}/power-manager/udev-rules/91-power-manager.rules