aboutsummaryrefslogtreecommitdiffstats
path: root/databases/db5/Makefile
blob: 21df15238bd4914b43368004fb0fed4ed3a9f3b4 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Created by: Matthias Andree <mandree@FreeBSD.org>
# $FreeBSD$

PORTNAME=   db5
PORTVERSION=    5.3.21.0
CATEGORIES= databases java
MASTER_SITES=   http://download.oracle.com/berkeley-db/
PKGNAMEPREFIX?=
# the distfiles aren't named db5-* but db-*:
DISTNAME=   db-${PORTVERSION:R}
DIST_SUBDIR=    bdb

MAINTAINER= mandree@FreeBSD.org
COMMENT=    The Oracle Berkeley DB, revision ${BDBVER}

BDBVER=     ${PORTVERSION:R:R}
BDBMAJ=     ${BDBVER:R}
CONFIGURE_ARGS= --enable-cxx --enable-stl \
        --disable-tcl \
        --includedir=${PREFIX}/include/${PORTNAME} \
        --libdir=${PREFIX}/lib/${PORTNAME} \
        --bindir=${PREFIX}/bin/${PORTNAME}
CONFIGURE_SCRIPT=   ../dist/configure
GNU_CONFIGURE=  yes
MAKE_JOBS_SAFE= yes
USE_GMAKE=  yes
INSTALL_TARGET= install_include install_lib install_utilities
LIBTOOLFILES=   ${CONFIGURE_SCRIPT}
WRKSRC=     ${WRKDIR}/${DISTNAME}/build_unix
USE_LDCONFIG=   yes
PLIST_SUB=  BDBMAJ=${BDBMAJ} BDBVER=${BDBVER}

OPTIONS_DEFINE= CRYPTO L10N SQL JAVA
OPTIONS_DEFAULT=CRYPTO
CRYPTO_DESC=    Cryptography support
L10N_DESC=  Localization support (EXPERIMENTAL)
SQL_DESC=   Enable SQL API (EXPERIMENTAL)

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
INSTALL_TARGET+=install_docs docdir=${DOCSDIR}
PORTDOCS=   *
.endif

.if ${PORT_OPTIONS:MSQL}
CONFIGURE_ARGS+=    --enable-sql_codegen --enable-sql
PLIST_SUB+= SQL=""
libdb_sql=  libdb_sql
.else
PLIST_SUB+= SQL="@comment "
libdb_sql=
.endif

.if ${PORT_OPTIONS:MJAVA}
USE_JAVA=   yes
JAVA_VERSION=   1.6+
CONFIGURE_ARGS+=    --enable-java
CPPFLAGS+=  "-I${JAVA_HOME}/include"
CONFIGURE_ENV=  JAVAC="${JAVAC}" JAR="${JAR}" JAVA="${JAVA}"
PLIST_SUB+= JAVA=""
libdb_java= libdb_java
.else
PLIST_SUB+= JAVA="@comment "
libdb_java=
.endif

.if ${PORT_OPTIONS:MCRYPTO}
CONFIGURE_ARGS+=    --with-cryptography=yes
.else
CONFIGURE_ARGS+=    --with-cryptography=no
.endif

.if ${PORT_OPTIONS:ML10N}
CONFIGURE_ARGS+=    --enable-localization
.endif

.if ${PORT_OPTIONS:MDEBUG}
CONFIGURE_ARGS+=    --enable-debug --enable-umrw
.endif

post-patch:
    ${REINPLACE_CMD} -e '/^DOCLIST/{s/csharp//;}' ${WRKSRC}/../dist/Makefile.in

post-install:
.for i in libdb libdb_cxx libdb_stl ${libdb_sql} ${libdb_java}
    ${LN} -s -f ${PORTNAME}/${i}-${BDBVER}.so.0 ${PREFIX}/lib
    ${LN} -s -f ${PORTNAME}/${i}-${BDBMAJ}.so ${PREFIX}/lib
    ${LN} -s -f ${i}-${BDBVER}.so.0 ${PREFIX}/lib/${i}-${BDBVER}.so
    ${LN} -s -f ${i}-${BDBVER}.so.0 ${PREFIX}/lib/${i}-${BDBMAJ}.so.0
    ${LN} -s -f ${i}-${BDBVER}.a ${PREFIX}/lib/${PORTNAME}/${i}.a
    ${CHMOD} a-w ${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.so.0 \
        ${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.a \
        ${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.la
.endfor
    cd ${PREFIX}/bin/${PORTNAME}; \
    for i in *; do ${LN} -s -f ${PORTNAME}/$$i ../$$i-${BDBVER} ; \
               ${LN} -s -f ${PORTNAME}/$$i ../$$i-${BDBMAJ} ; done
.if ${PORT_OPTIONS:MDOCS}
.for i in api_reference/TCL
    ${RM} -r -f ${DOCSDIR}/${i}
.endfor
.if empty(PORT_OPTIONS:MJAVA)
    ${RM} -r -f ${DOCSDIR}/java
.for i in gsg gsg_db_rep gsg_txn
    ${RM} -r -f ${DOCSDIR}/${i}/JAVA
.endfor
.endif
.if empty(PORT_OPTIONS:MSQL)
    ${RM} -r -f ${DOCSDIR}/bdb-sql
.endif
.endif

.include <bsd.port.mk>