#!/bin/sh
#
# Copyright 2009 Renato Cunha
# Available under the terms of the GNU GPL.
#

NAME="ocaml"
VERSION="3.11.0"
REVISION="1"

PKG_SOURCEURL='http://caml.inria.fr/pub/distrib/${NAME}-${VER_MAJ}.${VER_MIN}/${NAME}-${VERSION}.tar.bz2'

. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

DLG_PKGER="salv"
PKG_DESTDIRVAR='PREFIX'
PKG_DISABLESMP='caml caml is hell hell'

cflags
cxxflags
prepare
analyzesource
spewdo "cd $PKG_SRCROOT"
loggedcommand configure " cd $PKG_SRCROOT; ./configure --prefix /usr"
spewdo 'sed -i -e "s/\\(BYTECCCOMPOPTS=.*\\)/\\1 ${PKG_CFLAGS}/" config/Makefile'
spewdo 'sed -i -e "s/\\(NATIVECCCOMPOPTS=.*\\)/\\1 ${PKG_CFLAGS}/" config/Makefile'
make world.opt
# Change the PKG_STAGEROOT just for the installation
PKG_STAGEROOT_ORIG="$PKG_STAGEROOT"
PKG_STAGEROOT="$PKG_STAGEROOT/usr"
makeinstall
PKG_STAGEROOT="$PKG_STAGEROOT_ORIG"
tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup


