aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/pandorafms_console/Makefile
blob: 2992c17ba73d3631da846e254fe0bea177018c82 (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
# New ports collection makefile for:    pandorafms_console
# Date created:     2011-11-21
# Whom:         KIKUCHI Koichiro <koichiro@rworks.jp>
#
# $FreeBSD$
#

PORTNAME=   pandora_console
PORTVERSION=    ${PANDORA_VERSION}
PORTREVISION=   1
CATEGORIES= net-mgmt

MAINTAINER= koichiro@rworks.jp
COMMENT=    Pandora FMS console

LICENSE=    ${PANDORA_LICENSE}
LICENSE_FILE=   ${PANDORA_LICENSE_FILE}

RUN_DEPENDS=    ${LOCALBASE}/bin/twopi:${PORTSDIR}/graphics/graphviz

OPTIONS=    PGSQL "Use PostgreSQL backend (experimental)" off

USE_APACHE= 22+
USE_PHP=    curl gd gettext json ldap mbstring mysql snmp session \
        xml zip zlib
WANT_PHP_WEB=   yes

SUB_FILES+= pandora_console.conf
SUB_LIST+=  APACHEETCDIR=${PREFIX}/${APACHEETCDIR}

.include "${.CURDIR}/../pandorafms_server/bsd.pandora.mk"

.include <bsd.port.pre.mk>

.if defined(WITH_PGSQL)
USE_PHP+=   pgsql
.endif

post-patch:
    @${REINPLACE_CMD} \
        -e "s|%%WWWDIR%%|${WWWDIR}|g" \
        ${WRKSRC}/pandora_console_install
    @${REINPLACE_CMD} \
        -e "s|/usr/bin|${LOCALBASE}/bin|g" \
        ${WRKSRC}/pandoradb.data*.sql
    @${REINPLACE_CMD} \
        -e 's|/bin/bash|/bin/sh|g' \
        ${WRKSRC}/extras/check_other_languages.sh \
        ${WRKSRC}/include/languages/extract_newlines.sh

do-install:
    @cd ${WRKSRC} && ${SH} pandora_console_install --force-install

post-install:
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
.for x in ${PORTDOCS}
    @${INSTALL_DATA} ${WRKSRC}/${x} ${DOCSDIR}
.endfor
.endif
    @cd ${WWWDIR} \
        && ${RM} -rf pandora_console_install* \
            pandora_console_upgrade *.spec \
            extras/check_other_languages.sh.bak \
            include/languages/extract_newlines.sh.bak \
            *.sql.bak COPYING ${PORTDOCS} DEBIAN/
    @if [ -e ${WWWDIR}/include/config.php ]; then \
        ${MV} ${WWWDIR}/install.php ${WWWDIR}/install.done; \
    fi;
    @${MKDIR} ${PREFIX}/${APACHEETCDIR}/Includes
    @${INSTALL_DATA} ${WRKDIR}/pandora_console.conf \
        ${PREFIX}/${APACHEETCDIR}/Includes/pandora_console.conf
    @${LN} -sf ${_LICENSE_DIR}/${LICENSE} ${WWWDIR}/COPYING

.include <bsd.port.post.mk>