1
Description: Upstream changes introduced in version 2.99.4.0-12
2
This patch has been created by dpkg-source during the package build.
3
Here's the last changelog entry, hopefully it gives details on why
4
those changes were made:
6
calamaris (2.99.4.0-12) unstable; urgency=low
8
* Add CACHELOGFILE to configuration and move cron script.
9
Closes: #622831, #623841, #623673, #623674, #623407, #623021, #622959
10
* Bump standards version to 3.9.1, no changes.
11
* Changed source format from 1.0 to 3.0 (quilt).
12
* Replaced oops from suggests with squid3 (also in scripts).
14
The person named in the Author field signed this changelog entry.
15
Author: Philipp Frauenfelder <pfrauenf@debian.org>
16
Bug-Debian: http://bugs.debian.org/622831
17
Bug-Debian: http://bugs.debian.org/622959
18
Bug-Debian: http://bugs.debian.org/623021
19
Bug-Debian: http://bugs.debian.org/623407
20
Bug-Debian: http://bugs.debian.org/623673
21
Bug-Debian: http://bugs.debian.org/623674
22
Bug-Debian: http://bugs.debian.org/623841
25
The information above should follow the Patch Tagging Guidelines, please
26
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
27
are templates for supplementary fields that you might want to add:
29
Origin: <vendor|upstream|other>, <url of original patch>
30
Bug: <url in upstream bugtracker>
31
Bug-Debian: http://bugs.debian.org/<bugnumber>
32
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
33
Forwarded: <no|not-needed|url proving that it has been forwarded>
34
Reviewed-By: <name and email of someone who approved the patch>
35
Last-Update: <YYYY-MM-DD>
37
--- calamaris-2.99.4.0.orig/calamaris
38
+++ calamaris-2.99.4.0/calamaris
39
@@ -122,7 +122,7 @@ require 5.002;
43
-use lib '/usr/local';
44
+#use lib '/usr/local';
46
Getopt::Long::Configure("bundling");
47
GetOptions( "all-useful-reports|a" => \$opt_a,
48
@@ -4048,13 +4048,13 @@ sub outgraph {
50
if ($max_x_data < 0) {
51
# show last $max_x_data Values
52
- $min_x = ($#{@$xaxis_ref} + $max_x_data < 0) ? 0
53
- : $#{@$xaxis_ref} + $max_x_data + 1;
54
- $max_x = $#{@$xaxis_ref};
55
+ $min_x = ($#{$xaxis_ref} + $max_x_data < 0) ? 0
56
+ : $#{$xaxis_ref} + $max_x_data + 1;
57
+ $max_x = $#{$xaxis_ref};
59
# show first $max_x_data Values
61
- $max_x = ($#{@$xaxis_ref} > $max_x_data) ? $max_x_data : $#{@$xaxis_ref};
62
+ $max_x = ($#{$xaxis_ref} > $max_x_data) ? $max_x_data : $#{$xaxis_ref};
65
my $graph = calamaris::calBars3d->new($width, int($width/3*2));
66
@@ -4080,7 +4080,7 @@ Please use one of the supported image ty
67
($factor0, $unit0) = getfactor(max(@$yaxis1_ref[$min_x..$max_x]),9);
68
$yaxis1_ref = reformatarray($factor0, $yaxis1_ref) if ($factor0 > 1);
69
my %graph_label = (x_label => '',
70
- y_label => "$unit0 ${@$legend_ref}[0]",
71
+ y_label => "$unit0 ${$legend_ref}[0]",
74
x_labels_vertical => '1',
75
@@ -4111,8 +4111,8 @@ Please use one of the supported image ty
76
push @data, [@$yaxis2_ref[$min_x..$max_x]];
77
push @data, [@$yaxis3_ref[$min_x..$max_x]] if ref($yaxis3_ref);
78
push @data, [@$yaxis4_ref[$min_x..$max_x]] if ref($yaxis4_ref);
79
- %graph_label = ( y1_label => "$unit0 ${@$legend_ref}[0]",
80
- y2_label => "$unit1 ${@$legend_ref}[1]",
81
+ %graph_label = ( y1_label => "$unit0 ${$legend_ref}[0]",
82
+ y2_label => "$unit1 ${$legend_ref}[1]",
85
set_spacing => '6', );
87
+++ calamaris-2.99.4.0/calamaris-cron-script
93
+# calamaris: daily cron script.
94
+# This script should be run before the one for squid or oops. According to the
95
+# man page of run-parts this is okay: squid and oops come after calamaris in
102
+CONFFILE=/etc/calamaris/cron.conf
103
+CALAMARIS=/usr/bin/calamaris
104
+CALAMARIS_CONF_FILE=/etc/calamaris/calamaris.conf
106
+if [ ! -x /usr/bin/calamaris ]; then
110
+CALAMARISOPTIONS="-a -f auto --config-file ${CALAMARIS_CONF_FILE}"
111
+HTMLOPTIONS="-F html"
112
+ME=/etc/cron.daily/calamaris
113
+WEEKFILES=forweekly.1:forweekly.2:forweekly.3:forweekly.4:forweekly.5:forweekly.6:forweekly.0
116
+DAYOFWEEK=`date +"%w"`
117
+DAYOFMONTH=`date +"%d" | bc -l`
118
+# WEEKOFYEAR=`date +"%W"`
119
+# MONTH=`date +"%B"`
121
+# read configuration file: /etc/calamaris/cron.conf
124
+'(!/�#/) && ($1 == "daily") {
125
+ print "DAYMAIL=" $2; print "DAYWEB=" $3;
126
+ print "DAYDO=" $4; print "DAYTITLE=" $5;
128
+DAYWEBPATH=`dirname $DAYWEB`
129
+DAYWEBFILE=`basename $DAYWEB`
133
+'(!/�#/) && ($1 == "weekly") {
134
+ print "WEEKMAIL=" $2; print "WEEKWEB=" $3;
135
+ print "WEEKDO=" $4; print "WEEKTITLE=" $5;
137
+WEEKWEBPATH=`dirname $WEEKWEB`
138
+WEEKWEBFILE=`basename $WEEKWEB`
142
+'(!/�#/) && ($1 == "monthly") {
143
+ print "MONTHMAIL=" $2; print "MONTHWEB=" $3;
144
+ print "MONTHDO=" $4; print "MONTHTITLE=" $5;
146
+MONTHWEBPATH=`dirname $MONTHWEB`
147
+MONTHWEBFILE=`basename $MONTHWEB`
152
+'(!/�#/) && ($1 == "cache") {
157
+CACHEFILE=access.log
159
+'(!/�#/) && ($1 == "cachefile") {
160
+ print "CACHEFILE=" $2;
163
+# look for cache log files
164
+if [ "$CACHE" = "auto" ]; then
165
+ if [ -r /var/log/squid/$CACHEFILE ]; then
167
+ CACHELOGDIR=/var/log/squid
169
+ if [ -r /var/log/oops/$CACHEFILE ]; then
171
+ CACHELOGDIR=/var/log/oops
173
+ if [ "$CACHE" = "auto" ]; then
174
+ echo "/etc/cron.daily/calamaris: no cache log files found, exiting cleanly"
178
+ CACHELOGDIR=/var/log/$CACHE
179
+ if [ ! -r $CACHELOGDIR/$CACHEFILE ]; then
180
+ echo "/etc/cron.daily/calamaris: no cache log files found in $CACHELOGDIR, exiting cleanly"
185
+# change to working dir
186
+LOGDIR=/var/log/calamaris
187
+cd $LOGDIR || exit 1
189
+# if we need monthly or weekly reports save a summary
190
+if [ "$WEEKDO" != "nothing" ]; then
191
+ CALAMARISOPTIONSOLD="$CALAMARISOPTIONS"
192
+ CALAMARISOPTIONS="$CALAMARISOPTIONS -o forweekly.$DAYOFWEEK"
193
+ # Ensure that this file exists and is empty; if there are no entries in the
194
+ # squid access.log, calamaris won't create the summary file, which causes
195
+ # problems with the weekly and monthly summaries.
196
+ :> forweekly.$DAYOFWEEK
198
+ if [ "$MONTHDO" != "nothing" ]; then
199
+ CALAMARISOPTIONSOLD="$CALAMARISOPTIONS"
200
+ CALAMARISOPTIONS="$CALAMARISOPTIONS -o formonthly.$DAYOFMONTH"
204
+# do the daily report
206
+ nothing) if [ "$WEEKDO" != "nothing" ]; then
207
+ cat $CACHELOGDIR/$CACHEFILE | \
208
+ nice -39 $CALAMARIS $CALAMARISOPTIONS > /dev/null
211
+ mail) if [ -x /usr/sbin/sendmail ]; then (
212
+ echo "To: $DAYMAIL"
213
+ echo "From: Calamaris <root>"
214
+ cat $CACHELOGDIR/$CACHEFILE | \
215
+ nice -39 $CALAMARIS $CALAMARISOPTIONS -F mail -H "$DAYTITLE"
216
+ ) | /usr/sbin/sendmail -t
219
+ web) cat $CACHELOGDIR/$CACHEFILE | \
220
+ nice -39 $CALAMARIS $CALAMARISOPTIONS $HTMLOPTIONS -H "$DAYTITLE" \
221
+ --output-path $DAYWEBPATH --output-file $DAYWEBFILE
223
+ both) cat $CACHELOGDIR/$CACHEFILE | \
224
+ nice -39 $CALAMARIS $CALAMARISOPTIONS $HTMLOPTIONS -H "$DAYTITLE" \
225
+ --output-path $DAYWEBPATH --output-file $DAYWEBFILE
226
+ if [ -x /usr/sbin/sendmail ]; then (
227
+ echo "To: $DAYMAIL"
228
+ echo "From: Calamaris <root>"
229
+ cat $CACHELOGDIR/$CACHEFILE | \
230
+ nice -39 $CALAMARIS $CALAMARISOPTIONS -F mail -H "$DAYTITLE"
231
+ ) | /usr/sbin/sendmail -t
234
+ *) echo "the 'todo' for the daily Squid report in $CONFFILE"
235
+ echo -n "is '$DAYDO' instead of one out of "
236
+ echo "(nothing, mail, web, both)." >&2
241
+if [ "$MONTHDO" != "nothing" -a "$WEEKDO" != "nothing" ]; then
242
+ cp forweekly.$DAYOFWEEK formonthly.$DAYOFMONTH
245
+# do the weekly report on Sunday <=> $DAYOFWEEK==0
246
+if [ -n "$CALAMARISOPTIONSOLD" ]; then
247
+ CALAMARISOPTIONS="$CALAMARISOPTIONSOLD"
250
+if [ "$DAYOFWEEK" = "0" ]; then
251
+ # make sure, all forweekly files exist, ie. touch them
252
+ touch `echo $WEEKFILES | sed "s/:/ /g"`
256
+ mail) if [ -x /usr/sbin/sendmail ]; then (
257
+ echo "To: $WEEKMAIL"
258
+ echo "From: Calamaris <root>"
259
+ nice -39 $CALAMARIS $CALAMARISOPTIONS -i $WEEKFILES \
260
+ -z -F mail -H "$WEEKTITLE"
261
+ ) | /usr/sbin/sendmail -t
264
+ web) nice -39 $CALAMARIS $CALAMARISOPTIONS -i $WEEKFILES \
265
+ -z $HTMLOPTIONS -H "$WEEKTITLE" \
266
+ --output-path $WEEKWEBPATH --output-file $WEEKWEBFILE
268
+ both) if [ "$DEBUG" = "1" ]; then
269
+ echo "Weekly stats."
270
+ echo "Doing web stats: nice -39 $CALAMARIS $CALAMARISOPTIONS -i $WEEKFILES -zwH \"$WEEKTITLE\" into $WEEKWEB"
272
+ nice -39 $CALAMARIS $CALAMARISOPTIONS -i $WEEKFILES \
273
+ -z $HTMLOPTIONS -H "$WEEKTITLE" \
274
+ --output-path $WEEKWEBPATH --output-file $WEEKWEBFILE
275
+ if [ "$DEBUG" = "1" ]; then
276
+ echo "Doing mail stats: nice -39 $CALAMARIS $CALAMARISOPTIONS -i $WEEKFILES -zmH \"$WEEKTITLE\""
278
+ if [ -x /usr/sbin/sendmail ]; then (
279
+ echo "To: $WEEKMAIL"
280
+ echo "From: Calamaris <root>"
281
+ nice -39 $CALAMARIS $CALAMARISOPTIONS -i $WEEKFILES \
282
+ -z -F mail -H "$WEEKTITLE"
283
+ ) | /usr/sbin/sendmail -t
285
+ if [ "$DEBUG" = "1" ]; then echo "Finished weekly stats."; fi
287
+ *) echo "the 'todo' for the weekly Squid report in $CONFFILE"
288
+ echo -n "is '$WEEKDO' instead of one out of "
289
+ echo "(nothing, mail, web, both)." >&2
293
+ # remove all forweekly files (could disturb next week's statistics if
294
+ # computer is switched of one day)
295
+ rm -f `echo $WEEKFILES | sed "s/:/ /g"`
298
+# do the monthly report
299
+if [ "$DAYOFMONTH" = "1" ]; then
301
+ MONTHFILES=formonthly.1
302
+ yesterday=`date +"%d" -d "yesterday"`
303
+ end=`echo 1+$yesterday | bc -l`
304
+ while [ "$i" != $end ]; do
305
+ MONTHFILES=$MONTHFILES:formonthly.$i
306
+ i=`echo 1+$i | bc -l`
308
+ # make sure, all formonthly files exist, ie. touch them
309
+ touch `echo $MONTHFILES | sed "s/:/ /g"`
313
+ mail) if [ -x /usr/sbin/sendmail ]; then (
314
+ echo "To: $MONTHMAIL"
315
+ echo "From: Calamaris <root>"
316
+ nice -39 $CALAMARIS $CALAMARISOPTIONS -i $MONTHFILES \
317
+ -z -F mail -H "$MONTHTITLE"
318
+ ) | /usr/sbin/sendmail -t
321
+ web) nice -39 $CALAMARIS $CALAMARISOPTIONS -i $MONTHFILES \
322
+ -z $HTMLOPTIONS -H "$MONTHTITLE" \
323
+ --output-path $MONTHWEBPATH --output-file $MONTHWEBFILE
325
+ both) nice -39 $CALAMARIS $CALAMARISOPTIONS -i $MONTHFILES \
326
+ -z $HTMLOPTIONS -H "$MONTHTITLE" \
327
+ --output-path $MONTHWEBPATH --output-file $MONTHWEBFILE
328
+ if [ -x /usr/sbin/sendmail ]; then (
329
+ echo "To: $MONTHMAIL"
330
+ echo "From: Calamaris <root>"
331
+ nice -39 $CALAMARIS $CALAMARISOPTIONS -i $MONTHFILES \
332
+ -z -F mail -H "$MONTHTITLE"
333
+ ) | /usr/sbin/sendmail -t
336
+ *) echo "the 'todo' for the weekly Squid report in $CONFFILE"
337
+ echo -n "is '$MONTHDO' instead of one out of "
338
+ echo "(nothing, mail, web, both)." >&2
342
+ # remove all formonthly files (could disturb next month's statistics if
343
+ # computer is switched of one day)
348
--- calamaris-2.99.4.0.orig/calamaris.1
349
+++ calamaris-2.99.4.0/calamaris.1
350
@@ -339,7 +339,7 @@ Server-Side-Includes.
351
enables graphics for html, html-embed or html-frame.
354
-gives out the raw numbers seperated by spaces. Useful for re-using the output
355
+gives out the raw numbers separated by spaces. Useful for re-using the output
356
in other scripts. If you use this along with
358
the byte values are calculated in the given Unit, and displayed without
359
@@ -484,7 +484,7 @@ generates an index for all reports that
360
.I --cache-input-file|-i file ($cache_input_file)
361
You can reuse a cache file generated with
362
.I --cache-output-file file
363
-to add old data to a new report. Several files can be seperated with a ':'.
364
+to add old data to a new report. Several files can be separated with a ':'.
367
if you use more than one cache file, make sure they are chronologicaly
369
+++ calamaris-2.99.4.0/calamaris-cron
375
+/usr/lib/calamaris/calamaris-cron-script
378
+++ calamaris-2.99.4.0/Makefile
381
+ install -g root -o root -m 755 calamaris $(DESTDIR)/usr/bin/calamaris
382
+ install -g root -o root -m 755 calamaris-cron-script $(DESTDIR)/usr/lib/calamaris/calamaris-cron-script
383
+ install -g root -o root -m 755 calamaris-cron $(DESTDIR)/etc/cron.daily/calamaris
384
+ install -g root -o root -m 644 *.pm $(DESTDIR)/usr/share/perl5/calamaris
385
+ install -g root -o root -m 644 calamaris.conf $(DESTDIR)/etc/calamaris