- Update to 2.2.0

- Program now lives in PREFIX/bin
- Install manpage and extra docs
- Reports don't need extra dependency, OPTION removed
- Perl dependencies are now by package
This commit is contained in:
Chris Rees 2011-07-31 17:29:02 +00:00
parent d1c50ef74b
commit ff1beb9b7f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=278638
5 changed files with 33 additions and 49 deletions

View file

@ -6,7 +6,7 @@
# #
PORTNAME= monitorix PORTNAME= monitorix
PORTVERSION= 2.1.2 PORTVERSION= 2.2.0
PORTREVISION?= 0 PORTREVISION?= 0
CATEGORIES= sysutils CATEGORIES= sysutils
MASTER_SITES= http://www.monitorix.org/ \ MASTER_SITES= http://www.monitorix.org/ \
@ -17,19 +17,16 @@ MAINTAINER= crees@FreeBSD.org
COMMENT= A web based monitoring system COMMENT= A web based monitoring system
LIB_DEPENDS= rrd:${PORTSDIR}/databases/rrdtool LIB_DEPENDS= rrd:${PORTSDIR}/databases/rrdtool
RUN_DEPENDS= ${SITE_PERL}/LWP/Parallel.pm:${PORTSDIR}/www/p5-ParallelUA \ RUN_DEPENDS= p5-ParallelUA>=0:${PORTSDIR}/www/p5-ParallelUA \
${SITE_PERL}/CGI.pm:${PORTSDIR}/www/p5-CGI.pm \ p5-CGI.pm>=0:${PORTSDIR}/www/p5-CGI.pm \
${SITE_PERL}/LWP.pm:${PORTSDIR}/www/p5-libwww \ p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
${SITE_PERL}/MIME/Lite.pm:${PORTSDIR}/mail/p5-MIME-Lite p5-MIME-Lite>=0:${PORTSDIR}/mail/p5-MIME-Lite
LICENSE= GPLv2 LICENSE= GPLv2
OPTIONS= REPORTS "Mail HTML reports to a given address" off
.include <bsd.port.options.mk>
USE_PERL= 5.8+ USE_PERL= 5.8+
MAN5= monitorix.conf.5 MAN5= monitorix.conf.5
MAN8= monitorix.8
MANCOMPRESSED= no MANCOMPRESSED= no
NO_BUILD= yes NO_BUILD= yes
USE_RC_SUBR= ${PORTNAME} USE_RC_SUBR= ${PORTNAME}
@ -56,16 +53,11 @@ PORTDOCS= COPYING \
Changes \ Changes \
README \ README \
README.FreeBSD \ README.FreeBSD \
README.OpenBSD \
README.nginx \
monitorix-alert.sh \ monitorix-alert.sh \
monitorix-apache.conf monitorix-apache.conf
.if defined(WITH_REPORTS)
RUN_DEPENDS+= metamail>=2.7:${PORTSDIR}/mail/metamail
PLIST_SUB+= REPORTS=""
.else
PLIST_SUB+= REPORTS="@comment "
.endif
pre-everything:: pre-everything::
@${ECHO_MSG} "" @${ECHO_MSG} ""
@${ECHO_MSG} "You may set following options:" @${ECHO_MSG} "You may set following options:"
@ -77,11 +69,8 @@ pre-everything::
@${ECHO_MSG} "" @${ECHO_MSG} ""
post-patch: post-patch:
# Set FreeBSD path for perl in shebang and absolute sysctl so as not to break
# in cgi-bin
.for f in monitorix.cgi monitorix.conf monitorix reports/send_reports .for f in monitorix.cgi monitorix.conf monitorix reports/send_reports
@${REINPLACE_CMD} -e "1s|^\(#!\).*|\1${PERL}|" \ @${REINPLACE_CMD} -e "1s|^\(#!\).*|\1${PERL}|" \
-e 's|"\([^/]sysctl\)|"/sbin/\1|' \
${WRKSRC}/${f} ${WRKSRC}/${f}
.endfor .endfor
# eth0 doesn't exist in FreeBSD! Also let's set our own paths. # eth0 doesn't exist in FreeBSD! Also let's set our own paths.
@ -97,33 +86,35 @@ post-patch:
${WRKSRC}/monitorix.conf ${WRKSRC}/monitorix.conf
do-install: do-install:
@${INSTALL_SCRIPT} ${WRKSRC}/monitorix ${PREFIX}/sbin/ @${INSTALL_SCRIPT} ${WRKSRC}/monitorix ${PREFIX}/bin/
@${MKDIR} ${WWWDIR}/imgs @${MKDIR} ${WWWDIR}/imgs
@${CHOWN} ${WWW_OWNER}:${WWW_GROUP} ${WWWDIR}/imgs @${CHOWN} ${WWW_OWNER}:${WWW_GROUP} ${WWWDIR}/imgs
@for f in ${WWW_FILES}; do \ .for f in ${WWW_FILES}
${INSTALL_DATA} ${WRKSRC}/$${f} ${WWWDIR}/; \ @${INSTALL_DATA} ${WRKSRC}/${f} ${WWWDIR}/
done .endfor
@${MKDIR} ${PREFIX}/${CGIDIR} @${MKDIR} ${PREFIX}/${CGIDIR}
@${INSTALL_SCRIPT} ${WRKSRC}/monitorix.cgi ${PREFIX}/${CGIDIR}/ @${INSTALL_SCRIPT} ${WRKSRC}/monitorix.cgi ${PREFIX}/${CGIDIR}/
.for m in ${MAN5} .for m in ${MAN5}
@${INSTALL_MAN} ${WRKSRC}/man/man5/$m ${MAN5PREFIX}/man/man5/ @${INSTALL_MAN} ${WRKSRC}/man/man5/$m ${MAN5PREFIX}/man/man5/
.endfor .endfor
.if defined(WITH_REPORTS) .for m in ${MAN8}
@${INSTALL_MAN} ${WRKSRC}/man/man8/$m ${MAN8PREFIX}/man/man8/
.endfor
@${MKDIR} ${WWWDIR}/reports @${MKDIR} ${WWWDIR}/reports
. for l in ${REPORT_LANG} .for l in ${REPORT_LANG}
@${INSTALL_DATA} ${WRKSRC}/reports/${l}.html \ @${INSTALL_DATA} ${WRKSRC}/reports/${l}.html \
${WWWDIR}/reports/ ${WWWDIR}/reports/
. endfor .endfor
.endif
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR} @${MKDIR} ${DOCSDIR}
@for doc in ${PORTDOCS}; do \ . for doc in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/$${doc} ${DOCSDIR}; \ @${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
done . endfor
.endif .endif
post-install: post-install:
@${MKDIR} ${DATADIR} @${MKDIR} ${DATADIR}
@${MKDIR} ${WWWDIR}/usage
@${INSTALL_DATA} ${WRKSRC}/monitorix.conf ${PREFIX}/etc/monitorix.conf.sample @${INSTALL_DATA} ${WRKSRC}/monitorix.conf ${PREFIX}/etc/monitorix.conf.sample
@if [ ! -f ${PREFIX}/etc/monitorix.conf ]; then \ @if [ ! -f ${PREFIX}/etc/monitorix.conf ]; then \
${CP} -p ${PREFIX}/etc/monitorix.conf.sample \ ${CP} -p ${PREFIX}/etc/monitorix.conf.sample \

View file

@ -1,2 +1,2 @@
SHA256 (monitorix-2.1.2.tar.gz) = 7148c01426b0994332d1c4b2f31949ef7845736528aa79f16e4ee2c70e24ac03 SHA256 (monitorix-2.2.0.tar.gz) = cf452dde8d3ff7d7afbc2a332741a4b34ec5de0d0d7cf32a0a62e937a9afd6f0
SIZE (monitorix-2.1.2.tar.gz) = 88540 SIZE (monitorix-2.2.0.tar.gz) = 98067

View file

@ -20,7 +20,7 @@ start_cmd="${name}_start"
pidfile="/var/run/${name}.pid" pidfile="/var/run/${name}.pid"
command_interpreter="." command_interpreter="."
procname="%%PREFIX%%/sbin/${name}" procname="%%PREFIX%%/bin/${name}"
monitorix_start() monitorix_start()
{ {
@ -30,7 +30,7 @@ monitorix_start()
fi fi
echo "Starting ${name}." echo "Starting ${name}."
rc_flags="-c %%PREFIX%%/etc/${name}.conf -p ${pidfile} ${rc_flags}" rc_flags="-c %%PREFIX%%/etc/${name}.conf -p ${pidfile} ${rc_flags}"
%%PERL%% %%PREFIX%%/sbin/${name} ${rc_flags} ${command_args} %%PERL%% %%PREFIX%%/bin/${name} ${rc_flags} ${command_args}
} }
run_rc_command "$1" run_rc_command "$1"

View file

@ -25,12 +25,3 @@
} }
# do exists in /proc/diskstats? # do exists in /proc/diskstats?
@@ -3766,7 +3763,7 @@
}
# check configuration file syntax
-if(system("perl -wc $opt_c >/dev/null 2>&1")) {
+if(!system("perl -wc $opt_c >/dev/null 2>&1")) {
print("FATAL: configuration file '$opt_c' had compilation errors.\n");
exit(1);
}

View file

@ -4,16 +4,18 @@
@unexec if cmp -s %D/etc/monitorix.conf %D/etc/monitorix.conf.sample; then rm -f %D/etc/monitorix.conf; fi @unexec if cmp -s %D/etc/monitorix.conf %D/etc/monitorix.conf.sample; then rm -f %D/etc/monitorix.conf; fi
etc/monitorix.conf.sample etc/monitorix.conf.sample
@exec if [ ! -f %D/etc/monitorix.conf ]; then cp %B/%f %D/etc/monitorix.conf; fi @exec if [ ! -f %D/etc/monitorix.conf ]; then cp %B/%f %D/etc/monitorix.conf; fi
sbin/monitorix bin/monitorix
@exec mkdir -p %D/%%DATADIR%% @exec mkdir -p %D/%%DATADIR%%
@dirrmtry %%DATADIR%% @dirrmtry %%DATADIR%%
@exec mkdir -p %D/%%WWWDIR%%/usage
@dirrmtry %%WWWDIR%%/usage
%%CGIDIR%%/monitorix.cgi %%CGIDIR%%/monitorix.cgi
@dirrmtry %%CGIDIR%% @dirrmtry %%CGIDIR%%
%%REPORTS%%%%WWWDIR%%/reports/ca.html %%WWWDIR%%/reports/ca.html
%%REPORTS%%%%WWWDIR%%/reports/de.html %%WWWDIR%%/reports/de.html
%%REPORTS%%%%WWWDIR%%/reports/en.html %%WWWDIR%%/reports/en.html
%%REPORTS%%%%WWWDIR%%/reports/it.html %%WWWDIR%%/reports/it.html
%%REPORTS%%@dirrm %%WWWDIR%%/reports @dirrm %%WWWDIR%%/reports
%%WWWDIR%%/logo_bot.png %%WWWDIR%%/logo_bot.png
%%WWWDIR%%/logo_top.png %%WWWDIR%%/logo_top.png
%%WWWDIR%%/monitorixico.png %%WWWDIR%%/monitorixico.png