diff options
author | Sébastien Ballet <slacker6896@gmail.com> | 2016-09-29 18:17:59 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-10-01 07:17:23 +0700 |
commit | 46150f0ac886f0d48f308274ec36452b36f1b638 (patch) | |
tree | eda2eb61828d0abafa2563a4edb0785af28764f3 /system/pstate-frequency/pstate-frequency.SlackBuild | |
parent | a96cd2882c4e606bd3468ed6670316732f93b38a (diff) | |
download | slackbuilds-46150f0ac886f0d48f308274ec36452b36f1b638.tar.gz |
system/pstate-frequency: Updated for version 3.5.1.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/pstate-frequency/pstate-frequency.SlackBuild')
-rw-r--r-- | system/pstate-frequency/pstate-frequency.SlackBuild | 59 |
1 files changed, 46 insertions, 13 deletions
diff --git a/system/pstate-frequency/pstate-frequency.SlackBuild b/system/pstate-frequency/pstate-frequency.SlackBuild index 55d2b4ee66..dec305ada9 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 |