]>
Commit | Line | Data |
---|---|---|
07bdfe6b PG |
1 | # TODO: |
2 | # - loading modules in init-script, if needed | |
9365e9cd PG |
3 | # - missing plugin: nvclock, sensors |
4 | # - move plugins into separate packages? (some is needed, because of additional deps) | |
e268c4aa | 5 | Summary: Scales your cpu frequency |
db349442 | 6 | Summary(pl.UTF-8): Skalowanie częstotliwości procesora |
e268c4aa | 7 | Name: cpufreqd |
569b87fd | 8 | Version: 2.2.1 |
4a545377 | 9 | Release: 2 |
e268c4aa PG |
10 | License: GPL v2 |
11 | Group: Applications/System | |
c4944298 | 12 | Source0: http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2 |
569b87fd | 13 | # Source0-md5: e66f22915c8ce609cd0c8f254da11c08 |
8de6b194 | 14 | Source1: %{name}.init |
674c3d44 | 15 | URL: http://cpufreqd.sourceforge.net/ |
ee5717c2 AM |
16 | BuildRequires: autoconf |
17 | BuildRequires: automake | |
c4944298 | 18 | BuildRequires: cpufrequtils-devel |
ee5717c2 | 19 | BuildRequires: libtool |
eedf46df | 20 | BuildRequires: rpmbuild(macros) >= 1.268 |
fed5bef9 | 21 | BuildRequires: sysfsutils-devel |
eedf46df | 22 | Requires(post): sed >= 4.0 |
d99d7b0e | 23 | Requires(post,preun): /sbin/chkconfig |
eedf46df | 24 | Requires: rc-scripts |
e268c4aa PG |
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 | ||
94f55881 | 32 | %description -l pl.UTF-8 |
744087ed | 33 | Ten demon monitoruje stan baterii przez /proc/apm i skaluje |
94f55881 JR |
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. | |
744087ed | 37 | |
e268c4aa | 38 | %prep |
cf9958b0 | 39 | %setup -q |
e268c4aa PG |
40 | |
41 | %build | |
ee5717c2 AM |
42 | %{__libtoolize} |
43 | %{__aclocal} | |
44 | %{__autoconf} | |
45 | %{__automake} | |
46 | %configure \ | |
47 | --libdir=%{_libdir}/%{name} | |
48 | %{__make} | |
e268c4aa PG |
49 | |
50 | %install | |
51 | rm -rf $RPM_BUILD_ROOT | |
071847bd | 52 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d |
ee5717c2 AM |
53 | |
54 | %{__make} install \ | |
55 | DESTDIR=$RPM_BUILD_ROOT | |
e268c4aa | 56 | |
071847bd | 57 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
e268c4aa PG |
58 | |
59 | %clean | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
8de6b194 | 62 | %post |
98ab0fe1 ER |
63 | if [ "$1" = 1 ]; then |
64 | # Modify config file for 2.6 | |
65 | if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then | |
66 | # translate percentages in integer values | |
67 | CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` | |
68 | CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq` | |
69 | CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 )) | |
70 | CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 )) | |
71 | sed -i -e "s/100%/$CPUFREQD_MAX_SPEED/; \ | |
72 | s/66%/$CPUFREQD_MHIGH_SPEED/; \ | |
73 | s/33%/$CPUFREQD_MLOW_SPEED/; \ | |
74 | s/0%/$CPUFREQD_MIN_SPEED/;" \ | |
75 | %{_sysconfdir}/cpufreqd.conf | |
76 | fi | |
8de6b194 | 77 | fi |
98ab0fe1 ER |
78 | |
79 | /sbin/chkconfig --add cpufreqd | |
eedf46df | 80 | %service cpufreqd restart "CPU FREQ daemon" |
8de6b194 AM |
81 | |
82 | %preun | |
83 | if [ "$1" = "0" ]; then | |
eedf46df | 84 | %service cpufreqd stop |
82e9226f | 85 | /sbin/chkconfig --del cpufreqd |
8de6b194 AM |
86 | fi |
87 | ||
e268c4aa PG |
88 | %files |
89 | %defattr(644,root,root,755) | |
90 | %doc README TODO | |
663b908d | 91 | %attr(754,root,root) %{_sbindir}/* |
9365e9cd | 92 | %attr(755,root,root) %{_bindir}/* |
071847bd | 93 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf |
ee5717c2 | 94 | %{_mandir}/man?/* |
071847bd | 95 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
ee5717c2 AM |
96 | %dir %{_libdir}/%{name} |
97 | %attr(755,root,root) %{_libdir}/%{name}/* |