summaryrefslogtreecommitdiff
path: root/net-mgmt/snmptt/Makefile
blob: 5e6c8f6f08278039ad0da86da0ef9b80c5270217 (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
# ports collection makefile for:	snmptt
# Date created:				21 May 2004
# Whom:					Bruce M Simpson <bms@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=		snmptt
PORTVERSION=		1.0
CATEGORIES=		net-mgmt
MASTER_SITES=		${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	${PORTNAME}
DISTNAME=		${PORTNAME}_${PORTVERSION}
EXTRACT_SUFX=		.tgz

MAINTAINER=	bms@FreeBSD.org
COMMENT=	SNMP trap handler/translator/swiss-army-knife

RUN_DEPENDS=	${SITE_PERL}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/net-snmp \
		${SITE_PERL}/Config/IniFiles.pm:${PORTSDIR}/devel/p5-Config-IniFiles

WRKSRC=		${WRKDIR}/${PORTNAME}_${PORTVERSION}

USE_PERL5=	yes
USE_REINPLACE=	yes

USE_RC_SUBR=	snmptt.sh

SCRIPTS=	snmptt snmptt-net-snmp-test snmpttconvert \
		snmpttconvertmib snmptthandler
DOCS=		faqs.html index.html layout1.css snmptt.html \
		snmpttconvert.html snmpttconvertmib.html

.include <bsd.port.pre.mk>

do-build:

post-build:
	@${ECHO_CMD} ${WRKSRC}/snmptt ${WRKSRC}/snmptthandler ${WRKSRC}/snmptt.ini | ${XARGS} \
	 ${REINPLACE_CMD} -e \
	 "s|/etc/snmptt.ini|${PREFIX}/etc/snmptt.ini|g ; \
	  s|/etc/snmp/snmptt.ini|${PREFIX}/etc/snmp/snmptt.ini|g ; \
	  s|/etc/snmp/snmptt.conf|${PREFIX}/etc/snmp/snmptt.conf.generic|g"

do-install:
.for _SCRIPT in ${SCRIPTS}
	${INSTALL_SCRIPT} ${WRKSRC}/${_SCRIPT} ${PREFIX}/sbin
.endfor
	${MKDIR} ${PREFIX}/etc/snmp
	${INSTALL_DATA} ${WRKSRC}/snmptt.ini ${PREFIX}/etc/snmp/snmptt.ini-dist
.if !exists(${PREFIX}/etc/snmp/snmptt.ini)
	${INSTALL_DATA} ${WRKSRC}/snmptt.ini ${PREFIX}/etc/snmp
.endif
	${INSTALL_DATA} ${WRKSRC}/examples/snmptt.conf.generic ${PREFIX}/etc/snmp/snmptt.conf.generic-dist
.if !exists(${PREFIX}/etc/snmp/snmptt.conf)
	${INSTALL_DATA} ${WRKSRC}/examples/snmptt.conf.generic ${PREFIX}/etc/snmp/snmptt.conf.generic
.endif
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for _DOC in ${DOCS}
	${INSTALL_MAN} ${WRKSRC}/docs/${_DOC} ${DOCSDIR}
.endfor
.endif

.include <bsd.port.post.mk>