- more TODO - builds, not tested yet
[packages/cpufreqd.git] / cpufreqd.spec
1 # TODO:
2 # - loading modules in init-script, if needed
3 # - missing plugin: nvclock, sensors
4 # - move plugins into separate packages? (some is needed, because of additional deps)
5 Summary:        Scales your cpu frequency
6 Summary(pl):    Skalowanie czêstotliwo¶ci procesora
7 Name:           cpufreqd
8 Version:        2.0.0
9 Release:        0.2
10 License:        GPL v2
11 Group:          Applications/System
12 Source0:        http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2
13 # Source0-md5:  26a6e0795624114cc15aa48ad8b6ca6b
14 Source1:        %{name}.init
15 Patch0:         %{name}-am.patch
16 URL:            http://cpufreqd.sourceforge.net/
17 BuildRequires:  autoconf
18 BuildRequires:  automake
19 BuildRequires:  cpufrequtils-devel
20 BuildRequires:  libtool
21 PreReq:         rc-scripts
22 Requires(post,preun):   /sbin/chkconfig
23 Requires(post): sed
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %description
27 This daemon monitors /proc/apm for the battery status and scales your
28 cpu frequency according to a set of rules. It is very useful for
29 providing maximum battery life but good cpu speed at the same time.
30
31 %description -l pl
32 Ten demon monitoruje stan baterii przez /proc/apm i skaluje
33 czêstotliwo¶æ procesora zgodnie z zestawem regu³. Jest bardzo
34 przydatny do zapewniania maksymalnego czasu ¿ycia baterii, a
35 jednocze¶nie dobrej szybko¶ci procesora.
36
37 %prep
38 %setup -q
39 %patch0 -p1
40
41 %build
42 %{__libtoolize}
43 %{__aclocal}
44 %{__autoconf}
45 %{__automake}
46 %configure \
47         --libdir=%{_libdir}/%{name}
48 %{__make}
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
53
54 %{__make} install \
55         DESTDIR=$RPM_BUILD_ROOT
56
57 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
58
59 %clean
60 rm -rf $RPM_BUILD_ROOT
61
62 %post
63 /sbin/chkconfig --add cpufreqd
64
65 # Modify config file for 2.6
66 if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
67         # translate percentages in integer values
68         CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
69         CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
70         CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 ))
71         CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 ))
72         cat /etc/cpufreqd.conf | sed -e "s/100%/$CPUFREQD_MAX_SPEED/;  \
73                                                 s/66%/$CPUFREQD_MHIGH_SPEED/; \
74                                                 s/33%/$CPUFREQD_MLOW_SPEED/;  \
75                                                 s/0%/$CPUFREQD_MIN_SPEED/;" > \
76                                         /etc/cpufreqd.conf
77 fi
78
79 if [ -f /var/lock/subsys/cpufreqd ]; then
80         /etc/rc.d/init.d/cpufreqd restart >&2
81 else
82         echo "Run \"/etc/rc.d/init.d/cpufreqd start\" to start CPU FREQ daemon."
83 fi
84
85 %preun
86 if [ "$1" = "0" ]; then
87         if [ -f /var/lock/subsys/cpufreqd ]; then
88                 /etc/rc.d/init.d/cpufreqd stop>&2
89         fi
90         /sbin/chkconfig --del cpufreqd
91 fi
92
93 %files
94 %defattr(644,root,root,755)
95 %doc README TODO
96 %attr(754,root,root) %{_sbindir}/*
97 %attr(755,root,root) %{_bindir}/*
98 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
99 %{_mandir}/man?/*
100 %attr(754,root,root) /etc/rc.d/init.d/%{name}
101 %dir %{_libdir}/%{name}
102 %attr(755,root,root) %{_libdir}/%{name}/*
This page took 0.200564 seconds and 3 git commands to generate.