summaryrefslogtreecommitdiff
path: root/development/mit-scheme/mit-scheme.SlackBuild
diff options
context:
space:
mode:
authorJockey S. Kyd <jockey.kyd@gmail.com>2011-10-15 08:25:22 -0500
committerNiels Horn <niels.horn@slackbuilds.org>2011-10-22 10:17:07 -0200
commite41ad9798edeac52126fc89b43a578920d2f48bc (patch)
treefb6691e6022b3db0dad5837b77389267218b4651 /development/mit-scheme/mit-scheme.SlackBuild
parent74785af734180a2fefe8d88df67543179b7b61b7 (diff)
downloadslackbuilds-e41ad9798edeac52126fc89b43a578920d2f48bc.tar.gz
development/mit-scheme: Added (MIT/GNU Scheme)
Signed-off-by: Erik Hanson <erik@slackbuilds.org>
Diffstat (limited to 'development/mit-scheme/mit-scheme.SlackBuild')
-rw-r--r--development/mit-scheme/mit-scheme.SlackBuild102
1 files changed, 102 insertions, 0 deletions
diff --git a/development/mit-scheme/mit-scheme.SlackBuild b/development/mit-scheme/mit-scheme.SlackBuild
new file mode 100644
index 0000000000..b4b236650a
--- /dev/null
+++ b/development/mit-scheme/mit-scheme.SlackBuild
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# Written by Jockey S. Kyd (jockey dot kyd at gmail dot com)
+# Public domain
+#
+
+PRGNAM=mit-scheme
+VERSION=9.0.1
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+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=""
+ TARARCH="i386"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+ TARARCH="i386"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+ TARARCH="x86-64"
+else
+ printf "$ARCH is not supported.\n" 1>&2
+ exit 1
+fi
+
+set -e
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION-$TARARCH.tar.gz
+cd $PRGNAM-$VERSION
+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 {} \;
+
+cd src
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib$LIBDIRSUFFIX \
+ --build=$ARCH-slackware-linux
+make compile-microcode
+make install DESTDIR=$PKG
+cd ..
+
+find $PKG -print0 | xargs -0 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/man/man1
+cp -a doc/scheme.1 $PKG/usr/man/man1/mit-scheme.1
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+
+# take prebuilt info doc rather than build them by ourselves
+mkdir -p $PKG/usr/info
+tar xvf $CWD/$PRGNAM-$VERSION-doc-info.tar.gz
+cp -a $PRGNAM-$VERSION/doc/*.info $PKG/usr/info
+find $PKG/usr/info -type f -exec gzip -9 {} \;
+rm -rf $PRGNAM-$VERSION
+
+# ditto for html ones
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
+tar xvf $CWD/$PRGNAM-$VERSION-doc-html.tar.gz
+cp -a $PRGNAM-$VERSION/doc/* $PKG/usr/doc/$PRGNAM-$VERSION/html
+rm -rf $PRGNAM-$VERSION
+
+# ditto for pdf ones
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/pdf
+tar xvf $CWD/$PRGNAM-$VERSION-doc-pdf.tar.gz
+cp -a $PRGNAM-$VERSION/doc/* $PKG/usr/doc/$PRGNAM-$VERSION/pdf
+rm -rf $PRGNAM-$VERSION
+
+cp -a changelog.txt src/COPYING src/README.txt $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-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}