aboutsummaryrefslogtreecommitdiffstats
path: root/databases/qdbm/Makefile
blob: 820cfe0aa0d2c6009cd47e0b2fd0ed06bd76c626 (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
# New ports collection makefile for:    QDBM
# Date created:             18 October 2003
# Whom:                 Kimura Fuyuki <fuyuki@nigredo.org>
#
# $FreeBSD$
#

PORTNAME=   qdbm
PORTVERSION=    1.8.35
CATEGORIES= databases
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE} \
        http://qdbm.sourceforge.net/
MASTER_SITE_SUBDIR= ${PORTNAME}

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

GNU_CONFIGURE=  yes
USE_REINPLACE=  yes
INSTALLS_SHLIB= yes

.if !defined(SLAVEPORT)
USE_ICONV=  yes
CONFIGURE_ARGS= --enable-zlib \
        --enable-iconv
CONFIGURE_ENV=  CPPFLAGS="${PTHREAD_CFLAGS} -I${LOCALBASE}/include" \
        LDFLAGS="${PTHREAD_LIBS} -L${LOCALBASE}/lib"
MAKE_ARGS=  RELCFLAGS="${CFLAGS}" \
        MYDATADIR="${DOCSDIR}" MYDOCS="${PORTDOCS}"
INSTALLS_SHLIB= yes
.if !defined(NOPORTDOCS)
PORTDOCS=   spex.html spex-ja.html ChangeLog NEWS
.endif

MAN1=   cbcodec.1 cbtest.1 crmgr.1 crtest.1 crtsv.1 dpmgr.1 dptest.1 \
    dptsv.1 hvmgr.1 hvtest.1 odidx.1 odmgr.1 odtest.1 rlmgr.1 rltest.1 \
    vlmgr.1 vltest.1 vltsv.1
MAN3=   cabin.3 curia.3 depot.3 hovel.3 odeum.3 qdbm.3 relic.3 villa.3
MLINKS= curia.3 cropen.3 depot.3 dpopen.3 \
        odeum.3 odopen.3 villa.3 vlopen.3 villa.3 vista.3

OPTIONS=    PTHREAD "Enable pthread support" Off \
        DEBUG "Enable debug" Off

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 -liconv" fmtcnv031127

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

.else

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

post-patch:
    ${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)
.if defined(WITH_DEBUG)
CONFIGURE_ARGS+=    --enable-debug
.endif

.if defined(WITH_PTHREAD)
USE_REINPLACE=  yes
CONFIGURE_ARGS+=    --enable-pthread
CFLAGS+=        ${PTHREAD_CFLAGS}
.endif
.endif

.if defined(SLAVEPORT) && ${SLAVEPORT}=="perl"
.if ${PERL_LEVEL} < 500600
IGNORE= This port requires perl 5.6.0 or later, Install lang/perl5 then try again
.endif
.endif

.include <bsd.port.post.mk>