aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/ndoutils/Makefile
blob: 96162fa1b8e69e996fd46f8068534fe63a2b1248 (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
# New ports collection makefile for:    ndoutils
# Date created:             14 February 2008
# Whom:                 Philip M. Gollucci <pgollucci@p6m7g8.com>
#
# $FreeBSD$
#

PORTNAME=   ndoutils
PORTVERSION=    1.4b8
PORTREVISION=   2
CATEGORIES= net-mgmt
MASTER_SITES=   SF/nagios/${PORTNAME}-1.x/${PORTNAME}-${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Keep Nagios perfdata in MySQL or Postgresql database

RUN_DEPENDS=    ${LOCALBASE}/bin/nagios:${PORTSDIR}/net-mgmt/nagios

OPTIONS=    MYSQL   "MySQL Backend"     on \
            PGSQL   "Postgresql Backend"    off

MAKE_JOBS_UNSAFE=   yes

GNU_CONFIGURE=  yes
CFLAGS+=    -I${LOCALBASE}/include -fPIC
CONFIGURE_ARGS+=    --sysconfdir=${PREFIX}/etc/ndoutils

CFG_FILES=  misccommands ndo2db ndomod

USE_RC_SUBR=    ndo2db
SUB_FILES=  pkg-message

.include <bsd.port.options.mk>
.if !defined(WITHOUT_MYSQL)
USE_MYSQL=yes
CONFIGURE_ARGS+=    --enable-mysql \
                    --with-mysql-lib=${LOCALBASE}/lib/mysql \
                    --with-mysql-inc=${LOCALBASE}/include
.else
CONFIGURE_ARGS+=    --disable-mysql
.endif

.if defined(WITH_PGSQL)
USE_PGSQL=yes
CONFIGURE_ARGS+=    --enable-pgsql \
                    --with-pgsql-lib=${LOCALBASE}/lib/pgsql \
                    --with-pgsql-inc=${LOCALBASE}/include/pgsql
.else
CONFIGURE_ARGS+=    --disable-pgsql
.endif

.if defined(WITHOUT_MYSQL) && defined(WITHOUT_PGSQL)
IGNORE= you should define at least 1 of WITH_MYSQL or WITH_PGSQL, WITH_MYSQL=yes is the default
.endif

.if !defined(NOPORTDOCS)
PLIST_SUB+= PORTDOCS=""
.else
PLIST_SUB+= PORTDOCS="@comment "
.endif

do-install:
    @${INSTALL_PROGRAM} ${WRKSRC}/src/ndo2db-3x ${PREFIX}/bin/
    @${INSTALL_PROGRAM} ${WRKSRC}/src/ndomod-3x.o ${PREFIX}/bin/
    @${INSTALL_PROGRAM} ${WRKSRC}/src/file2sock ${PREFIX}/bin/
    @${INSTALL_PROGRAM} ${WRKSRC}/src/log2ndo ${PREFIX}/bin/
    @${INSTALL_PROGRAM} ${WRKSRC}/src/sockdebug ${PREFIX}/bin/
    @(cd ${WRKSRC}/db && ${COPYTREE_SHARE} \* ${DATADIR}/)
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    @(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} \* ${DOCSDIR}/)
.endif
    @for i in ${CFG_FILES}; do \
        ${INSTALL_DATA} ${WRKSRC}/config/$${i}.cfg ${PREFIX}/etc/nagios/$${i}.cfg-sample; \
    done
    @${INSTALL_DATA} ${WRKSRC}/config/nagios.cfg ${PREFIX}/etc/nagios/ndoutils.cfg-sample
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>