diff options
author | crees <crees@FreeBSD.org> | 2013-06-05 02:52:55 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2013-06-05 02:52:55 +0800 |
commit | 386f3d00d4acb0ee719c759f7d6b0b61af943115 (patch) | |
tree | 856772f15326461104aa81064ed99a47db612ee4 /sysutils | |
parent | a8c2e9ef9dceceb36da23335f7ba678a87355a95 (diff) | |
download | freebsd-ports-gnome-386f3d00d4acb0ee719c759f7d6b0b61af943115.tar.gz freebsd-ports-gnome-386f3d00d4acb0ee719c759f7d6b0b61af943115.tar.zst freebsd-ports-gnome-386f3d00d4acb0ee719c759f7d6b0b61af943115.zip |
Update to 3.2.1
The database (.rrd) files have moved to /var/db/monitorix by default, and the
port is careful to ensure that existing files are migrated.
The configuration file needs to have the base_lib line updated to
/var/db/monitorix/ (note trailing slash). The rc script comes with
instructions to those who don't happen to follow every single commit :)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/monitorix/Makefile | 23 | ||||
-rw-r--r-- | sysutils/monitorix/distinfo | 4 | ||||
-rw-r--r-- | sysutils/monitorix/files/monitorix.in | 18 | ||||
-rw-r--r-- | sysutils/monitorix/files/pkg-message.in | 2 | ||||
-rw-r--r-- | sysutils/monitorix/pkg-plist | 6 |
5 files changed, 40 insertions, 13 deletions
diff --git a/sysutils/monitorix/Makefile b/sysutils/monitorix/Makefile index fa34c3196714..bc32df427345 100644 --- a/sysutils/monitorix/Makefile +++ b/sysutils/monitorix/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= monitorix -PORTVERSION= 3.0.0 +PORTVERSION= 3.2.1 CATEGORIES= sysutils MASTER_SITES= http://www.monitorix.org/ \ http://www.monitorix.org/old_versions/ \ @@ -30,6 +30,7 @@ MANCOMPRESSED= no NO_BUILD= yes USE_RC_SUBR= ${PORTNAME} +DBDIR?= /var/db/${PORTNAME} CGIDIR?= www/cgi-bin CGIPATH?= /cgi-bin WWW_OWNER?= ${WWWOWN} @@ -38,11 +39,13 @@ REPORT_LANG= ca de en it pl WWWROOT= ${WWWDIR:S,/${PORTNAME}$,,} SUB_FILES= pkg-message -SUB_LIST= PERL=${PERL} +SUB_LIST= PERL=${PERL} \ + DBDIR=${DBDIR} PLIST_SUB+= CGIDIR=${CGIDIR} \ WWW_OWNER=${WWW_OWNER} \ - WWW_GROUP=${WWW_GROUP} + WWW_GROUP=${WWW_GROUP} \ + DBDIR=${DBDIR} WWW_FILES= logo_top.png \ logo_bot.png \ @@ -51,11 +54,13 @@ WWW_FILES= logo_top.png \ PORTDOCS= * PORTDATA= *.pm +.include <bsd.port.options.mk> + pre-everything:: @${ECHO_MSG} "" @${ECHO_MSG} "You may set following options:" @${ECHO_MSG} "" - @${ECHO_MSG} "DATADIR=${DATADIR} Where do you put RRD databases?" + @${ECHO_MSG} "DBDIR=${DBDIR} Where do you put RRD databases?" @${ECHO_MSG} "CGIDIR=${CGIDIR} Where do you put cgi?" @${ECHO_MSG} "CGIPATH=${CGIPATH} What is the relative URL for cgi files?" @${ECHO_MSG} "WWWDIR=${WWWDIR} Where do you put httpd's document root?" @@ -69,7 +74,7 @@ post-patch: ${WRKSRC}/${PORTNAME}.cgi @${REINPLACE_CMD} \ -e 's|^\(base_dir *= *\).*|\1${WWWDIR}/|' \ - -e 's|^\(base_lib *= *\).*|\1${DATADIR}/|' \ + -e 's|^\(base_lib *= *\).*|\1${DBDIR}/|' \ -e 's|^\(base_cgi *= *\).*|\1${CGIPATH}/|' \ -e 's|^\(secure_log[[:space:]]*= *\).*|\1/var/log/auth.log|' \ -e "s|/var/lib/milter-greylist/db/|/var/milter-greylist/|" \ @@ -98,7 +103,7 @@ do-install: @${INSTALL_DATA} ${WRKSRC}/reports/${l}.html \ ${WWWDIR}/reports/$l.html.sample .endfor -.if !defined(NOPORTDOCS) +.if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${DOCSDIR} . for f in docs/* README README.FreeBSD README.nginx Changes @${INSTALL_DATA} ${WRKSRC}/$f ${DOCSDIR} @@ -114,6 +119,12 @@ post-install: ${CP} -p ${PREFIX}/etc/monitorix.conf.sample \ ${PREFIX}/etc/monitorix.conf ; \ fi + if [ ! -d ${DBDIR} ]; then \ + ${INSTALL} -d -o ${WWW_OWNER} -g ${WWW_GROUP} ${DBDIR}; \ + if [ -f ${DATADIR}/fs.rrd ]; then \ + ${MV} ${DATADIR}/*.rrd ${DBDIR}; \ + fi; \ + fi @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/sysutils/monitorix/distinfo b/sysutils/monitorix/distinfo index 5eb8de85ef2d..aedf2b313ce2 100644 --- a/sysutils/monitorix/distinfo +++ b/sysutils/monitorix/distinfo @@ -1,2 +1,2 @@ -SHA256 (monitorix-3.0.0.tar.gz) = c503491d6550a99762fc636f07098fc5a66bd170f5d009a05052b4273e5ae224 -SIZE (monitorix-3.0.0.tar.gz) = 158342 +SHA256 (monitorix-3.2.1.tar.gz) = ef37ee4301dc76451cadfa5d1d01ade9249cc36d19e8757e024cd3b2121a7781 +SIZE (monitorix-3.2.1.tar.gz) = 168852 diff --git a/sysutils/monitorix/files/monitorix.in b/sysutils/monitorix/files/monitorix.in index 49b0674248d7..e99ac3c9fd6b 100644 --- a/sysutils/monitorix/files/monitorix.in +++ b/sysutils/monitorix/files/monitorix.in @@ -7,21 +7,31 @@ # BEFORE: LOGIN # KEYWORD: shutdown -monitorix_enable=${monitorix_enable:-"NO"} - . /etc/rc.subr -name="monitorix" +name=monitorix rcvar=monitorix_enable load_rc_config $name +: ${monitorix_enable:=NO} + start_cmd="${name}_start" +start_precmd=monitorix_check_rrds pidfile="/var/run/${name}.pid" -command_interpreter="." +command_interpreter=. procname="%%PREFIX%%/bin/${name}" +monitorix_check_rrds() +{ + baselib=`grep ^base_lib %%PREFIX%%/etc/monitorix.conf` + baselib=${baselib##*= } + if [ "$baselib" = "%%DATADIR%%/" ]; then + err 1 "Please update your monitorix.conf, replacing the base_lib value with %%DBDIR%%/ (note trailing slash)." + fi +} + monitorix_start() { if [ -z "$rc_fast" -a -n "$rc_pid" ]; then diff --git a/sysutils/monitorix/files/pkg-message.in b/sysutils/monitorix/files/pkg-message.in index f4f9e84a4e98..eccf48295ac6 100644 --- a/sysutils/monitorix/files/pkg-message.in +++ b/sysutils/monitorix/files/pkg-message.in @@ -1,7 +1,7 @@ ================================================================ The port has a generic default config, please adjust your - settings in file: %%PREFIX%%/etc/monitorix.conf + settings in file: %%PREFIX%%/etc/monitorix.conf The configuration file changed between 2.6.x and 3.0.0. It is suggested that you back up your old config file and diff --git a/sysutils/monitorix/pkg-plist b/sysutils/monitorix/pkg-plist index 856dbf50b1e5..90b1fea0e768 100644 --- a/sysutils/monitorix/pkg-plist +++ b/sysutils/monitorix/pkg-plist @@ -21,3 +21,9 @@ bin/monitorix %%WWWDIR%%/cgi @dirrmtry %%WWWDIR%%/imgs @dirrmtry %%WWWDIR%% + +@comment rrd files are now kept in /var/db/monitorix, we'll move +@comment previous files over for the user +@exec [ -d %%DBDIR%% ] || install -d -o %%WWW_OWNER%% -g %%WWW_GROUP%% %%DBDIR%% +@exec [ -f %%DATADIR%%/fs.rrd ] && mv %%DATADIR%%/*.rrd %%DBDIR%% +@unexec rmdir %%DBDIR%% 2>/dev/null || true |