#!/bin/sh

# Post install script that relocates the GHC installation to a /usr tree rooted
# GHC framework's versioned contents folder.

INSTALL_DIR=`pwd`
CONTENTS_FOLDER_PATH=GHC.framework/Versions/Current

cd ${CONTENTS_FOLDER_PATH}/ghc; \
  ./configure --prefix=${INSTALL_DIR}/${CONTENTS_FOLDER_PATH}/usr
cd ${CONTENTS_FOLDER_PATH}/ghc; \
  make install

# TODO: remove the binary dist tree