]> git.pld-linux.org Git - packages/cpufreqd.git/blob - cpufreqd.spec
- updated to 1.2.2
[packages/cpufreqd.git] / cpufreqd.spec
1 # TODO:
2 # - loading modules in init-script, if needed
3 Summary:        Scales your cpu frequency
4 Summary(pl):    Skalowanie czêstotliwo¶ci procesora
5 Name:           cpufreqd
6 Version:        1.2.2
7 Release:        1
8 License:        GPL v2
9 Group:          Applications/System
10 Source0:        http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.gz
11 # Source0-md5:  e26bd0a1566aae79398c92be155c0367
12 # Source0-size: 330959
13 Source1:        %{name}.init
14 Patch0:         %{name}-am.patch
15 URL:            http://www.brodo.de/cpufreq/
16 BuildRequires:  autoconf
17 BuildRequires:  automake
18 BuildRequires:  libtool
19 Requires(post): sed
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %description
23 This daemon monitors /proc/apm for the battery status and scales your
24 cpu frequency according to a set of rules. It is very useful for
25 providing maximum battery life but good cpu speed at the same time.
26
27 %description -l pl
28 Ten demon monitoruje stan baterii przez /proc/apm i skaluje
29 czêstotliwo¶æ procesora zgodnie z zestawem regu³. Jest bardzo
30 przydatny do zapewniania maksymalnego czasu ¿ycia baterii, a
31 jednocze¶nie dobrej szybko¶ci procesora.
32
33 %prep
34 %setup -q
35 %patch0 -p1
36
37 %build
38 %{__libtoolize}
39 %{__aclocal}
40 %{__autoconf}
41 %{__automake}
42 %configure \
43         --libdir=%{_libdir}/%{name}
44 %{__make}
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
49
50 %{__make} install \
51         DESTDIR=$RPM_BUILD_ROOT
52
53 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
54
55 %clean
56 rm -rf $RPM_BUILD_ROOT
57
58 %post
59 /sbin/chkconfig --add cpufreqd
60
61 # Modify config file for 2.6
62 if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
63         # translate percentages in integer values
64         CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
65         CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
66         CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 ))
67         CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 ))
68         cat /etc/cpufreqd.conf | sed -e "s/100%/$CPUFREQD_MAX_SPEED/;  \
69                                                 s/66%/$CPUFREQD_MHIGH_SPEED/; \
70                                                 s/33%/$CPUFREQD_MLOW_SPEED/;  \
71                                                 s/0%/$CPUFREQD_MIN_SPEED/;" > \
72                                         /etc/cpufreqd.conf
73 fi
74
75 if [ -f /var/lock/subsys/cpufreqd ]; then
76         /etc/rc.d/init.d/cpufreqd restart >&2
77 else
78         echo "Run \"/etc/rc.d/init.d/cpufreqd start\" to start CPU FREQ daemon."
79 fi
80
81 %preun
82 if [ "$1" = "0" ]; then
83         if [ -f /var/lock/subsys/cpufreqd ]; then
84                 /etc/rc.d/init.d/cpufreqd stop>&2
85         fi
86         /sbin/chkconfig --del cpufreqd
87 fi
88
89 %files
90 %defattr(644,root,root,755)
91 %doc README TODO
92 %attr(754,root,root) %{_sbindir}/*
93 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.conf
94 %{_mandir}/man?/*
95 %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/%{name}
96 %dir %{_libdir}/%{name}
97 %attr(755,root,root) %{_libdir}/%{name}/*
This page took 0.054336 seconds and 4 git commands to generate.