- Fix tmp directory creation in cgi script. Bump PORTREVISION for this.

- Add trailing slash for INSTALL_* destinations
- Make DATADIR really configurable
This commit is contained in:
Rong-En Fan 2008-03-30 12:06:56 +00:00
parent c39e16136d
commit a2995518f6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=210167
2 changed files with 15 additions and 6 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= bindgraph
PORTVERSION= 0.2
PORTREVISION= 1
CATEGORIES= dns
MASTER_SITES= http://www.linux.it/~md/software/
EXTRACT_SUFX= .tgz
@ -49,13 +50,13 @@ post-patch:
do-install:
${MKDIR} ${CGIDIR}
${MKDIR} ${DATADIR}
@${CHOWN} -R ${BINDGRAPH_USER}:${BINDGRAPH_GROUP} ${DATADIR}
@${INSTALL_SCRIPT} ${WRKSRC}/bindgraph.pl ${PREFIX}/sbin
@${INSTALL_SCRIPT} ${WRKSRC}/bindgraph.cgi ${CGIDIR}
@${CHOWN} -R ${BINDGRAPH_USER}:${BINDGRAPH_GROUP} ${DATADIR}/
@${INSTALL_SCRIPT} ${WRKSRC}/bindgraph.pl ${PREFIX}/sbin/
@${INSTALL_SCRIPT} ${WRKSRC}/bindgraph.cgi ${CGIDIR}/
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
for f in ${DOCS}; do \
${INSTALL_DATA} ${WRKSRC}/$$f ${DOCSDIR}; \
${INSTALL_DATA} ${WRKSRC}/$$f ${DOCSDIR}/; \
done
.endif

View file

@ -1,5 +1,5 @@
--- bindgraph.cgi.orig 2003-05-05 06:26:18.000000000 +0800
+++ bindgraph.cgi 2007-11-30 22:08:18.000000000 +0800
+++ bindgraph.cgi 2008-03-30 18:04:38.000000000 +0800
@@ -8,13 +8,14 @@
use RRDs;
@ -13,7 +13,7 @@
+my $hostname = (POSIX::uname())[1];
# path of the RRD database
-my $rrd = '/var/www/as112/rrd/bindgraph.rrd';
+my $rrd = '/var/db/bindgraph/bindgraph.rrd';
+my $rrd = '%%DATADIR%%/bindgraph.rrd';
# temporary directory where the images will be saved
my $tmp_dir = '/tmp/bindgraph';
@ -38,3 +38,11 @@
);
my $err = RRDs::error;
die_fatal("RRDs::graph($file, ...): $err") if $err;
@@ -209,6 +213,7 @@
$uri =~ s#/#,#g;
$uri =~ s#~#tilde,#g;
+ mkdir("$tmp_dir", 0755);
die_fatal("ERROR: $tmp_dir does not exist") if not -d $tmp_dir;
if (not -d "$tmp_dir/$uri") {