system/pstate-frequency: Updated for version 3.5.1.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Sébastien Ballet 2016-09-29 18:17:59 +07:00 committed by Willy Sudiarto Raharjo
parent a96cd2882c
commit 46150f0ac8
No known key found for this signature in database
GPG key ID: 887B8374D7333381
3 changed files with 80 additions and 29 deletions

View file

@ -5,20 +5,38 @@ the state of turbo boost.
You can enable optional feature by passing variables to
the script (ie. VAR=yes/no ./pstate-frequency.SlackBuild) :
WITH_UDEV_RULE=yes|no (default:no)
Installs an udev rule for automatic frequency setting
when the power source thas changed.
WITH_COMPLETION=yes|no (default:no)
Installs bash & zsh completion.
WITH_POWER_PLANS=yes|no (default=yes)
Installs power plans in /etc/pstate-frequency.d/
Optional Dependencies :
Power Plans are convenience shortcuts which essentially
alias to calling pstate-frequency with various options.
They are not necessary for operation, but are recommended.
WITH_BASH_COMPLETION=yes|no (default=no)
Installs bash completion.
WITH_ZSH_COMPLETION=yes|no (default=no)
Installs zsh completion.
WITH_UDEV_RULE=yes|no (default=no)
Installs an udev rule for automatic frequency setting
when the power source has changed.
The udev rule is installed in directory specified by
environment variable UDEV_RULE_DIR which, by default,
is set to /lib/udev/rules.d. To install rule in, for
instance, /etc/udev/rules.d, run the SlackBuild as
below :
WITH_UDEV_RULE=yes UDEV_RULE_DIR=/etc/udev/rules.d ./pstate-frequency.SlackBuild
Optional Dependencies :
* x86_energy_perf_policy
This is used to set the CPU to normal performance
policy upon suspend and resume. It is used to
currently work around an assumed bug whereby on
resume the system is set to performance policy on
one core. It can help fix issues where upon resume
of the system, the CPU runs at frequencies higher
This is used to set the CPU to normal performance
policy upon suspend and resume. It is used to
currently work around an assumed bug whereby on
resume the system is set to performance policy on
one core. It can help fix issues where upon resume
of the system, the CPU runs at frequencies higher
than that which is advertised to be available.

View file

@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=pstate-frequency
VERSION=${VERSION:-3.4.1}
VERSION=${VERSION:-3.5.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@ -35,8 +35,12 @@ if [ -z "$ARCH" ]; then
esac
fi
WITH_POWER_PLANS=${WITH_POWER_PLANS:-yes}
WITH_BASH_COMPLETION=${WITH_BASH_COMPLETION:-no}
WITH_ZSH_COMPLETION=${WITH_ZSH_COMPLETION:-no}
WITH_SYSTEMD_UNIT=${WITH_SYSTEMD_UNIT:-no}
WITH_UDEV_RULE=${WITH_UDEV_RULE:-no}
WITH_COMPLETION=${WITH_COMPLETION:-no}
UDEV_RULE_DIR=${UDEV_RULE_DIR:-/lib/udev/rules.d/} # not used when WITH_UDEV_RULE=no
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
@ -64,21 +68,50 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
mkdir -p $PKG/usr/bin
install -m 755 pstate-frequency -t $PKG/usr/bin
[ "${WITH_POWER_PLANS}" != "no" ] && __INCLUDE_POWER_PLANS=1 || __INCLUDE_POWER_PLANS=0
[ "${WITH_BASH_COMPLETION}" != "no" ] && __INCLUDE_BASH_COMPLETION=1 || __INCLUDE_BASH_COMPLETION=0
[ "${WITH_ZSH_COMPLETION}" != "no" ] && __INCLUDE_ZSH_COMPLETION=1 || __INCLUDE_ZSH_COMPLETION=0
[ "${WITH_SYSTEMD_UNIT}" != "no" ] && __INCLUDE_SYSTEMD_UNIT=1 || __INCLUDE_SYSTEMD_UNIT=0
[ "${WITH_UDEV_RULE}" != "no" ] && __INCLUDE_UDEV_RULE=1 || __INCLUDE_UDEV_RULE=0
if [ "$WITH_UDEV_RULE" != "no" ] ; then
mkdir -p $PKG/etc/udev/rules.d
install -m 644 res/udev/99-pstate-frequency.rules -t $PKG/etc/udev/rules.d
fi
if [ "$WITH_COMPLETION" != "no" ] ; then
install -D -m 644 res/shell/bash/bash_completion $PKG/usr/share/bash-completion/completions/pstate-frequency
install -D -m 644 res/shell/zsh/zsh_completion $PKG/usr/share/zsh/site-functions/_pstate-frequency
make install DESTDIR="$PKG" \
PREFIX="/usr" \
INCLUDE_POWER_PLANS=${__INCLUDE_POWER_PLANS} \
INCLUDE_BASH_COMPLETION=${__INCLUDE_BASH_COMPLETION} \
INCLUDE_ZSH_COMPLETION=${__INCLUDE_ZSH_COMPLETION} \
INCLUDE_SYSTEMD_UNIT=${__INCLUDE_SYSTEMD_UNIT} \
INCLUDE_UDEV_RULE=${__INCLUDE_UDEV_RULE} \
INCLUDE_DOC=1 \
INCLUDE_LICENSE=1
if [ "${WITH_UDEV_RULE}" != "no" ] ; then
# Move udev rule in $PKG/UDEV_RULE_DIR (Makefile install udev rule
# in PKG/usr/lib/udev/rules.d/
#
mkdir -p $PKG/${UDEV_RULE_DIR}
mv $PKG/usr/lib/udev/rules.d/* $PKG/${UDEV_RULE_DIR}
rm -rf $PKG/usr/lib
fi
# install docs & Slackbuild
#
# Makefile install Readme.md & license in PKG/usr/share/doc/$PRGNAM, so
# we need to move that in right place (ie. PKG/usr/doc/$PRGNAM-$VERSION)
#
# *Attention*, usr/share is removed when INCLUDE_BASH_COMPLETION and
# INCLUDE_ZSH_COMPLETION are disabled. Otherwise, only usr/share/doc
# must be removed.
#
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
mv $PKG/usr/share/doc/$PRGNAM/* $PKG/usr/doc/$PRGNAM-$VERSION
if [ "${WITH_BASH_COMPLETION}" != "no" ] || [ "${WITH_ZSH_COMPLETION}" != "no" ] ; then
rm -rf $PKG/usr/share/doc
else
rm -rf $PKG/usr/share
fi
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

View file

@ -1,8 +1,8 @@
PRGNAM="pstate-frequency"
VERSION="3.4.1"
VERSION="3.5.1"
HOMEPAGE="https://github.com/pyamsoft/pstate-frequency"
DOWNLOAD="https://github.com/pyamsoft/pstate-frequency/archive/3.4.1.tar.gz"
MD5SUM="cc90e44e1e2713353b7ee361bd1386d3"
DOWNLOAD="https://github.com/pyamsoft/pstate-frequency/archive/3.5.1.tar.gz"
MD5SUM="8c80c9cfbb8ff8090cc11bf1cc9a5da6"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""