slackbuilds/a/i8kutils/i8kutils.SlackBuild
Gwenhael Le moine 36a0f707d0 add a/i8kutils
Signed-off-by: Gwenhael Le moine <gwenhael.le.moine@gmail.com>
2009-12-30 20:00:36 +07:00

80 lines
1.6 KiB
Bash
Executable file

#!/bin/sh -x
# variables
TMP=/tmp
CWD=$(pwd)
APP_NAME=i8kutils
PKG=$TMP/package-$APP_NAME
VERSION=1.33
EXT=tar.gz
DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README* TODO examples patches"
ARCH=$(uname -m)
BUILD=1cyco
PREFIX=/usr
SLCKFLAGS="-fPIC -O2"
# nettoyage préalable
rm -fr $PKG $TMP/$APP_NAME-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
tar xf $CWD/$APP_NAME-$VERSION.$EXT
cd $APP_NAME-$VERSION
# configuration
# compilation
make -j3 PREFIX=$PREFIX
# installation
mkdir -p $PKG$PREFIX/{sbin,bin,man}
make install DESTDIR=$PKG PREFIX=$PREFIX
cp *.1 $PKG$PREFIX/man
# correction
cd $PKG
chown -R root:root *
mkdir -p $PKG/usr/doc/$APP_NAME-$VERSION
cd $TMP/$APP_NAME-$VERSION
cp -R $DOCS $PKG/usr/doc/$APP_NAME-$VERSION
mkdir $PKG/etc
cp i8kmon.conf $PKG/etc/i8kmon.conf.new
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
# Strip binaries
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$APP_NAME: $APP_NAME (user-space programs for accessing the SMM BIOS of Dell laptops.)
$APP_NAME:
$APP_NAME:
$APP_NAME:
$APP_NAME:
$APP_NAME:
$APP_NAME:
$APP_NAME: http://packages.debian.org/i8kutils
$APP_NAME:
$APP_NAME: see /usr/doc/$APP_NAME-$VERSION for more details
$APP_NAME:
EOF
# empaquetage
cd $PKG
makepkg -l y -c n $TMP/$APP_NAME-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD.txz