Tweak databases/p5-Amazon-SimpleDB version 0.03_1
[dports.git] / databases / tdb / Makefile
1 # $FreeBSD$
2
3 PORTNAME=               tdb
4 PORTVERSION=            1.4.2
5 PORTREVISION=           0
6 PORTEPOCH=              1
7 CATEGORIES=             databases
8 MASTER_SITES=           SAMBA
9
10 MAINTAINER=             timur@FreeBSD.org
11 COMMENT=                Trivial Database
12
13 LICENSE=                GPLv3
14
15 IGNORE_NONTHREAD_PYTHON=needs port lang/python${PYTHON_SUFFIX} to be build with THREADS support
16
17 CONFLICTS_INSTALL=      tdb1-*
18
19 #FLAVORS=               default nopython debug
20 #nopython_PKGNAMESUFFIX=        -nopython
21 #debug_PKGNAMESUFFIX=   -debug
22 #nopython_CONFLICTS=    tdb tdb-debug
23 #debug_CONFLICTS=       tdb tdb-nopython
24 #default_CONFLICTS=     tdb-nopython tdb-debug
25
26 USES=                   compiler gettext-runtime pkgconfig waf 
27 USE_LDCONFIG=           yes
28 WAF_CMD=                buildtools/bin/waf
29 CONFIGURE_LOG=          bin/config.log
30
31 PKGCONFIGDIR?=          ${PREFIX}/libdata/pkgconfig
32 PLIST_SUB+=             PKGCONFIGDIR=${PKGCONFIGDIR:S;${PREFIX}/;;}
33
34 CONFIGURE_ARGS+=        --mandir=${MANPREFIX}/man \
35                         --disable-rpath \
36                         --without-gettext
37
38 OPTIONS_DEFINE=         MANPAGES DEBUG
39 MANPAGES_DESC=          Build and install manpages (requires textproc/docbook-xsl)
40
41 DEBUG_CONFIGURE_ON=     --verbose --enable-debug
42 DEBUG_MAKE_ARGS=        --verbose
43 DEBUG_FLAGS=            -g -ggdb3 -O0 -DTDB_TRACE=1
44
45 .include <bsd.port.options.mk>
46
47 TDB_BINS=               bin/tdbbackup \
48                         bin/tdbdump \
49                         bin/tdbrestore \
50                         bin/tdbtool
51
52 PLIST_FILES+=           include/tdb.h \
53                         ${TDB_BINS} \
54                         lib/libtdb.so \
55                         lib/libtdb.so.1 \
56                         ${PKGCONFIGDIR}/tdb.pc
57
58
59 .if defined(NO_PYTHON)
60 USES+=                  python:build,test
61 CONFIGURE_ARGS+=        --disable-python
62 .else
63 USES+=                  python:3.4+
64
65 PLIST_FILES+=           ${PYTHON_SITELIBDIR}/tdb.so \
66                         ${PYTHON_SITELIBDIR}/_tdb_text.py
67 .endif
68
69 .include <bsd.port.pre.mk>
70
71 .if ! ${PORT_OPTIONS:MMANPAGES}
72 CONFIGURE_ENV+=         XSLTPROC="true"
73 .else
74 BUILD_DEPENDS+=         ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \
75                         xsltproc:textproc/libxslt
76 .endif
77 # No fancy color error messages
78 .if ${COMPILER_TYPE} == "clang"
79 CFLAGS+=                -fno-color-diagnostics
80 .endif
81 CONFIGURE_ENV+=         NOCOLOR=yes
82 MAKE_ENV+=              NOCOLOR=yes
83
84 TDB_MAN8=               man/man8/tdbbackup.8.gz \
85                         man/man8/tdbdump.8.gz \
86                         man/man8/tdbrestore.8.gz \
87                         man/man8/tdbtool.8.gz
88
89 PLIST_FILES+=           ${TDB_MAN8}
90
91 post-patch:
92                         @${REINPLACE_CMD} -e 's|%%PKGCONFIGDIR%%|${PKGCONFIGDIR}|g' \
93                                 ${BUILD_WRKSRC}/wscript
94
95 # Use threading (or multiprocessing) but not thread (renamed in python 3+).
96 pre-configure:
97                         @if ! ${PYTHON_CMD} -c "import multiprocessing;" 2>/dev/null; then \
98                                 ${ECHO_CMD}; \
99                                 ${ECHO_MSG} "===>  ${PKGNAME} "${IGNORE_NONTHREAD_PYTHON:Q}.; \
100                                 ${ECHO_CMD}; \
101                                 ${FALSE}; \
102                         fi
103
104 pre-build-MANPAGES-off:
105                         -${MKDIR} ${BUILD_WRKSRC}/bin/default/man
106 .for man in ${TDB_MAN8}
107                         ${INSTALL_MAN} ${FILESDIR}/`basename ${man} .gz` ${BUILD_WRKSRC}/bin/default/man
108 .endfor
109
110 post-install:
111 .for lib in ${TDB_BINS} lib/libtdb.so
112                         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${lib}
113 .endfor
114 .if !defined(NO_PYTHON)
115                         ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/tdb.so
116 .endif
117
118 .include <bsd.port.post.mk>