]>
Commit | Line | Data |
---|---|---|
97aa6d78 | 1 | # |
07bdfe6b | 2 | # TODO: |
97aa6d78 | 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 | # | |
e268c4aa | 8 | Summary: Scales your cpu frequency |
db349442 | 9 | Summary(pl.UTF-8): Skalowanie częstotliwości procesora |
e268c4aa | 10 | Name: cpufreqd |
0f395689 AG |
11 | Version: 2.3.0 |
12 | Release: 1 | |
e268c4aa PG |
13 | License: GPL v2 |
14 | Group: Applications/System | |
c4944298 | 15 | Source0: http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2 |
0f395689 | 16 | # Source0-md5: bbf3c3f83abe2e9a9e00ab435fbc87a7 |
8de6b194 | 17 | Source1: %{name}.init |
674c3d44 | 18 | URL: http://cpufreqd.sourceforge.net/ |
ee5717c2 AM |
19 | BuildRequires: autoconf |
20 | BuildRequires: automake | |
c4944298 | 21 | BuildRequires: cpufrequtils-devel |
ee5717c2 | 22 | BuildRequires: libtool |
eedf46df | 23 | BuildRequires: rpmbuild(macros) >= 1.268 |
fed5bef9 | 24 | BuildRequires: sysfsutils-devel |
eedf46df | 25 | Requires(post): sed >= 4.0 |
d99d7b0e | 26 | Requires(post,preun): /sbin/chkconfig |
eedf46df | 27 | Requires: rc-scripts |
e268c4aa PG |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
31 | This daemon monitors /proc/apm for the battery status and scales your | |
32 | cpu frequency according to a set of rules. It is very useful for | |
33 | providing maximum battery life but good cpu speed at the same time. | |
34 | ||
94f55881 | 35 | %description -l pl.UTF-8 |
744087ed | 36 | Ten demon monitoruje stan baterii przez /proc/apm i skaluje |
94f55881 JR |
37 | częstotliwość procesora zgodnie z zestawem reguł. Jest bardzo |
38 | przydatny do zapewniania maksymalnego czasu życia baterii, a | |
39 | jednocześnie dobrej szybkości procesora. | |
744087ed | 40 | |
e268c4aa | 41 | %prep |
cf9958b0 | 42 | %setup -q |
e268c4aa PG |
43 | |
44 | %build | |
ee5717c2 AM |
45 | %{__libtoolize} |
46 | %{__aclocal} | |
47 | %{__autoconf} | |
48 | %{__automake} | |
49 | %configure \ | |
97aa6d78 | 50 | --libdir=%{_libdir}/%{name} \ |
51 | --disable-sensors | |
ee5717c2 | 52 | %{__make} |
e268c4aa PG |
53 | |
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
071847bd | 56 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d |
ee5717c2 AM |
57 | |
58 | %{__make} install \ | |
59 | DESTDIR=$RPM_BUILD_ROOT | |
e268c4aa | 60 | |
071847bd | 61 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
e268c4aa PG |
62 | |
63 | %clean | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | ||
8de6b194 | 66 | %post |
98ab0fe1 ER |
67 | if [ "$1" = 1 ]; then |
68 | # Modify config file for 2.6 | |
69 | if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then | |
70 | # translate percentages in integer values | |
71 | CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` | |
72 | CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq` | |
73 | CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 )) | |
74 | CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 )) | |
75 | sed -i -e "s/100%/$CPUFREQD_MAX_SPEED/; \ | |
76 | s/66%/$CPUFREQD_MHIGH_SPEED/; \ | |
77 | s/33%/$CPUFREQD_MLOW_SPEED/; \ | |
78 | s/0%/$CPUFREQD_MIN_SPEED/;" \ | |
79 | %{_sysconfdir}/cpufreqd.conf | |
80 | fi | |
8de6b194 | 81 | fi |
98ab0fe1 ER |
82 | |
83 | /sbin/chkconfig --add cpufreqd | |
eedf46df | 84 | %service cpufreqd restart "CPU FREQ daemon" |
8de6b194 AM |
85 | |
86 | %preun | |
87 | if [ "$1" = "0" ]; then | |
eedf46df | 88 | %service cpufreqd stop |
82e9226f | 89 | /sbin/chkconfig --del cpufreqd |
8de6b194 AM |
90 | fi |
91 | ||
e268c4aa PG |
92 | %files |
93 | %defattr(644,root,root,755) | |
94 | %doc README TODO | |
663b908d | 95 | %attr(754,root,root) %{_sbindir}/* |
9365e9cd | 96 | %attr(755,root,root) %{_bindir}/* |
071847bd | 97 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf |
ee5717c2 | 98 | %{_mandir}/man?/* |
071847bd | 99 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
ee5717c2 AM |
100 | %dir %{_libdir}/%{name} |
101 | %attr(755,root,root) %{_libdir}/%{name}/* |