# This file was automatically generated by godiva version 0.9.7
.include "../../mk/bsd.prefs.mk"

VERSION=        0.3.0
PKGNAME=        godi-yacfe-light-${VERSION}
PKGREVISION=    0
DISTNAME=       yacfe-light-0.3
DISTFILES=      yacfe-light-0.3.tgz
CATEGORIES=     godi
MASTER_SITES=   http://www.padator.org/software/project-yacfe/
MAINTAINER=     Adrien Nader <adrien@notk.org>
HOMEPAGE=       http://www.padator.org/software-yacfe.php
COMMENT=        Yacfe (Yet Another C/C++ Front-End) is mainly an OCaml API to

# confopt defaults:


AUTOGENERATE_PLIST = yes
PKG  =          godi-yacfe-light
MAKE_FLAGS=     PREFIX=${PREFIX} LIBDIR=${PREFIX}/lib BINDIR=${PREFIX}/bin MANDIR=${PREFIX}/man 
DEPENDS+= godi-core-mk>=1.2.14:../../godi/godi-core-mk
DEPENDS+= godi-ocaml>=3.11:../../godi/godi-ocaml
BUILD_DEPENDS+= godi-findlib>=0.8.1:../../godi/godi-findlib

HAS_CONFIGURE = yes
CONFIGURE_ARGS+= --prefix=${LOCALBASE:Q}
.if ${GODI_YACFE_LIGHT_USE_GDBM} == "yes"
CONFIGURE_ARGS+= --with-gdbm
.else
CONFIGURE_ARGS+= --without-gdbm
.endif
.if ${GODI_YACFE_LIGHT_USE_MPI} == "yes"
CONFIGURE_ARGS+= --with-mpi
.else
CONFIGURE_ARGS+= --without-mpi
.endif
.if ${GODI_YACFE_LIGHT_WITH_GUI} == "yes"
CONFIGURE_ARGS+= --with-gui
.else
CONFIGURE_ARGS+= --without-gui
.endif


CONFIGURE_ENV+= ${BUILD_OCAMLFIND_ENV}

USE_GMAKE = yes

MAKE_ENV+=  ${BUILD_OCAMLFIND_ENV} PKGBASE=${PKGBASE:Q}

pre-configure-copy:
.	if exists(files)
	    cd files && ${PAX} -rw -pp . ${WRKSRC}
.	endif

pre-configure: pre-configure-copy

ALL_TARGET=    depend all
.if ${GODI_HAVE_OCAMLOPT} == "yes"
ALL_TARGET+= opt
.endif

# A few files take a long time to compile, using .opt versions of the compiler
# really makes a big difference (minutes on a fast machine).
.if exists(${LOCALBASE}/bin/ocamlc.opt)
.if exists(${LOCALBASE}/bin/ocamlopt.opt)
MAKE_ENV+=OPTBIN=.opt
.endif
.endif

post-install:
.if exists(${WRKSRC}/yacfe.opt)
	install ${WRKSRC}/yacfe ${WRKSRC}/yacfe.opt ${PREFIX}/bin
.else
	install ${WRKSRC}/yacfe ${PREFIX}/bin
.endif
	find ${WRKSRC}/commons ${WRKSRC}/parsing_c -iname '*.cm[aix]' -o -iname '*.cmx[as]' -o -iname "*.a" | xargs ocamlfind install yacfe ${WRKSRC}/../../META/META
	mkdir -p ${PREFIX}/doc/${PKG}
.	for DOC in readme.txt license.txt authors.txt bugs.txt changes.txt copyright.txt
	    if [ -d ${WRKSRC}/${DOC} ]; then cd ${WRKSRC} && ${PAX} -rw -pp ${DOC} ${PREFIX}/doc/${PKG}; else install -m 0644 ${WRKSRC}/${DOC} ${PREFIX}/doc/${PKG}; fi
.	endfor
	install -d ${PREFIX}/share/config/envos ${PREFIX}/share/config/macros
	install ${WRKSRC}/config/envos/* ${PREFIX}/share/config/envos
	install ${WRKSRC}/config/macros/* ${PREFIX}/share/config/macros

.include "../../mk/bsd.pkg.mk"
