aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/cacti/Makefile
blob: 0711cd3e6a112ff98fca15a6344c448b2029d016 (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
# $FreeBSD$

PORTNAME=   cacti
PORTVERSION=    0.8.8g${PATCHLEVEL}
PORTREVISION=   2
CATEGORIES= net-mgmt www
MASTER_SITES=   http://www.cacti.net/downloads/ \
        ftp://ftpmirror.uk/freebsd-ports/cacti/

MAINTAINER= freebsd-ports@dan.me.uk
COMMENT=    Web-driven graphing interface for RRDTool

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/LICENSE

RUN_DEPENDS=    rrdtool:databases/rrdtool

USES=       cpe shebangfix
USE_MYSQL=  yes
USE_PHP=    mysqli pcre session sockets snmp xml
WANT_PHP_WEB=   yes
NO_ARCH=    yes
NO_BUILD=   yes
PKGMESSAGE= ${WRKDIR}/pkg-message
SUB_FILES=  pkg-message
SHEBANG_FILES=  scripts/3com_cable_modem.pl \
        scripts/diskfree.pl \
        scripts/linux_memory.pl \
        scripts/loadavg.pl \
        scripts/loadavg_multi.pl \
        scripts/ping.pl \
        scripts/query_unix_partitions.pl \
        scripts/unix_processes.pl \
        scripts/unix_tcp_connections.pl \
        scripts/unix_users.pl \
        scripts/weatherbug.pl \
        scripts/webhits.pl

CACTIDIR?=  share/cacti
CACTIUSER?= cacti
CACTIGROUP?=    cacti

USERS?=     ${CACTIUSER}
GROUPS?=    ${CACTIGROUP}

WRKSRC=     ${WRKDIR}/${PORTNAME}-${SITEDISTVERSION}

SITEDISTVERSION=    ${PORTVERSION:S/${PATCHLEVEL}$//}

PLIST_SUB+= CACTIDIR=${CACTIDIR}  CACTIUSER=${CACTIUSER} \
        CACTIGROUP=${CACTIGROUP}
SUB_LIST+=  CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
        CACTIGROUP=${CACTIGROUP}

post-patch:
    @${FIND} ${WRKSRC} -name \*.orig -delete; \
    ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.sample
    ${RM} -r ${WRKSRC}/log ${WRKSRC}/rra

do-install:
    ${MKDIR} ${STAGEDIR}/${PREFIX}/${CACTIDIR}
    ${MKDIR} ${STAGEDIR}/var/log/cacti
    ${MKDIR} ${STAGEDIR}/var/db/cacti/rra
    ${MKDIR} ${STAGEDIR}/var/db/cacti/scripts
    ${CP} -R ${WRKSRC}/* ${STAGEDIR}/${PREFIX}/${CACTIDIR}
    if [ -f ${PREFIX}/${CACTIDIR}/include/db-settings.php ]; then \
        ${ECHO_CMD} "======================================================================="; \
        ${ECHO_CMD} "WARNING! You have to move DB settings from"; \
        ${ECHO_CMD} "${PREFIX}/${CACTIDIR}/include/db-settings.php file to"; \
        ${ECHO_CMD} "${PREFIX}/${CACTIDIR}/include/config.php and remove db-settings.php"; \
    fi

.include <bsd.port.mk>