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