aboutsummaryrefslogtreecommitdiffstats
path: root/devel/ocaml-res/Makefile
blob: 7321e2413b54745a9aa84b778d7d5597ee8efc90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# New ports collection makefile for:    res
# Date created:     2006-08-15
# Whom:         Stanislav Sedov <ssedov@mbsd.msk.ru>
#
# $MBSDlabs$
# $FreeBSD$
#

PORTNAME=   res
PORTVERSION=    3.2.0
PORTREVISION=   1
CATEGORIES= devel
MASTER_SITES=   http://hg.ocaml.info/release/res/archive/
PKGNAMEPREFIX=  ocaml-
DISTNAME=   release-${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Automatically Resizing Contiguous Memory for OCaml

USE_BZIP2=  yes
USE_GMAKE=  yes
USE_OCAML=  yes
USE_OCAML_FINDLIB=yes
USE_OCAML_WASH= yes
MAKE_JOBS_UNSAFE=   yes

DOCS=       README.txt
DOCSDIR=    ${PREFIX}/share/doc/ocaml/${PORTNAME}
EXAMPLESDIR=    ${PREFIX}/share/examples/ocaml/${PORTNAME}
WRKSRC=     ${WRKDIR}/${PORTNAME}-release-${PORTVERSION}

.include <bsd.port.pre.mk>

post-extract:
# For nonstandard prefixes
.if !exists(${OCAMLFIND_DESTDIR})
    ${MKDIR} ${OCAMLFIND_DESTDIR}
.endif

post-install:
    @${FIND} ${OCAMLFIND_DESTDIR}/${PORTNAME} -type f | \
        ${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${DOCSDIR}/
    @${MKDIR} ${EXAMPLESDIR}
    @(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} \* ${EXAMPLESDIR}/)
    @${FIND} ${EXAMPLESDIR}/ ! -type d | \
        ${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST}
    @${FIND} ${EXAMPLESDIR}/ -type d | ${SORT} -r | \
        ${SED} 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
    @${FIND} ${DOCSDIR}/ ! -type d | \
        ${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST}
    @${FIND} ${DOCSDIR}/ -type d | ${SORT} -r | \
        ${SED} 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
# XXX: temporary workaround for non-standard PREFIX
    @${ECHO_CMD} "@unexec rmdir %D/share/doc/ocaml 2>/dev/null || true" \
        >> ${TMPPLIST}
    @${ECHO_CMD} "@unexec rmdir %D/share/examples/ocaml 2>/dev/null||true" \
        >> ${TMPPLIST}
.endif

.include <bsd.port.post.mk>