summaryrefslogtreecommitdiff
path: root/development/pforth/pforth.SlackBuild
diff options
context:
space:
mode:
authorZbigniew Baniewski <zb@ispid.com.pl>2011-03-03 21:50:14 -0300
committerNiels Horn <niels.horn@slackbuilds.org>2011-03-03 21:50:14 -0300
commit4d3fb96c4c1f38532698cc8fc3410463e78fe097 (patch)
tree4b0b1c5d986eac6336a72e08a05b1e24d3ff347e /development/pforth/pforth.SlackBuild
parent312f7d55e0ac6d0aec2a718a6f7a70e004b2964d (diff)
downloadslackbuilds-4d3fb96c4c1f38532698cc8fc3410463e78fe097.tar.gz
development/pforth: Added (portable forth)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'development/pforth/pforth.SlackBuild')
-rw-r--r--development/pforth/pforth.SlackBuild84
1 files changed, 84 insertions, 0 deletions
diff --git a/development/pforth/pforth.SlackBuild b/development/pforth/pforth.SlackBuild
new file mode 100644
index 0000000000..ccb4b99405
--- /dev/null
+++ b/development/pforth/pforth.SlackBuild
@@ -0,0 +1,84 @@
+#!/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
+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
+mkdir -p $PKG/usr/share/pforth/${VERSION}
+strip pforth
+strip 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
+cd -
+
+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}