aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/cacti/Makefile
blob: e703f216f50faea3fff04e813a389b2d3128dd77 (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
# New ports collection makefile for:    cacti
# Date created:     6 December 2003
# Whom:         Vincent Tantardini <vinc@freebsd-fr.org>
#
# $FreeBSD$
#

PORTNAME=   cacti
PORTVERSION=    0.8.6c
PORTREVISION=   2
CATEGORIES= net www
MASTER_SITES=   http://www.cacti.net/downloads/

MAINTAINER= sem@FreeBSD.org
COMMENT=    Web-driven graphing interface for RRDTool

PATCH_SITES=    http://www.cacti.net/downloads/patches/0.8.6c/
PATCHFILES= rrd_fetch_negative_numbers.patch \
        no_auth_no_graphs_in_tree_bug.patch \
        device_create_multiple_graphs.patch \
        undefined_index_custom_problem_in_graph_view.patch \
        poller_recache_timeout.patch \
        output_field_name_period.patch \
        ping_sysdescription_to_sysuptime.patch \
        netsnmp_reduce_output_from_loaded_mibs.patch \
        php_snmp_v2.patch \
        config_php_include_order.patch
PATCH_DIST_STRIP=-p1

RUN_DEPENDS=    rrdtool:${PORTSDIR}/net/rrdtool \
        net-snmp-config:${PORTSDIR}/net-mgmt/net-snmp

USE_MYSQL=  yes
USE_PHP=    mysql pcre session xml
WANT_PHP_WEB=   yes
NO_BUILD=   yes
PKGMESSAGE= ${WRKDIR}/pkg-message
PKGINSTALL= ${WRKDIR}/pkg-install
SUB_FILES=  pkg-message pkg-install

CACTIDIR?=  share/cacti
CACTIUSER?= cacti
CACTIGROUP?=    ${CACTIUSER}
PLIST_SUB+= CACTIDIR=${CACTIDIR}
SUB_LIST+=  CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
        CACTIGROUP=${CACTIGROUP}

post-patch:
    @${FIND} ${WRKSRC} -name \*.orig -delete; \
    ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig; \
    ${RM} -d ${WRKSRC}/include/lang/en ${WRKSRC}/include/lang

pre-install:
    @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL; \

do-install:
    @${MKDIR} ${PREFIX}/${CACTIDIR}; \
    ${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/; \
    if [ ! -f ${PREFIX}/${CACTIDIR}/include/config.php ]; then \
        ${CP} ${PREFIX}/${CACTIDIR}/include/config.php.orig \
            ${PREFIX}/${CACTIDIR}/include/config.php; \
    fi; \

# Fix permissions
post-install:
    @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>