Import sysutils/dateutils version 0.2.7
[dports.git] / science / netcdf4 / Makefile
1 # Created by: Sunpoet Po-Chuan Hsieh <sunpoet@sunpoet.net>
2 # $FreeBSD$
3
4 PORTNAME=       netcdf
5 PORTVERSION=    4.1.3
6 PORTREVISION=   3
7 CATEGORIES=     science
8 MASTER_SITES=   http://www.unidata.ucar.edu/downloads/netcdf/ftp/ \
9                 ftp://ftp.unidata.ucar.edu/pub/netcdf/ \
10                 LOCAL/sunpoet
11
12 MAINTAINER=     sunpoet@FreeBSD.org
13 COMMENT?=       Library for machine-independent, array-oriented data access
14
15 CONFLICTS_INSTALL=      hdf-4.[0-9]* netcdf-3.[0-9]* netcdf3-3.[0-9]*
16 PORTSCOUT=      limit:^4\.
17
18 OPTIONS_DEFINE= DAP FORTRAN SZIP
19 DAP_DESC=       Build DAP client and remote testing
20 FORTRAN_DESC=   Build library for Fortran
21 SZIP_DESC=      SZIP support (required if HDF5 was built with SZIP)
22
23 CONFIGURE_ARGS= --enable-cxx --enable-cxx-4 --enable-netcdf-4 --enable-shared \
24                 --with-hdf5=${LOCALBASE} --with-zlib=/usr
25 CPPFLAGS+=      -I${LOCALBASE}/include -fPIC -DPIC
26 GNU_CONFIGURE=  yes
27 LDFLAGS+=       -L${LOCALBASE}/lib
28 LIB_DEPENDS=    hdf5.7:${PORTSDIR}/science/hdf5-18
29 MAKE_ENV=       INFODIR="${PREFIX}/${INFO_PATH}" MAKEINFOFLAGS="--no-split"
30 USE_LDCONFIG=   yes
31 USES=           pathfix
32
33 INFO=           netcdf netcdf-c netcdf-cxx netcdf-f77 netcdf-f90 \
34                 netcdf-install netcdf-tutorial
35 MAN1=           nccopy.1 ncdump.1 ncgen.1 ncgen3.1
36 MAN3=           netcdf.3
37
38 NO_STAGE=       yes
39 .include <bsd.port.options.mk>
40
41 .if ${PORT_OPTIONS:MDAP}
42 CONFIGURE_ARGS+=--enable-dap --with-curl=${LOCALBASE} \
43                 --with-curl-config=${LOCALBASE}/bin/curl-config
44 LIB_DEPENDS+=   curl:${PORTSDIR}/ftp/curl
45 .else
46 CONFIGURE_ARGS+=--disable-dap
47 .endif
48
49 .if ${PORT_OPTIONS:MFORTRAN}
50 CPPFLAGS+=      -DpgiFortran
51 CONFLICTS+=     netcdf-4.*
52 MAN3+=          netcdf_f77.3 netcdf_f90.3
53 PKGNAMESUFFIX+= -ftn
54 PLIST_SUB+=     FORTRAN=""
55 USES+=          fortran
56 .else
57 CONFIGURE_ARGS+=--disable-f77 --disable-f90
58 CONFLICTS+=     netcdf-ftn-4.*
59 PLIST_SUB+=     FORTRAN="@comment "
60 .endif
61
62 .if ${PORT_OPTIONS:MSZIP}
63 CONFIGURE_ARGS+=--with-szlib=${LOCALBASE}
64 LIB_DEPENDS+=   sz.2:${PORTSDIR}/science/szip
65 .endif
66
67 post-configure:
68         @cd ${WRKSRC}/man4 && ${SETENV} ${MAKE_ENV} ${MAKE} maintainer-clean-aminfo
69 .for i in ${INFO}
70         @cd ${WRKSRC}/man4 && makeinfo --no-split ${i}.texi
71 .endfor
72
73 post-install:
74 .if ${PORT_OPTIONS:MDOCS}
75         ${MKDIR} ${DOCSDIR}/
76         cd ${WRKSRC}/man4 && ${INSTALL_DATA} *.html *.pdf *.txt ${DOCSDIR}/
77 .endif
78
79 regression-test test: build
80         @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} check
81
82 .include <bsd.port.mk>