summaryrefslogtreecommitdiffstats
path: root/databases/dbtool/Makefile
blob: 2eb9c3a3f42336aa8e1defc2e9dd3c5539d768b2 (plain)
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
# Created by: ijliao
# $FreeBSD$

PORTNAME=	dbtool
PORTVERSION=	1.7
PORTREVISION=	4
CATEGORIES=	databases
MASTER_SITES=	http://www.daemon.de/idisk/Apps/dbtool/

MAINTAINER=	sylvio@FreeBSD.org
COMMENT=	Store and retrieve data in a key/value format in a hash database

LIB_DEPENDS=	libpcre.so:${PORTSDIR}/devel/pcre

OPTIONS_DEFINE=	BDB EXAMPLES

BDB_LIB_DEPENDS=	libdb3.so:${PORTSDIR}/databases/db3
BDB_CPPFLAGS=		-I${LOCALBASE}/include/db3
BDB_CONFIGURE_ON=	--with-berkeley
BDB_LIB_DEPENDS_OFF=	libgdbm.so:${PORTSDIR}/databases/gdbm

EXAMPLES_RUN_DEPENDS=	bash:${PORTSDIR}/shells/bash

LICENSE=	GPLv2

GNU_CONFIGURE=	yes
CONFIGURE_ENV+=	LIBS="-L${LOCALBASE}/lib"
CPPFLAGS+=	${CXXFLAGS} -I${LOCALBASE}/include

USES=		gmake
REINPLACE_ARGS=	-i ""

SH2BASH=	samples/account-db/accdb
UB2PFX=		samples/locate/locate samples/locate/updatedb

post-patch:
.for file in dbtool.cc engine.cc engine.h
	@${REINPLACE_CMD} -e "s,stdin,input,g" ${WRKSRC}/${file}
.endfor
	@${REINPLACE_CMD} -e "s,==,=,g" ${WRKSRC}/configure
.if !defined(NOPORTDOCS)
.for file in ${SH2BASH}
	@${REINPLACE_CMD} -e "s|/bin/sh|${LOCALBASE}/bin/bash|" ${WRKSRC}/${file}
.endfor
.for file in ${UB2PFX}
	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/${file}
	@${RM} ${WRKSRC}/${file}.orig
	@${RM} ${WRKSRC}/${file}~
.endfor
.endif

post-install:
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	@${CP} -Rp ${WRKSRC}/samples/* ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.mk>
OpenPOWER on IntegriCloud