10 MAINTAINER= timur@FreeBSD.org
11 COMMENT= Trivial Database
15 IGNORE_NONTHREAD_PYTHON=needs port lang/python${PYTHON_SUFFIX} to be build with THREADS support
17 CONFLICTS_INSTALL= tdb1-*
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
26 USES= compiler gettext-runtime pkgconfig waf
28 WAF_CMD= buildtools/bin/waf
29 CONFIGURE_LOG= bin/config.log
31 PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig
32 PLIST_SUB+= PKGCONFIGDIR=${PKGCONFIGDIR:S;${PREFIX}/;;}
34 CONFIGURE_ARGS+= --mandir=${MANPREFIX}/man \
38 OPTIONS_DEFINE= MANPAGES DEBUG
39 MANPAGES_DESC= Build and install manpages (requires textproc/docbook-xsl)
41 DEBUG_CONFIGURE_ON= --verbose --enable-debug
42 DEBUG_MAKE_ARGS= --verbose
43 DEBUG_FLAGS= -g -ggdb3 -O0 -DTDB_TRACE=1
45 .include <bsd.port.options.mk>
47 TDB_BINS= bin/tdbbackup \
52 PLIST_FILES+= include/tdb.h \
56 ${PKGCONFIGDIR}/tdb.pc
59 .if defined(NO_PYTHON)
60 USES+= python:build,test
61 CONFIGURE_ARGS+= --disable-python
65 PLIST_FILES+= ${PYTHON_SITELIBDIR}/tdb.so \
66 ${PYTHON_SITELIBDIR}/_tdb_text.py
69 .include <bsd.port.pre.mk>
71 .if ! ${PORT_OPTIONS:MMANPAGES}
72 CONFIGURE_ENV+= XSLTPROC="true"
74 BUILD_DEPENDS+= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl \
75 xsltproc:textproc/libxslt
77 # No fancy color error messages
78 .if ${COMPILER_TYPE} == "clang"
79 CFLAGS+= -fno-color-diagnostics
81 CONFIGURE_ENV+= NOCOLOR=yes
82 MAKE_ENV+= NOCOLOR=yes
84 TDB_MAN8= man/man8/tdbbackup.8.gz \
85 man/man8/tdbdump.8.gz \
86 man/man8/tdbrestore.8.gz \
89 PLIST_FILES+= ${TDB_MAN8}
92 @${REINPLACE_CMD} -e 's|%%PKGCONFIGDIR%%|${PKGCONFIGDIR}|g' \
93 ${BUILD_WRKSRC}/wscript
95 # Use threading (or multiprocessing) but not thread (renamed in python 3+).
97 @if ! ${PYTHON_CMD} -c "import multiprocessing;" 2>/dev/null; then \
99 ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE_NONTHREAD_PYTHON:Q}.; \
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
111 .for lib in ${TDB_BINS} lib/libtdb.so
112 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${lib}
114 .if !defined(NO_PYTHON)
115 ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/tdb.so
118 .include <bsd.port.post.mk>