- up to 2.1.1
[packages/cpufreqd.git] / cpufreqd.spec
1 # TODO:
2 # - loading modules in init-script, if needed
3 # - missing plugin: nvclock, sensors
4 # - move plugins into separate packages? (some is needed, because of additional deps)
5 Summary:        Scales your cpu frequency
6 Summary(pl):    Skalowanie czêstotliwo¶ci procesora
7 Name:           cpufreqd
8 Version:        2.1.1
9 Release:        0.1
10 License:        GPL v2
11 Group:          Applications/System
12 Source0:        http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2
13 # Source0-md5:  06383f704bdf612ba2b8c46b27594266
14 Source1:        %{name}.init
15 URL:            http://cpufreqd.sourceforge.net/
16 BuildRequires:  autoconf
17 BuildRequires:  automake
18 BuildRequires:  cpufrequtils-devel
19 BuildRequires:  libtool
20 BuildRequires:  rpmbuild(macros) >= 1.268
21 BuildRequires:  sysfsutils-devel
22 Requires(post): sed >= 4.0
23 Requires(post,preun):   /sbin/chkconfig
24 Requires:       rc-scripts
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 This daemon monitors /proc/apm for the battery status and scales your
29 cpu frequency according to a set of rules. It is very useful for
30 providing maximum battery life but good cpu speed at the same time.
31
32 %description -l pl
33 Ten demon monitoruje stan baterii przez /proc/apm i skaluje
34 czêstotliwo¶æ procesora zgodnie z zestawem regu³. Jest bardzo
35 przydatny do zapewniania maksymalnego czasu ¿ycia baterii, a
36 jednocze¶nie dobrej szybko¶ci procesora.
37
38 %prep
39 %setup -q
40
41 %build
42 %{__libtoolize}
43 %{__aclocal}
44 %{__autoconf}
45 %{__automake}
46 %configure \
47         --libdir=%{_libdir}/%{name}
48 %{__make}
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
53
54 %{__make} install \
55         DESTDIR=$RPM_BUILD_ROOT
56
57 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
58
59 %clean
60 rm -rf $RPM_BUILD_ROOT
61
62 %post
63 /sbin/chkconfig --add cpufreqd
64
65 # Modify config file for 2.6
66 if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
67         # translate percentages in integer values
68         CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
69         CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
70         CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 ))
71         CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 ))
72         sed -i -e "s/100%/$CPUFREQD_MAX_SPEED/; \
73                 s/66%/$CPUFREQD_MHIGH_SPEED/; \
74                 s/33%/$CPUFREQD_MLOW_SPEED/;  \
75                 s/0%/$CPUFREQD_MIN_SPEED/;" \
76                 %{_sysconfdir}/cpufreqd.conf
77 fi
78 %service cpufreqd restart "CPU FREQ daemon"
79
80 %preun
81 if [ "$1" = "0" ]; then
82         %service cpufreqd stop
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 %attr(755,root,root) %{_bindir}/*
91 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
92 %{_mandir}/man?/*
93 %attr(754,root,root) /etc/rc.d/init.d/%{name}
94 %dir %{_libdir}/%{name}
95 %attr(755,root,root) %{_libdir}/%{name}/*
This page took 0.055114 seconds and 3 git commands to generate.