slackbuilds_ponce/development/pforth/pforth.SlackBuild
Robby Workman fd35ab2e95 development/pforth: Miscellaneous cleanups
This throws lots of warnings and non-fatal errors during
the build process, but it still builds a package, so we'll
keep it, I suppose...

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2011-03-30 22:53:39 -05:00

81 lines
2 KiB
Bash

#!/bin/sh
# Slackware build script for pforth
# Written by Zbigniew Baniewski, zb@ispid.com.pl
PRGNAM=pforth
VERSION=v27
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
SRCVERSION=${VERSION}_20101121
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) 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 __MACOSX
unzip "$CWD/${PRGNAM}_${SRCVERSION}.zip"
cd ${PRGNAM}_${VERSION}/build/unix
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# pforth.dic into "share"
sed -i "s/pforth.dic/\/usr\/share\/pforth\/${VERSION}\/pforth.dic/g" ../../csrc/pf_main.c
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
make all DESTDIR=$PKG
find $PKG/usr/bin | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a ../../*.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/usr/bin $PKG/usr/share/pforth/${VERSION}
strip pforth pforth_standalone
cp -a pforth $PKG/usr/bin/pforth
cp -a pforth.dic $PKG/usr/share/pforth/${VERSION}/pforth.dic
cp -a pforth_standalone $PKG/usr/bin/pforth_standalone
( cd $PKG/usr/bin ; ln -s pforth_standalone pfs )
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}