development/bacon: Test for correct VERSION + fix gcc options.

Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
This commit is contained in:
Steve Pledger 2010-12-26 17:00:02 -02:00 committed by Niels Horn
parent 7d563b74b9
commit f6791a8cc9
2 changed files with 35 additions and 13 deletions

View file

@ -2,11 +2,18 @@
# Slackware build script for bacon
# Written by Steve Pledger spledger91@yahoo.com
# Written by Steve Pledger <spledger91@yahoo.com>
# 2010-12-21 UPDATE:
# -Niels Horn suggested I display a warning if the internal
# version doesn't match the VERSION variable
# -According to the BaCon documentation, I'm supposed to use the '-o'
# switch for each compiler option.
# e.g. "-o -O2 -o -march=i486 -o -mtune=i686" instead of "-o -O2 -march=i486 -mtune=i686"
PRGNAM="bacon"
VERSION="1.0_build_19" # Real version figured out below
BUILD=${BUILD:-1}
VERSION="${VERSION:-1.0_build_19}"
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -23,7 +30,20 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
# Version number may change, so figure out the real version
REAL_VER="$(bash $CWD/bacon.bash -v | grep version | cut -d' ' -f3-5 | tr ' ' _)"
SRCVER="$(bash $CWD/bacon.bash -v | grep version | cut -d' ' -f3-5 | tr ' ' _)"
if [ "$VERSION" != "$SRCVER" ]; then
cat <<EOF
WARNING: The source version ($SRCVER) does not match the VERSION variable ($VERSION).
To build anyway, re-run the SlackBuild like this:
VERSION=$SRCVER ./$PRGNAM.SlackBuild
exiting...
EOF
exit 1
fi
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@ -44,10 +64,10 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$REAL_VER
mkdir $PRGNAM-$REAL_VER
rm -rf $PRGNAM-$VERSION
mkdir $PRGNAM-$VERSION
cd $PRGNAM-$REAL_VER
cd $PRGNAM-$VERSION
# Bacon creates a binary in the same location as the source, so copy the source file here.
cat $CWD/bacon.bac > bacon.bac
@ -60,7 +80,7 @@ find . \
# Use the Bash version of BaCon to convert and compile the BASIC version, which is much faster.
# (Note: Not using sh because this requires Bash 4.x and sh may be a symlink to another shell)
bash $CWD/bacon.bash -p -o "$SLKCFLAGS" bacon.bac
bash $CWD/bacon.bash -p -o $(echo $SLKCFLAGS | sed -e 's: : -o :g') bacon.bac
mkdir -p $PKG/usr/bin
install -m 0755 bacon $PKG/usr/bin
@ -68,11 +88,11 @@ install -m 0755 bacon $PKG/usr/bin
find $PKG | 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-$REAL_VER
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$REAL_VER/$PRGNAM.SlackBuild
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$REAL_VER-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -1,8 +1,10 @@
PRGNAM="bacon"
VERSION="1.0_build_19"
HOMEPAGE="http://www.basic-converter.org"
DOWNLOAD="http://www.basic-converter.org/bacon.bash http://www.basic-converter.org/bacon.bac"
MD5SUM="d60f0edfca5a46bf16fcb61e998156e0 571a6eb03b9c8df5a1cc283f729811e0"
DOWNLOAD="http://www.basic-converter.org/bacon.bash \
http://www.basic-converter.org/bacon.bac"
MD5SUM="d60f0edfca5a46bf16fcb61e998156e0 \
571a6eb03b9c8df5a1cc283f729811e0"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Steve Pledger"