summaryrefslogtreecommitdiffstats
path: root/www/ocaml-net/Makefile
blob: 848e97470530897b36bed7e7d812c13f5299cb0b (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Created by: Stephane Legrand <stephane@FreeBSD.org>
# $FreeBSD$

PORTNAME=	net
PORTVERSION=	4.0.4
CATEGORIES=	www
MASTER_SITES=	http://download.camlcity.org/download/
PKGNAMEPREFIX=	ocaml-
DISTNAME=	ocaml${PORTNAME}-${PORTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	OCaml modules for Internet applications

LICENSE=	GPLv2

BUILD_DEPENDS=	${SA_DIR}/pcre/pcre.a:${PORTSDIR}/devel/ocaml-pcre
RUN_DEPENDS=	${SA_DIR}/pcre/pcre.a:${PORTSDIR}/devel/ocaml-pcre

CONFLICTS=	ocaml-equeue-2* ocaml-netclient-0*

USES=			gmake
USE_OCAML=		yes
USE_OCAML_FINDLIB=	yes
USE_OCAML_CAMLP4=	yes
USE_OCAML_LDCONFIG=	yes
USE_OCAMLFIND_PLIST=	yes
HAS_CONFIGURE=		yes
CONFIGURE_ARGS=		-disable-gtk \
			-enable-pcre

ALL_TARGET=		all opt
MAKE_JOBS_UNSAFE=	yes

PLIST_FILES=	bin/netplex-admin \
		bin/ocamlrpcgen

DOCSDIR=	${PREFIX}/share/doc/ocaml/${PKGNAMEPREFIX}${PORTNAME}
EXAMPLESDIR=	${PREFIX}/share/examples/ocaml/${PKGNAMEPREFIX}${PORTNAME}
SA_DIR=		${LOCALBASE}/${OCAML_SITELIBDIR}
PORTDOCS=	*
PORTEXAMPLES=	*

OCAML_PKGDIRS=	netsys netshm equeue shell netstring rpc-generator \
		rpc pop smtp netclient netcgi2 netgssapi netplex \
		netcgi2-plex netcamlbox netmulticore rpc-auth-local \
		netstring-pcre netunidata
OCAML_LDLIBS=	${OCAML_PKGDIRS:S/^/${OCAML_SITELIBDIR}\//}

OPTIONS_DEFINE=	NETHTTPD GTK2 GNUTLS APACHE ZIP EXAMPLES DOCS
OPTIONS_DEFAULT=GNUTLS
NETHTTPD_DESC=	Integrated HTTP daemon
ZIP_DESC=	Compression support
APACHE_DESC=	Apache mod connector (experimental)
GNUTLS_DESC=	SSL/TLS support via GnuTLS

GTK2_BUILD_DEPENDS=	lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
GTK2_RUN_DEPENDS=	lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
ZIP_BUILD_DEPENDS=	${SA_DIR}/zip/zip.a:${PORTSDIR}/archivers/ocaml-zip
ZIP_RUN_DEPENDS=	${SA_DIR}/zip/zip.a:${PORTSDIR}/archivers/ocaml-zip
NETHTTPD_CONFIGURE_ON=	-with-nethttpd
NETHTTPD_VARS=		OCAML_PKGDIRS+=nethttpd
GTK2_CONFIGURE_ON=	-enable-gtk2
GTK2_VARS=		OCAML_PKGDIRS+=equeue-gtk2
GNUTLS_USES=		pkgconfig
GNUTLS_LIB_DEPENDS=	libgnutls.so:${PORTSDIR}/security/gnutls
GNUTLS_CONFIGURE_ON=	-enable-gnutls
GNUTLS_VARS=		OCAML_PKGDIRS+=nettls-gnutls
APACHE_BROKEN=		does not build with APACHE option enabled
APACHE_USE=		APACHE=22+
APACHE_CONFIGURE_ON=	-enable-apache -apxs ${APXS} -apache ${HTTPD}
APACHE_VARS=		OCAML_PKGDIRS+=netcgi2-apache
ZIP_CONFIGURE_ON=	-enable-zip
ZIP_VARS=		OCAML_PKGDIRS+=netzip

post-patch:
	@${REINPLACE_CMD} -e 's/camlzip/zip/' ${WRKSRC}/configure

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}/
	@(cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/)

post-install-EXAMPLES-on:
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
	@(cd ${WRKSRC}/examples/ && \
		${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}/)

.include <bsd.port.mk>
OpenPOWER on IntegriCloud