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