3 # - loading modules in init-script, if needed
4 # - missing plugin: nvclock
5 # - disabled plugin: sensors (needs update to build with lm_sensors 3.x)
6 # - move plugins into separate packages? (some is needed, because of additional deps)
7 # - update Polish translations
9 Summary: Fully configurable daemon for dynamic frequency and voltage scaling
10 Summary(pl.UTF-8): Skalowanie częstotliwości procesora
15 Group: Applications/System
16 Source0: http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2
17 # Source0-md5: 2ca80a77849c9a69b81e27c1843c97f5
19 Patch0: %{name}-battery.patch
20 URL: http://www.linux.it/~malattia/wiki/index.php/Cpufreqd
21 BuildRequires: autoconf
22 BuildRequires: automake
23 BuildRequires: cpufrequtils-devel
24 BuildRequires: libtool
25 BuildRequires: rpmbuild(macros) >= 1.268
26 BuildRequires: sysfsutils-devel
27 Requires(post): sed >= 4.0
28 Requires(post,preun): /sbin/chkconfig
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 A small daemon to adjust cpu speed and voltage (and not only) for
34 kernels using any of the cpufreq drivers available. Cpufreqd is not a
36 Cpufreqd allows you to apply governor profiles from rules based on
37 battery level, ac status, temperature (ACPI or sensors), running
38 programs, cpu usage and (maybe) more. You can also change your nforce
39 FSB clock and video card frequency (NVidia only) or execute arbitrary
40 commands when a specific rule is applied.
41 You need a CPU with frequency and voltage scaling capabilities and a
42 Linux kernel with cpufreq support.
44 %description -l pl.UTF-8
45 Ten demon monitoruje stan baterii przez /proc/apm i skaluje
46 częstotliwość procesora zgodnie z zestawem reguł. Jest bardzo
47 przydatny do zapewniania maksymalnego czasu życia baterii, a
48 jednocześnie dobrej szybkości procesora.
60 --libdir=%{_libdir}/%{name} \
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
69 DESTDIR=$RPM_BUILD_ROOT
71 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
74 rm -rf $RPM_BUILD_ROOT
78 # Modify config file for 2.6
79 if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
80 # translate percentages in integer values
81 CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
82 CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
83 CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 ))
84 CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 ))
85 sed -i -e "s/100%/$CPUFREQD_MAX_SPEED/; \
86 s/66%/$CPUFREQD_MHIGH_SPEED/; \
87 s/33%/$CPUFREQD_MLOW_SPEED/; \
88 s/0%/$CPUFREQD_MIN_SPEED/;" \
89 %{_sysconfdir}/cpufreqd.conf
93 /sbin/chkconfig --add cpufreqd
94 %service cpufreqd restart "CPU FREQ daemon"
97 if [ "$1" = "0" ]; then
98 %service cpufreqd stop
99 /sbin/chkconfig --del cpufreqd
103 %defattr(644,root,root,755)
105 %attr(754,root,root) %{_sbindir}/*
106 %attr(755,root,root) %{_bindir}/*
107 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
109 %attr(754,root,root) /etc/rc.d/init.d/%{name}
110 %dir %{_libdir}/%{name}
111 %attr(755,root,root) %{_libdir}/%{name}/*