- modify config on initial install only, rel 1 AC-STABLE auto/ac/cpufreqd-2_2_0-1
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 24 Sep 2006 20:11:49 +0000 (20:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cpufreqd.spec -> 1.31

cpufreqd.spec

index 06d9d5d..0fcc85d 100644 (file)
@@ -6,7 +6,7 @@ Summary:        Scales your cpu frequency
 Summary(pl):   Skalowanie czêstotliwo¶ci procesora
 Name:          cpufreqd
 Version:       2.2.0
-Release:       0.1
+Release:       1
 License:       GPL v2
 Group:         Applications/System
 Source0:       http://dl.sourceforge.net/cpufreqd/%{name}-%{version}.tar.bz2
@@ -60,21 +60,23 @@ install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 rm -rf $RPM_BUILD_ROOT
 
 %post
-/sbin/chkconfig --add cpufreqd
-
-# Modify config file for 2.6
-if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
-       # translate percentages in integer values
-       CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
-       CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
-       CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 ))
-       CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 ))
-       sed -i -e "s/100%/$CPUFREQD_MAX_SPEED/; \
-               s/66%/$CPUFREQD_MHIGH_SPEED/; \
-               s/33%/$CPUFREQD_MLOW_SPEED/;  \
-               s/0%/$CPUFREQD_MIN_SPEED/;" \
-               %{_sysconfdir}/cpufreqd.conf
+if [ "$1" = 1 ]; then
+       # Modify config file for 2.6
+       if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
+               # translate percentages in integer values
+               CPUFREQD_MAX_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
+               CPUFREQD_MIN_SPEED=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
+               CPUFREQD_MHIGH_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 66 ))
+               CPUFREQD_MLOW_SPEED=$(( $CPUFREQD_MAX_SPEED / 100 * 33 ))
+               sed -i -e "s/100%/$CPUFREQD_MAX_SPEED/; \
+                       s/66%/$CPUFREQD_MHIGH_SPEED/; \
+                       s/33%/$CPUFREQD_MLOW_SPEED/;  \
+                       s/0%/$CPUFREQD_MIN_SPEED/;" \
+                       %{_sysconfdir}/cpufreqd.conf
+       fi
 fi
+
+/sbin/chkconfig --add cpufreqd
 %service cpufreqd restart "CPU FREQ daemon"
 
 %preun
This page took 0.033475 seconds and 4 git commands to generate.