diff options
author | Andrzej Telszewski <atelszewski@gmail.com> | 2014-07-22 05:58:22 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-07-22 06:13:20 +0700 |
commit | cfc82f0a12d557e82b7a4aa66fc210b89b00dc85 (patch) | |
tree | e0f68240cb54a75b25054ee1e90f23497e76d4c9 /system/microcode_ctl/microcode_ctl.SlackBuild | |
parent | 256a0c56a072cb1f1632e49adff009e372a82bf6 (diff) | |
download | slackbuilds-cfc82f0a12d557e82b7a4aa66fc210b89b00dc85.tar.gz |
system/microcode_ctl: Updated for version 1.26.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/microcode_ctl/microcode_ctl.SlackBuild')
-rw-r--r-- | system/microcode_ctl/microcode_ctl.SlackBuild | 86 |
1 files changed, 53 insertions, 33 deletions
diff --git a/system/microcode_ctl/microcode_ctl.SlackBuild b/system/microcode_ctl/microcode_ctl.SlackBuild index 644802a4b8..861f28e729 100644 --- a/system/microcode_ctl/microcode_ctl.SlackBuild +++ b/system/microcode_ctl/microcode_ctl.SlackBuild @@ -1,11 +1,30 @@ #!/bin/sh # Slackware build script for microcode_ctl -# Author: Andrzej Telszewski <atelszewski@gmail.com> + +# Copyright 2014 Andrzej Telszewski, Sabadell +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=microcode_ctl -VERSION=1.17 -BUILD=${BUILD:-2} +VERSION=${VERSION:-1.26} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -21,55 +40,56 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -set -e +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; - -# use our CFLAGS -sed -i "s/-O2/$SLKCFLAGS/" Makefile - -# look for microcode.dat file in a more appropriate place -sed -i "s|/etc/|/lib/firmware/|" microcode_ctl.c -sed -i "s|/etc/microcode.dat|/lib/firmware/microcode.dat|" \ - microcode_ctl.start + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -make \ - PREFIX=/usr \ - RCHOMEDIR=rc.d +# Build: +CC=${CC:-gcc} +echo "$CC $SLKCFLAGS -Wall microcode_ctl.c -o microcode_ctl" +$CC $SLKCFLAGS -Wall microcode_ctl.c -o microcode_ctl +strip --strip-unneeded microcode_ctl -make \ - PREFIX=/usr \ - RCHOMEDIR=rc.d \ - DESTDIR=$PKG \ - install +# Install: +install -D -m 0755 microcode_ctl $PKG/usr/sbin/microcode_ctl +install -D -m 0644 $CWD/rc.microcode_ctl $PKG/etc/rc.d/rc.microcode_ctl.new -# This is way outdated -rm -f $PKG/etc/microcode.dat - -# move init-script into place -mv $PKG/etc/rc.d/microcode_ctl $PKG/etc/rc.d/rc.microcode_ctl.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 +gzip -k -9 microcode_ctl.8 +mkdir -p $PKG/usr/man/man8 +cp -a microcode_ctl.8.gz $PKG/usr/man/man8 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp Changelog README $PKG/usr/doc/$PRGNAM-$VERSION +cp -a Changelog README $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -mkdir $PKG/install -cat $CWD/doinst.sh > $PKG/install/doinst.sh +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} |