]> git.pld-linux.org Git - packages/cpufreqd.git/blame - cpufreqd.spec
- release 2
[packages/cpufreqd.git] / cpufreqd.spec
CommitLineData
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 5Summary: Scales your cpu frequency
db349442 6Summary(pl.UTF-8): Skalowanie częstotliwości procesora
e268c4aa 7Name: cpufreqd
569b87fd 8Version: 2.2.1
4a545377 9Release: 2
e268c4aa
PG
10License: GPL v2
11Group: Applications/System
c4944298 12Source0: http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2
569b87fd 13# Source0-md5: e66f22915c8ce609cd0c8f254da11c08
8de6b194 14Source1: %{name}.init
674c3d44 15URL: http://cpufreqd.sourceforge.net/
ee5717c2
AM
16BuildRequires: autoconf
17BuildRequires: automake
c4944298 18BuildRequires: cpufrequtils-devel
ee5717c2 19BuildRequires: libtool
eedf46df 20BuildRequires: rpmbuild(macros) >= 1.268
fed5bef9 21BuildRequires: sysfsutils-devel
eedf46df 22Requires(post): sed >= 4.0
d99d7b0e 23Requires(post,preun): /sbin/chkconfig
eedf46df 24Requires: rc-scripts
e268c4aa
PG
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%description
28This daemon monitors /proc/apm for the battery status and scales your
29cpu frequency according to a set of rules. It is very useful for
30providing maximum battery life but good cpu speed at the same time.
31
94f55881 32%description -l pl.UTF-8
744087ed 33Ten demon monitoruje stan baterii przez /proc/apm i skaluje
94f55881
JR
34częstotliwość procesora zgodnie z zestawem reguł. Jest bardzo
35przydatny do zapewniania maksymalnego czasu życia baterii, a
36jednocześ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
51rm -rf $RPM_BUILD_ROOT
071847bd 52install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
ee5717c2
AM
53
54%{__make} install \
55 DESTDIR=$RPM_BUILD_ROOT
e268c4aa 56
071847bd 57install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
e268c4aa
PG
58
59%clean
60rm -rf $RPM_BUILD_ROOT
61
8de6b194 62%post
98ab0fe1
ER
63if [ "$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 77fi
98ab0fe1
ER
78
79/sbin/chkconfig --add cpufreqd
eedf46df 80%service cpufreqd restart "CPU FREQ daemon"
8de6b194
AM
81
82%preun
83if [ "$1" = "0" ]; then
eedf46df 84 %service cpufreqd stop
82e9226f 85 /sbin/chkconfig --del cpufreqd
8de6b194
AM
86fi
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}/*
This page took 0.056183 seconds and 4 git commands to generate.