misc changes
[grissiom.SlackBuilds.git] / cpufrequtils / cpufrequtils.SlackBuild
blob158e773c204325084978e87c5cc8cbfaa0498922
1 #!/bin/sh
3 # Slackware build script for cpufrequtils
5 # Written by grissiom chaos.proton@gmail.com
7 PRGNAM=cpufrequtils
8 VERSION=${VERSION:-003}
9 ARCH=${ARCH:-i486}
10 BUILD=${BUILD:-1}
11 TAG=${TAG:-_SBo}
13 CWD=$(pwd)
14 TMP=${TMP:-/tmp/SBo}
15 PKG=$TMP/package-$PRGNAM
16 OUTPUT=${OUTPUT:-/tmp}
18 JOBS=${JOBS:-3}
19 #Don't use -j for this package
20 MAKEOPT=""
22 if [ "$ARCH" = "i486" ]; then
23 SLKCFLAGS="-O2 -march=i486 -mtune=i686"
24 elif [ "$ARCH" = "i686" ]; then
25 SLKCFLAGS="-O2 -march=i686 -mtune=i686"
26 elif [ "$ARCH" = "x86_64" ]; then
27 SLKCFLAGS="-O2 -fPIC"
30 set -e
32 rm -rf $PKG
33 mkdir -p $TMP $PKG $OUTPUT
34 cd $TMP
35 rm -rf $PRGNAM-$VERSION
36 tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
37 cd $PRGNAM-$VERSION
38 chown -R root:root .
39 find . \
40 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
41 -exec chmod 755 {} \; -o \
42 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
43 -exec chmod 644 {} \;
45 make $MAKEOPT
46 make install DESTDIR=$PKG
48 ( cd $PKG
49 find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
50 find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
53 ( cd $PKG/usr/man
54 find . -type f -exec gzip -9 {} \;
55 for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
58 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
59 cp -a AUTHORS COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
60 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
62 mkdir -p $PKG/install
63 cat $CWD/slack-desc > $PKG/install/slack-desc
65 cd $PKG
66 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz