aboutsummaryrefslogtreecommitdiffstats
path: root/databases/qdbm/Makefile
blob: b1e77ac4e908af1107457653dc96d5335dc1801a (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
# Created by: Kimura Fuyuki <fuyuki@nigredo.org>
# $FreeBSD$
#    $MCom: ports-stable/databases/qdbm/Makefile,v 1.6 2008/03/29 20:07:25 ahze Exp $

PORTNAME=   qdbm
PORTVERSION=    1.8.78
PORTREVISION=   1
CATEGORIES= databases
MASTER_SITES=   http://fallabs.com/qdbm/

MAINTAINER= ports@FreeBSD.org
COMMENT?=   Quick Database Manager

GNU_CONFIGURE=  yes
USE_LDCONFIG=   yes
CFLAGS+=    -fPIC

.if !defined(SLAVEPORT)
USES+=      iconv
CONFIGURE_ARGS= --enable-zlib \
        --enable-iconv \
        --enable-pthread
CFLAGS+=    ${PTHREAD_CFLAGS}
CPPFLAGS+=  ${PTHREAD_CFLAGS} -I${LOCALBASE}/include
LDFLAGS+=   ${PTHREAD_LIBS} -L${LOCALBASE}/lib
MAKE_ARGS=  RELCFLAGS="${CFLAGS}" \
        MYDATADIR="${DOCSDIR}" MYDOCS="${PORTDOCS}"

PORTDOCS=   ChangeLog NEWS

post-patch:
    @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's|@libdir@/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
        ${WRKSRC}/Makefile.in

post-build:
    cd ${WRKSRC}/lab; \
    ${MAKE} CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib ${ICONV_LIB}" fmtcnv031127

post-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/lab/fmtcnv031127 ${STAGEDIR}${PREFIX}/bin

.else

LIB_DEPENDS+=   libqdbm.so:${PORTSDIR}/databases/qdbm

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/java|${JAVA_HOME}|' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
.if ${SLAVEPORT}=="ruby"
    @${FIND} ${WRKSRC} -type f | \
        ${XARGS} -n 10 ${REINPLACE_CMD} -e \
        's|/usr/bin/ruby -w|${SETENV} ruby|'
    @${FIND} ${WRKSRC} -name '*.bak' | ${XARGS} ${RM} -f
.endif
.endif

.include <bsd.port.pre.mk>

.if !defined(SLAVEPORT) && defined(WITH_DEBUG)
CONFIGURE_ARGS+=    --enable-debug
.endif

.include <bsd.port.post.mk>