system/powernowd: Add rc file + switch to i586.

Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
This commit is contained in:
David Woodfall 2018-03-27 12:45:36 +00:00 committed by Willy Sudiarto Raharjo
parent c69d1c195b
commit 64f4acc447
3 changed files with 40 additions and 9 deletions

View File

@ -0,0 +1,25 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
preserve_perms() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ -e $OLD ]; then
cp -a $OLD ${NEW}.incoming
cat $NEW > ${NEW}.incoming
mv ${NEW}.incoming $NEW
fi
config $NEW
}
preserve_perms etc/rc.d/rc.powernowd.new

View File

@ -6,12 +6,12 @@
PRGNAM=powernowd
VERSION=${VERSION:-1.00}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@ -22,8 +22,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@ -39,7 +39,7 @@ fi
set -e
rm -rf $PKG
mkdir -p $TMP $OUTPUT $PKG/usr/sbin
mkdir -p $TMP $OUTPUT $PKG/usr/sbin $PKG/etc/rc.d
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
@ -51,21 +51,27 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
sed -i "s%-O2%$SLKCFLAGS%" Makefile
sed -i "s%/usr/sbin%$PKG/usr/sbin%" Makefile
make
install -m 755 powernowd $PKG/usr/sbin
make install
# Remove trailing whitespace at the same time
cat powernowd.init | sed "s%\s*$%%" > $PKG/etc/rc.d/rc.powernowd.new
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
powernowd.init \
README LICENSE \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View File

@ -15,5 +15,5 @@ powernowd: management scheme, as it's algorithm works better if there are more
powernowd: then two CPU speeds available. (aka, ARM, AMD K6/K7, Via C3, and
powernowd: Crusoe as opposed to traditional Intel and Ultrasparc).
powernowd:
powernowd:
powernowd: http://www.deater.net/john/powernowd.html
powernowd: