summaryrefslogtreecommitdiff
path: root/development/camlp5/camlp5.SlackBuild
diff options
context:
space:
mode:
authoradaptr <jeroen@adaptr.nl>2010-12-17 22:15:53 -0200
committerRobby Workman <rworkman@slackbuilds.org>2010-12-20 22:44:01 -0600
commitcd5b3e7101e064b071bec805c5e376af682c0540 (patch)
tree0d7b80b87e7f1fa5e390689342299b7086808f59 /development/camlp5/camlp5.SlackBuild
parent7499f302724902ecdb22bbc5188380e4912ebb47 (diff)
downloadslackbuilds-cd5b3e7101e064b071bec805c5e376af682c0540.tar.gz
development/camlp5: Added (ocaml preprocessor and pretty-printer)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'development/camlp5/camlp5.SlackBuild')
-rw-r--r--development/camlp5/camlp5.SlackBuild92
1 files changed, 92 insertions, 0 deletions
diff --git a/development/camlp5/camlp5.SlackBuild b/development/camlp5/camlp5.SlackBuild
new file mode 100644
index 0000000000..c1ba12a559
--- /dev/null
+++ b/development/camlp5/camlp5.SlackBuild
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+# Slackware build script for camlp5
+
+# Written by adaptr (jeroen@adaptr.nl)
+
+PRGNAM=camlp5
+VERSION=${VERSION:-6.01}
+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=""
+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
+tar xvf $CWD/$PRGNAM-$VERSION.tgz
+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 {} \;
+
+## libdir must be under the ocaml install dir!
+./configure \
+ --prefix /usr \
+ --libdir /usr/lib${LIBDIRSUFFIX}/ocaml
+
+# Compile the application and install it into the $PKG directory
+make world.opt
+make install DESTDIR=$PKG
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+## Copy ancillary documents
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CHANGES INSTALL LICENSE MODE README $PKG/usr/doc/$PRGNAM-$VERSION/
+
+## Build TeX, PS, PDF, TeXinfo and HTML Documentation
+cd doc/htmlp
+
+# these helpers are chatty; suppress output
+make all tex pdf ps info 2> /dev/null
+cp -a camlp5.dvi camlp5.ps camlp5.pdf camlp5.tex $PKG/usr/doc/$PRGNAM-$VERSION/
+
+mkdir -p $PKG/usr/info
+cp -a camlp5.info* $PKG/usr/info/
+gzip -9 $PKG/usr/info/*.info*
+
+cd ..
+cp -a html $PKG/usr/doc/$PRGNAM-$VERSION/
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
+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}