aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/nagiosql/Makefile
blob: 5104b9c2ccd344ab26368b4f15f2d39ee6b09b83 (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
# Created by: Chris St Denis <chris@smartt.com>
# $FreeBSD$

PORTNAME=   nagiosql
PORTVERSION=    3.2.0
PORTREVISION=   2
CATEGORIES= net-mgmt www
MASTER_SITES=   SF/${PORTNAME}/${PORTNAME}/NagiosQL%20${PORTVERSION}/
DISTNAME=   ${PORTNAME}_${PORTVERSION:S/.//g}
DIST_SUBDIR=    ${PORTNAME}/${PORTVERSION}_SP2

MAINTAINER= chris@smartt.com
COMMENT=    Web based administration tool for Nagios

LICENSE=    GPLv2

RUN_DEPENDS=    nagios:net-mgmt/nagios \
        ${PEARDIR}/HTML/Template/IT.php:devel/pear-HTML_Template_IT@${PHP_FLAVOR}

USE_MYSQL=  yes
USES=       cpe gettext php:web tar:bzip2
USE_PHP=    mysql filter gettext session simplexml

USERS?=     nagios
GROUPS?=    nagios
NAGIOSUSER?=    nagios

NO_BUILD=   yes
NO_ARCH=    yes
WRKSRC=     ${WRKDIR}/${PORTNAME}32

SUB_FILES=  pkg-message
PLIST_SUB=  WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} NAGIOSUSER=${NAGIOSUSER}

PEARDIR?=   ${LOCALBASE}/share/pear

OPTIONS_DEFINE= CURL FTP
CURL_DESC=  Configure with cURL support
FTP_DESC=   Configure with FTP support

CURL_USE=   PHP=curl
FTP_USE=    PHP=ftp

post-patch:
    ${REINPLACE_CMD} -e "s|\'/etc/nagiosql/|\'${ETCDIR}/|g" \
        -e "s|/opt/nagios/etc/objects/|${LOCALBASE}/etc/nagios/objects/|" \
        -e "s|/opt/nagios/bin/nagios|${LOCALBASE}/bin/nagios|" \
        -e "s|/var/nagios/nagios.lock|/var/spool/nagios/nagios.lock|" \
        -e "s|/var/nagios/rw/nagios.cmd|/var/spool/nagios/rw/nagios.cmd|" \
        -e "s|nagios/etc/|etc/nagios/|" \
        -e "s|nagiosql/etc/|${ETCDIR}/|" \
        -e "s|\>/etc/nagiosql|\>${ETCDIR}|g" \
        -e "s|\>/etc/nagios/|\>${LOCALBASE}/etc/nagios/|g" \
        ${WRKSRC}/install/sql/nagiosQL_v32_db_mysql.sql

    ${REINPLACE_CMD} -e "s|\"/etc/|\"${LOCALBASE}/etc/|" \
        ${WRKSRC}/install/install.php

do-install:
    @${MKDIR} ${STAGEDIR}${WWWDIR}
    @${MKDIR} ${STAGEDIR}${ETCDIR}
    @${MKDIR} ${STAGEDIR}${ETCDIR}/ssh
    @${MKDIR} ${STAGEDIR}${ETCDIR}/hosts
    @${MKDIR} ${STAGEDIR}${ETCDIR}/services
    @${MKDIR} ${STAGEDIR}${ETCDIR}/backup
    @${MKDIR} ${STAGEDIR}${ETCDIR}/backup/hosts
    @${MKDIR} ${STAGEDIR}${ETCDIR}/backup/services
    @${MKDIR} ${STAGEDIR}${ETCDIR}/backup/ssh
    (cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR} "! ( -name *\.orig -o -name *\.bak )")

.include <bsd.port.mk>