aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/pstate-frequency/README42
-rw-r--r--system/pstate-frequency/pstate-frequency.SlackBuild59
-rw-r--r--system/pstate-frequency/pstate-frequency.info6
3 files changed, 79 insertions, 28 deletions
diff --git a/system/pstate-frequency/README b/system/pstate-frequency/README
index 4752b086fa55..a0bd9d45954e 100644
--- a/system/pstate-frequency/README
+++ b/system/pstate-frequency/README
@@ -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)
+WITH_POWER_PLANS=yes|no (default=yes)
+ Installs power plans in /etc/pstate-frequency.d/
+
+ 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 thas changed.
-
-WITH_COMPLETION=yes|no (default:no)
- Installs bash & zsh completion.
+ 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 :
+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.
diff --git a/system/pstate-frequency/pstate-frequency.SlackBuild b/system/pstate-frequency/pstate-frequency.SlackBuild
index 55d2b4ee6616..dec305ada982 100644
--- a/system/pstate-frequency/pstate-frequency.SlackBuild
+++ b/system/pstate-frequency/pstate-frequency.SlackBuild
@@ -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
-
-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
+[ "${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
+
+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
-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
+ # 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
+
+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
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
diff --git a/system/pstate-frequency/pstate-frequency.info b/system/pstate-frequency/pstate-frequency.info
index 572fc8099cff..7bc18775f10d 100644
--- a/system/pstate-frequency/pstate-frequency.info
+++ b/system/pstate-frequency/pstate-frequency.info
@@ -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=""