diff options
author | Jockey S. Kyd <jockey.kyd@gmail.com> | 2012-05-05 12:17:07 -0400 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2012-05-07 12:18:08 -0500 |
commit | 213a57385af5c2e64016186870bfe6133505b73c (patch) | |
tree | 59a2bdbeb49e1f03df18241c8d963be3784784d0 | |
parent | b0c32dd496e374e5758907021eff652e19248adb (diff) | |
download | slackbuilds-213a57385af5c2e64016186870bfe6133505b73c.tar.gz |
libraries/ocaml-findlib: Added (OCaml library manager)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
-rw-r--r-- | libraries/ocaml-findlib/README | 4 | ||||
-rw-r--r-- | libraries/ocaml-findlib/doinst.sh | 17 | ||||
-rw-r--r-- | libraries/ocaml-findlib/ocaml-findlib.SlackBuild | 103 | ||||
-rw-r--r-- | libraries/ocaml-findlib/ocaml-findlib.info | 10 | ||||
-rw-r--r-- | libraries/ocaml-findlib/slack-desc | 19 |
5 files changed, 153 insertions, 0 deletions
diff --git a/libraries/ocaml-findlib/README b/libraries/ocaml-findlib/README new file mode 100644 index 0000000000..08e02dbc0c --- /dev/null +++ b/libraries/ocaml-findlib/README @@ -0,0 +1,4 @@ +Findlib is a library manager for Objective Caml. It provides a convention how +to store libraries, and a file format ("META") to describe the properties of +libraries. There is also a tool (ocamlfind) for interpreting the META files, +so that it is very easy to use libraries in programs and scripts. diff --git a/libraries/ocaml-findlib/doinst.sh b/libraries/ocaml-findlib/doinst.sh new file mode 100644 index 0000000000..e0013668ff --- /dev/null +++ b/libraries/ocaml-findlib/doinst.sh @@ -0,0 +1,17 @@ +#!/bin/sh +config() { + old="$1" + new="$old.new" + if [ ! -r $old ]; then + mv $new $old + elif [ "$(cat $old | md5sum)" = "$(cat $new | md5sum)" ]; then + rm $new + fi +} +config etc/findlib.conf + +destdir=$(ocamlfind printconf destdir)/stublibs +ldconf=$(ocamlfind printconf ldconf) +if ! grep -q $destdir $ldconf; then + echo $destdir >> $ldconf +fi diff --git a/libraries/ocaml-findlib/ocaml-findlib.SlackBuild b/libraries/ocaml-findlib/ocaml-findlib.SlackBuild new file mode 100644 index 0000000000..878750b3d3 --- /dev/null +++ b/libraries/ocaml-findlib/ocaml-findlib.SlackBuild @@ -0,0 +1,103 @@ +#!/bin/sh + +# Copyright 2011 Jockey S. Kyd, Shanghai, CHN +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=ocaml-findlib +VERSION=1.2.7 +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +SRCNAM=findlib + +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 $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.gz +cd $SRCNAM-$VERSION +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + -bindir /usr/bin \ + -mandir /usr/man \ + -sitelib /usr/lib$LIBDIRSUFFIX/ocaml/site-lib \ + -config /etc/findlib.conf +make all +make opt +make install prefix=$PKG + +( cd $PKG/etc; mv findlib.conf findlib.conf.new ) + +# see INSTALL in the tarball or ocamlfind(1) to get detailed +mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/ocaml/site-lib/stublibs + +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 + +find $PKG/usr/man -type f -exec gzip -9 {} \; + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + doc/DOCINFO doc/QUICKSTART doc/README INSTALL LICENSE \ + $PKG/usr/doc/$PRGNAM-$VERSION +cp -a doc/guide-html doc/ref-html $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +find $PKG/usr/doc/$PRGNAM-$VERSION -name TIMESTAMP -exec rm -f {} \; + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -p -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/libraries/ocaml-findlib/ocaml-findlib.info b/libraries/ocaml-findlib/ocaml-findlib.info new file mode 100644 index 0000000000..58cce27c7a --- /dev/null +++ b/libraries/ocaml-findlib/ocaml-findlib.info @@ -0,0 +1,10 @@ +PRGNAM="ocaml-findlib" +VERSION="1.2.7" +HOMEPAGE="http://projects.camlcity.org/projects/findlib.html" +DOWNLOAD="http://download.camlcity.org/download/findlib-1.2.7.tar.gz" +MD5SUM="000bff723e8d3d727a7edd5b5901b540" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Jockey S. Kyd" +EMAIL="jockey.kyd@gmail.com" +APPROVED="dsomero" diff --git a/libraries/ocaml-findlib/slack-desc b/libraries/ocaml-findlib/slack-desc new file mode 100644 index 0000000000..fe0280dea9 --- /dev/null +++ b/libraries/ocaml-findlib/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +ocaml-findlib: ocaml-findlib (OCaml library manager) +ocaml-findlib: +ocaml-findlib: Findlib is a library manager for Objective Caml. It provides a +ocaml-findlib: convention how to store libraries, and a file format ("META") to +ocaml-findlib: describe the properties of libraries. There is also a tool +ocaml-findlib: (ocamlfind) for interpreting the META files, so that it is very easy +ocaml-findlib: to use libraries in programs and scripts. +ocaml-findlib: +ocaml-findlib: http://projects.camlcity.org/projects/findlib.html +ocaml-findlib: +ocaml-findlib: |