summaryrefslogtreecommitdiffstats
path: root/net/dictd/Makefile
blob: 8f6beffbd7899f763d27ac5391278605e589bdae (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
# ex:ts=8
# New ports collection makefile for:	dictd
# Date created:		Jan 23, 2001
# Whom:			Ying-Chieh Liao <ijliao@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	dictd
PORTVERSION=	1.9.11
PORTREVISION=	0
CATEGORIES+=	net textproc
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=		dict

MAINTAINER?=	dd@FreeBSD.org
COMMENT=	Dict protocol (RFC 2229) server

LIB_DEPENDS=	ltdl.4:${PORTSDIR}/devel/libltdl

MAN1=		dictzip.1
MAN8=		dictd.8

USE_REINPLACE=	yes
USE_BISON=	yes
USE_LIBTOOL=	yes
CONFIGURE_ARGS=	--with-etcdir=${PREFIX}/etc --with-cflags="${CFLAGS}" \
		--without-local-zlib
CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
		LDFLAGS="-L${LOCALBASE}/lib"
USE_GMAKE=	yes

ALL_TARGET=	dictd dictzip
INSTALL_TARGET=	install.dictd install.dictzip

post-patch:
.for i in Makefile.in dict.1 dictd.8
	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/$i
.endfor
.for i in example.conf
	@${REINPLACE_CMD} -e "s|/usr|${PREFIX}|g" ${WRKSRC}/$i
.endfor
	@${REINPLACE_CMD} -e "s|%%CFLAGS%%|${CFLAGS}|g" ${WRKSRC}/zlib/Makefile
	@${REINPLACE_CMD} -e "s|\([\ \t(]\)T_USER|\1T_USERNAME|g" ${WRKSRC}/*.[chly]

post-install:
	@${MKDIR} ${DATADIR}
.for i in example.conf example.dictrc example.site example2.conf example3.conf
	${INSTALL_DATA} ${WRKSRC}/$i ${DATADIR}
.endfor
	@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.conf > ${PREFIX}/etc/${PORTNAME}.conf
	@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.sh > ${PREFIX}/etc/rc.d/${PORTNAME}.sh
	@${CHMOD} +x ${PREFIX}/etc/rc.d/${PORTNAME}.sh
	@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${PKGMESSAGE}

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