]> git.pld-linux.org Git - packages/cpufreqd.git/blob - cpufreqd.spec
- updated URL, SUmmary & descreption
[packages/cpufreqd.git] / cpufreqd.spec
1 #
2 # TODO:
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
8 #
9 Summary:        Fully configurable daemon for dynamic frequency and voltage scaling
10 Summary(pl.UTF-8):      Skalowanie częstotliwości procesora
11 Name:           cpufreqd
12 Version:        2.3.0
13 Release:        1
14 License:        GPL v2
15 Group:          Applications/System
16 Source0:        http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2
17 # Source0-md5:  bbf3c3f83abe2e9a9e00ab435fbc87a7
18 Source1:        %{name}.init
19 URL:            http://www.linux.it/~malattia/wiki/index.php/Cpufreqd
20 BuildRequires:  autoconf
21 BuildRequires:  automake
22 BuildRequires:  cpufrequtils-devel
23 BuildRequires:  libtool
24 BuildRequires:  rpmbuild(macros) >= 1.268
25 BuildRequires:  sysfsutils-devel
26 Requires(post): sed >= 4.0
27 Requires(post,preun):   /sbin/chkconfig
28 Requires:       rc-scripts
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 A small daemon to adjust cpu speed and voltage (and not only) for
33 kernels using any of the cpufreq drivers available. Cpufreqd is not a
34 userspace governor.
35 Cpufreqd allows you to apply governor profiles from rules based on
36 battery level, ac status, temperature (ACPI or sensors), running
37 programs, cpu usage and (maybe) more. You can also change your nforce
38 FSB clock and video card frequency (NVidia only) or execute arbitrary
39 commands when a specific rule is applied.
40 You need a CPU with frequency and voltage scaling capabilities and a
41 Linux kernel with cpufreq support.
42
43 %description -l pl.UTF-8
44 Ten demon monitoruje stan baterii przez /proc/apm i skaluje
45 częstotliwość procesora zgodnie z zestawem reguł. Jest bardzo
46 przydatny do zapewniania maksymalnego czasu życia baterii, a
47 jednocześnie dobrej szybkości procesora.
48
49 %prep
50 %setup -q
51
52 %build
53 %{__libtoolize}
54 %{__aclocal}
55 %{__autoconf}
56 %{__automake}
57 %configure \
58         --libdir=%{_libdir}/%{name} \
59         --disable-sensors
60 %{__make}
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
65
66 %{__make} install \
67         DESTDIR=$RPM_BUILD_ROOT
68
69 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
74 %post
75 if [ "$1" = 1 ]; then
76         # Modify config file for 2.6
77         if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
78                 # translate percentages in integer values
79                 CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
80                 CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
81                 CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 ))
82                 CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 ))
83                 sed -i -e "s/100%/$CPUFREQD_MAX_SPEED/; \
84                         s/66%/$CPUFREQD_MHIGH_SPEED/; \
85                         s/33%/$CPUFREQD_MLOW_SPEED/;  \
86                         s/0%/$CPUFREQD_MIN_SPEED/;" \
87                         %{_sysconfdir}/cpufreqd.conf
88         fi
89 fi
90
91 /sbin/chkconfig --add cpufreqd
92 %service cpufreqd restart "CPU FREQ daemon"
93
94 %preun
95 if [ "$1" = "0" ]; then
96         %service cpufreqd stop
97         /sbin/chkconfig --del cpufreqd
98 fi
99
100 %files
101 %defattr(644,root,root,755)
102 %doc README TODO
103 %attr(754,root,root) %{_sbindir}/*
104 %attr(755,root,root) %{_bindir}/*
105 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
106 %{_mandir}/man?/*
107 %attr(754,root,root) /etc/rc.d/init.d/%{name}
108 %dir %{_libdir}/%{name}
109 %attr(755,root,root) %{_libdir}/%{name}/*
This page took 0.076429 seconds and 3 git commands to generate.