summaryrefslogtreecommitdiff
path: root/mail/qmrtg/Makefile
blob: 7c8619991dfb313a4210be9d69d80c70c7fea9cf (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
# New ports collection makefile for:   qmrtg
# Date created:        12 Jun 2004
# Whom:                Mij
#
# $FreeBSD$
#

PORTNAME=	qmrtg
PORTVERSION=	2.1
CATEGORIES=	mail net-mgmt
MASTER_SITES=	http://dev.publicshout.org/qmrtg/download/

MAINTAINER=	mij@bitchx.it
COMMENT=	A simple tool for monitoring and graphing qmail activity through MRTG

BUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash2
RUN_DEPENDS=	${BUILD_DEPENDS}
.if !defined(WITHOUT_MRTG)
RUN_DEPENDS+=	mrtg:${PORTSDIR}/net-mgmt/mrtg
.endif

USE_BZIP2=	yes

MAN8=		qfilt.8 qmrtg-concurrency.8 qmrtg-dnsbl.8 \
		qmrtg-queue.8 qmrtg-regex.8 qmrtg-throughput.8 \
		qmrtg.8 qtaif.8
MANCOMPRESSED=	no

GNU_CONFIGURE=	yes

# where is qmrtg' database directory
QMRTG_DBDIR:=	/var/db/${PORTNAME}

# variables to be "exported" to plist
PLIST_SUB=	QMRTG_DBDIR=${QMRTG_DBDIR}

.if !defined(PACKAGE_BUILDING) && !defined(BATCH)
# interactive --> ask user for options
IS_INTERACTIVE=		yes
.if !defined(NOPORTDOCS)
# install extra doc by default
OPTIONS=	\
	DOCS		"Install LICENSE, FAQs etc (shared doc)"	On \
	HTMLTEMPLATES	"Install QMRTG HTML templates"			On
.else		# defined(NOPORTDOCS)
# avoid to offer to install doc
OPTIONS=	\
	HTMLTEMPLATES	"Install QMRTG HTML templates"			On
.endif		# !defined(NOPORTDOCS)
.else		# defined(PACKAGE_BUILDING) || defined(BATCH)
# building batch
# setting defaults
WITH_HTMLTEMPLATES=	yes
.if !defined(NOPORTDOCS)
# also install doc by default
WITH_DOCS=	yes
.endif		# !defined(NOPORTDOCS)
.endif		# !defined(PACKAGE_BUILDING)

.include <bsd.port.pre.mk>

pre-extract:
	@${ECHO_MSG} "   --->   Qmrtg can be installed without MRTG by defining WITHOUT_MRTG"

post-install:
# possibly installing docs
.if defined(WITH_DOCS) && !defined(NOPORTDOCS)
	@${ECHO_MSG} "   --->   Installing QMRTG extra docs as requested [ ${DOCSDIR} ]"
	${MKDIR} ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/*.txt ${DOCSDIR}
.endif
# possibly installing HTML templates
.if defined(WITH_HTMLTEMPLATES)
	@${ECHO_MSG} "   --->   Installing examples as requested [ ${EXAMPLESDIR} ]"
	${MKDIR} ${DATADIR}/html
	${INSTALL_DATA} ${WRKSRC}/html/* ${DATADIR}/html
	${MKDIR} ${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/examples/mrtg.cfg ${EXAMPLESDIR}
.endif
# creating db directory
	@${ECHO_MSG} "   --->   Creating QMRTG db directory [ ${QMRTG_DBDIR} ]"
	${MKDIR} ${QMRTG_DBDIR}
# installing configuration example
	@${ECHO_MSG} "   --->   Installing configuration example [ ${PREFIX}/etc/qmrtg.conf.dist ]"
	${MKDIR} ${PREFIX}/etc
	${CP} ${WRKSRC}/examples/qmrtg.conf.sample ${PREFIX}/etc/qmrtg.conf.dist
# displaying the port install msg
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>