diff options
author | Steve Pledger <spledger91@yahoo.com> | 2010-12-26 17:00:02 -0200 |
---|---|---|
committer | Niels Horn <niels.horn@slackbuilds.org> | 2010-12-27 19:22:51 -0200 |
commit | f6791a8cc99406c76f01da7df1fce1538bfedb78 (patch) | |
tree | 2a300bdaae64df62cc2d18373d5c881791416cb9 /development/bacon/bacon.SlackBuild | |
parent | 7d563b74b92a5ee7b8d63c4f0056dc5e76aa95a1 (diff) | |
download | slackbuilds-f6791a8cc99406c76f01da7df1fce1538bfedb78.tar.gz |
development/bacon: Test for correct VERSION + fix gcc options.
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'development/bacon/bacon.SlackBuild')
-rw-r--r-- | development/bacon/bacon.SlackBuild | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/development/bacon/bacon.SlackBuild b/development/bacon/bacon.SlackBuild index b59c38fcc2..f361c5ecc3 100644 --- a/development/bacon/bacon.SlackBuild +++ b/development/bacon/bacon.SlackBuild @@ -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} |