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