slackbuilds_ponce/network/proxymini/proxymini.SlackBuild
David Somero d011b2dcdf network/proxymini: Misc automated cleanups.
Signed-off-by: David Somero <xgizzmo@slackbuilds.org>
2010-06-04 01:14:01 -04:00

64 lines
1.4 KiB
Bash

#!/bin/sh
# Slackware build script for proxymini
# Written by Thomas Morper <thomas@beingboiled.info>
PRGNAM=proxymini
VERSION=${VERSION:-0.2.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
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
unzip -d $PRGNAM-$VERSION $CWD/$PRGNAM.zip
cd $PRGNAM-$VERSION
chown -R root:root .
find . -type f -exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" make
mkdir -p $PKG/usr/bin
cp -a proxymini $PKG/usr/bin
mkdir -p $PKG/usr/man/man1
cat $CWD/proxymini.1 > $PKG/usr/man/man1/proxymini.1
gzip -9 $PKG/usr/man/man1/proxymini.1
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}