summaryrefslogtreecommitdiff
path: root/www/awstats/patches/patch-ab
blob: 2c83bf2758b286d8cb2858f3c85d90ed782b4df0 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
$NetBSD: patch-ab,v 1.5 2008/04/07 07:21:00 adam Exp $

--- tools/awstats_configure.pl.orig	2007-04-02 20:30:52.000000000 +0200
+++ tools/awstats_configure.pl
@@ -29,12 +29,12 @@ $AWSTATS_MODEL_CONFIG
 $AWSTATS_DIRDATA_PATH
 /;
 $AWSTATS_PATH='';
-$AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon';
-$AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css';
-$AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes';
-$AWSTATS_CGI_PATH='/usr/local/awstats/wwwroot/cgi-bin';
-$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf';		# Used only when configure ran on linux
-$AWSTATS_DIRDATA_PATH='/var/lib/awstats';						# Used only when configure ran on linux
+$AWSTATS_ICON_PATH='@PREFIX@/awstats/icon';
+$AWSTATS_CSS_PATH='@PREFIX@/awstats/css';
+$AWSTATS_CLASSES_PATH='@PREFIX@/awstats/classes';
+$AWSTATS_CGI_PATH='@PREFIX@/awstats/cgi-bin';
+$AWSTATS_MODEL_CONFIG='@PKG_SYSCONFDIR@/awstats.model.conf';		# Used only when configure ran on linux
+$AWSTATS_DIRDATA_PATH='@VARBASE@/awstats';						# Used only when configure ran on linux
 
 
 
@@ -64,6 +64,7 @@ use vars qw/
 '/etc/httpd/httpd.conf',
 '/usr/local/apache/conf/httpd.conf',
 '/usr/local/apache2/conf/httpd.conf',
+'@PREFIX@/etc/httpd/httpd.conf',
 );
 
 use vars qw/
@@ -309,13 +310,13 @@ if ($OS eq 'linux') {
 	$AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//;
 	$AWSTATS_PATH=~s/tools[\\\/]?$//;
 	$AWSTATS_PATH=~s/[\\\/]$//;
-	if ($AWSTATS_PATH ne '/usr/local/awstats') {
-		print "Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.\n";
+	if ($AWSTATS_PATH ne '@PREFIX@/awstats') {
+		print "Warning: AWStats standard directory on Linux OS is '@PREFIX@/awstats'.\n";
 		print "If you want to use standard directory, you should first move all content\n";
 		print "of AWStats distribution from current directory:\n";
 		print "$AWSTATS_PATH\n";
 		print "to standard directory:\n";
-		print "/usr/local/awstats\n";
+		print "@PREFIX@/awstats\n";
 		print "And then, run configure.pl from this location.\n";
 		print "Do you want to continue setup from this NON standard directory [yN] ? ";
 		my $bidon='';
@@ -324,23 +325,23 @@ if ($OS eq 'linux') {
 			print "configure.pl aborted.\n";
 			exit 1;
 		}
-		$AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon";
-		$AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css";
-		$AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes";
-		$AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin";
+		$AWSTATS_ICON_PATH="$AWSTATS_PATH/icon";
+		$AWSTATS_CSS_PATH="$AWSTATS_PATH/css";
+		$AWSTATS_CLASSES_PATH="$AWSTATS_PATH/classes";
+		$AWSTATS_CGI_PATH="$AWSTATS_PATH/cgi-bin";
 	}
 }
 elsif ($OS eq 'macosx') {
 	$AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//;
 	$AWSTATS_PATH=~s/tools[\\\/]?$//;
 	$AWSTATS_PATH=~s/[\\\/]$//;
-	if ($AWSTATS_PATH ne '/Library/WebServer/awstats') {
-		print "Warning: AWStats standard directory on Mac OS X is '/Library/WebServer/awstats'.\n";
+	if ($AWSTATS_PATH ne '@PREFIX@/awstats') {
+		print "Warning: AWStats standard directory on Mac OS X is '@PREFIX@/awstats'.\n";
 		print "If you want to use standard directory, you should first move all content\n";
 		print "of AWStats distribution from current directory:\n";
 		print "$AWSTATS_PATH\n";
 		print "to standard directory:\n";
-		print "/Library/WebServer/awstats\n";
+		print "@PREFIX@/awstats\n";
 		print "And then, run configure.pl from this location.\n";
 		print "Do you want to continue setup from this NON standard directory [yN] ? ";
 		my $bidon='';
@@ -349,10 +350,10 @@ elsif ($OS eq 'macosx') {
 			print "configure.pl aborted.\n";
 			exit 1;
 		}
-		$AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon";
-		$AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css";
-		$AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes";
-		$AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin";
+		$AWSTATS_ICON_PATH="$AWSTATS_PATH/icon";
+		$AWSTATS_CSS_PATH="$AWSTATS_PATH/css";
+		$AWSTATS_CLASSES_PATH="$AWSTATS_PATH/classes";
+		$AWSTATS_CGI_PATH="$AWSTATS_PATH/cgi-bin";
 	}
 }
 elsif ($OS eq 'windows') {
@@ -421,6 +422,7 @@ if (! scalar keys %ApacheConfPath) {
 		print "\n".($bidon?"Now, enter":"Enter")." full config file path of your Web server.\n";
 		print "Example: /etc/httpd/httpd.conf\n";
 		print "Example: /usr/local/apache2/conf/httpd.conf\n";
+		print "Example: @PREFIX@/etc/httpd/httpd.conf\n";
 		print "Example: c:\\Program files\\apache group\\apache\\conf\\httpd.conf\n";
 		$bidon='';
 		while ($bidon ne 'none' && ! -f "$bidon") {
@@ -545,8 +547,8 @@ EOF
 # -----------------------------
 my $modelfile='';
 if ($OS eq 'linux') 		{ 
-	if (-f "$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf") {
-		$modelfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf";
+	if (-f "@PKG_SYSCONFDIR@/awstats.model.conf") {
+		$modelfile="@PKG_SYSCONFDIR@/awstats.model.conf";
 	}
 	else {
 		$modelfile="$AWSTATS_MODEL_CONFIG";
@@ -554,7 +556,7 @@ if ($OS eq 'linux') 		{ 
 	}
 }
 elsif ($OS eq "macosx") 		{ 
-	$modelfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf";
+	$modelfile="@PKG_SYSCONFDIR@/awstats.model.conf";
 }
 elsif ($OS eq 'windows')	{ $modelfile="$AWSTATS_PATH\\wwwroot\\cgi-bin\\awstats.model.conf"; }
 else						{ $modelfile="$AWSTATS_PATH\\wwwroot\\cgi-bin\\awstats.model.conf"; }
@@ -607,11 +609,11 @@ if ($bidon =~ /^y/i) {
 	if ($OS eq 'linux') 		{
 		print "\n-----> Define config file path\n";
 		print "In which directory do you plan to store your config file(s) ?\n";
-		print "Default: /etc/awstats\n";
+		print "Default: @PKG_SYSCONFDIR@\n";
 		my $bidon='';
 		print "Directory path to store config file(s) (Enter for default):\n> ";
 		$bidon=<STDIN>; chomp $bidon;
-		if (! $bidon) { $bidon = "/etc/awstats"; }
+		if (! $bidon) { $bidon = "@PKG_SYSCONFDIR@"; }
 		my $configdir=$bidon;
 		if (! -d $configdir) {
 			# Create the directory for config files