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