slackbuilds_ponce/network/bmon/bmon.SlackBuild

90 lines
2.1 KiB
Text
Raw Normal View History

2010-05-11 22:54:40 +02:00
#!/bin/sh
# Slackware build script for bmon
# Written by B. Watson (yalhcru at gmail dot com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20140825 bkw:
# - updated for 3.4
# - remove unused diffs from tarball
# - install bmon.conf as .new config, add doinst.sh
2015-05-09 22:55:31 +02:00
# 20150509 bkw:
# - updated for 3.6
2010-05-11 22:54:40 +02:00
PRGNAM=bmon
2015-09-12 10:05:42 +02:00
VERSION=${VERSION:-3.8}
2010-05-11 22:54:40 +02:00
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
2010-05-11 22:54:40 +02:00
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT $PKG/usr/doc/$PRGNAM-$VERSION
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/v$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
2010-05-11 22:54:40 +02:00
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 \) \
2010-05-11 22:54:40 +02:00
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
autoreconf -if
2010-05-11 22:54:40 +02:00
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
2010-05-11 22:54:40 +02:00
make
make install-strip DESTDIR=$PKG
gzip $PKG/usr/man/man?/*.?
2010-05-11 22:54:40 +02:00
mkdir -p $PKG/etc
cat examples/$PRGNAM.conf > $PKG/etc/$PRGNAM.conf.new
# nothing here but the example config, don't need
rm -rf $PKG/usr/share
# ChangeLog is 0 bytes, don't bother.
cp -a LICENSE* NEWS README* $PKG/usr/doc/$PRGNAM-$VERSION/
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
2010-05-11 22:54:40 +02:00
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
2010-05-11 22:54:40 +02:00
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}