summaryrefslogtreecommitdiff
path: root/www/webglimpse/files/patch-ab
blob: 5ae6765b52faa29ff799b4f059cbaadde1579cf9 (plain) (blame)
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
--- wginstall.pl.orig	Fri Sep 25 19:34:42 1998
+++ wginstall.pl	Mon Nov  2 10:49:39 1998
@@ -31,7 +31,7 @@
 
 
 # Get operating system
-$LEGALOS = 'linux osf sunos solaris';
+#$LEGALOS = 'linux osf sunos solaris freebsd';
 $DEFAULTOS = 'linux';
 $PLATFORM = $ARGV[1] || $^O || '';
 
@@ -46,16 +46,16 @@
 }
 
 
-do {
-    $PLATFORM = prompt("What OS are you running (must be one of $LEGALOS)?", $PLATFORM);
-} while ($LEGALOS !~ /$PLATFORM/);
+#do {
+#    $PLATFORM = prompt("What OS are you running (must be one of $LEGALOS)?", $PLATFORM);
+#} while ($LEGALOS !~ /$PLATFORM/);
 
 ###########################################################
 # Make sure we can find needed system binaries
 # Since not all systems have which, we make a guess if which fails
 #
 # get the paths for perl and glimpse
-$PERL = $ARGV[0] || `which perl` || '/usr/local/bin/perl';
+$PERL = '%PERL%';
 $CONVERT_LOC = `which wgconvert` || '/usr/local/bin/wgconvert';
 $GLIMPSE_LOC = `which glimpse` || '/usr/local/bin/glimpse';
 $GLIMPSEIDX_LOC = `which glimpseindex` || '/usr/local/bin/glimpseindex';
@@ -168,9 +168,10 @@
 }
 chomp $guess;
 if (($guess eq '')||($guess eq '.')) {
-	$guess = '/usr/local/webglimpse';
+	$guess = '/usr/local/www/webglimpse';
 }
-$WEBGLIMPSE_HOME = prompt('Webglimpse Home Directory: ', $guess);
+#$WEBGLIMPSE_HOME = prompt('Webglimpse Home Directory: ', $guess);
+$WEBGLIMPSE_HOME = $guess;
 
 # Remove any trailing '/'
 if ($WEBGLIMPSE_HOME =~ /\/$/) { 
@@ -211,12 +212,12 @@
 # Check if .wgsiteconf already exists
 $HAVECONFIG = 'N';
 if ( -e "$WEBGLIMPSE_HOME/.wgsiteconf" ) {
-	$HAVECONFIG = prompt('Existing installation found.  Keep configuration info? (Y/n)', 'Y');
-	if ($HAVECONFIG =~ /^[yY]/) {
+#       $HAVECONFIG = prompt('Existing installation found.  Keep configuration info? (Y/n)', 'Y');
+#       if ($HAVECONFIG =~ /^[yY]/) {
 		$HAVECONFIG = 'Y';
-	} else {
-		$HAVECONFIG = 'N';
-	}
+#       } else {
+#               $HAVECONFIG = 'N';
+#       }
 }
 
 #######################################################################
@@ -225,53 +226,53 @@
 #
 if ($HAVECONFIG eq 'N') {
 
-	print "\nI will now ask you some questions about your HTTP server.\n";
-	print "Automatic configuration is supported for Apache servers v1.2 and above\n";
-	print "If you do not have an Apache server, you may need to edit the file\n";
-	print "$WEBGLIMPSE_HOME/.wgsiteconf by hand after the installation is completed.\n\n";
-
+#        print "\nI will now ask you some questions about your HTTP server.\n";
+#        print "Automatic configuration is supported for Apache servers v1.2 and above\n";
+#        print "If you do not have an Apache server, you may need to edit the file\n";
+#        print "$WEBGLIMPSE_HOME/.wgsiteconf by hand after the installation is completed.\n\n";
+#
 	#		
 	# Try to guess the configuration directory/file from the process list
 	#
-	$allprocs = `ps -a` || '';
-	$confdir = '';
-	$conffile = '';
-	if ($allprocs ne '') {
-		@allprocs = split(/\n/,$allprocs);
-		foreach $proc ( @allprocs ) {
-			if ($proc =~ /httpd/) {
-				if ($proc =~ / -f (\S+)/) {
-					$conffile = $1;
-				}
-				if ($proc =~ / -d (\S+)/) {
-					$confdir = $1;
-				}
-				last;
-			}
-		}
-	}
-	$HTTPD_CONF = '';
-	if ($conffile ne '') {
-		# Usually the daemon is run as httpd -f /path/httpd.conf
-		$HTTPD_CONF = $conffile;
-	}
-
- 	if ($confdir ne '') {
-		if ($confdir =~ /\/$/) {
-			chop $confdir;
-		}
-		if ($HTTPD_CONF eq '') {
-			$HTTPD_CONF = 'httpd.conf';
-		}
-		$HTTPD_CONF = $confdir.'/'.$HTTPD_CONF;
-	} 
-
-	if ($HTTPD_CONF eq '') {
-		$HTTPD_CONF = '/usr/local/etc/httpd/conf/httpd.conf';
-	}
+#        $allprocs = `ps -a` || '';
+#        $confdir = '';
+#        $conffile = '';
+#        if ($allprocs ne '') {
+#                @allprocs = split(/\n/,$allprocs);
+#                foreach $proc ( @allprocs ) {
+#                        if ($proc =~ /httpd/) {
+#                                if ($proc =~ / -f (\S+)/) {
+#                                        $conffile = $1;
+#                                }
+#                                if ($proc =~ / -d (\S+)/) {
+#                                        $confdir = $1;
+#                                }
+#                                last;
+#                        }
+#                }
+#        }
+#        $HTTPD_CONF = '';
+#        if ($conffile ne '') {
+#                # Usually the daemon is run as httpd -f /path/httpd.conf
+#                $HTTPD_CONF = $conffile;
+#        }
+#
+#        if ($confdir ne '') {
+#                if ($confdir =~ /\/$/) {
+#                        chop $confdir;
+#                }
+#                if ($HTTPD_CONF eq '') {
+#                        $HTTPD_CONF = 'httpd.conf';
+#                }
+#                $HTTPD_CONF = $confdir.'/'.$HTTPD_CONF;
+#        }
+#
+#        if ($HTTPD_CONF eq '') {
+		$HTTPD_CONF = '/usr/local/etc/apache/httpd.conf';
+#        }
 
 	# Check with the user if our guess is right.
-	$HTTPD_CONF = &prompt('Full path to HTTP server config file: ',$HTTPD_CONF);
+#        $HTTPD_CONF = &prompt('Full path to HTTP server config file: ',$HTTPD_CONF);
 
 	########################################################################
 	# Call wgSiteConfig from wgserver.pl to parse server config file
@@ -351,13 +352,13 @@
 
 
 # Prompt user no matter what; we may be overwriting a file here.
-$CGIBIN_PWD = 
-	&prompt("Which directory should I copy the WebGlimpse cgi-bin scripts to?\nIf you choose a different\ndirectory than the default, make sure it exists.\n",
-	"$CGIBIN_PWD");
-
-$CGIBIN = 
-	&prompt("What is the script alias for $CGIBIN_PWD?",
-		$CGIBIN);
+#$CGIBIN_PWD =
+#        &prompt("Which directory should I copy the WebGlimpse cgi-bin scripts to?\nIf you choose a different\ndirectory than the default, make sure it exists.\n",
+#        "$CGIBIN_PWD");
+
+#$CGIBIN =
+#        &prompt("What is the script alias for $CGIBIN_PWD?",
+#                $CGIBIN);
 
 # If this is news to us, add/change the WGSCRIPTALIAS line to the site config file
 $wg_added = 0;
@@ -435,8 +436,8 @@
 print "cgi-bin *relative* URL: $CGIBIN\n";
 print "-----------------------------------------------------\n";
 
-print "To continue with these settings, press RETURN.  Otherwise, press ^C to abort.\n";
-$_=<STDIN>;
+#print "To continue with these settings, press RETURN.  Otherwise, press ^C to abort.\n";
+#$_=<STDIN>;
 
 
 # build local copy of httpget and html2txt
@@ -491,6 +492,7 @@
 					"OutputTool.pm", # New with v1.6b3
 					"config.pl",
 					"httpget.c",
+					"html2txt.c",
 					"url_get");
 
 @optlibfiles = (			"CustomOutputTool.pm", # New with v1.6b4 - only distributed w/commercial version
@@ -606,11 +608,11 @@
 
 print "Webglimpse installation complete.\n\n";
 
-print "**NOTE: You may need to edit your web server configuration file \n";
-print "and specify $CGIBIN_PWD as a cgi-bin directory.\n";
-print "For Apache, use the ScriptAlias directive.\n\n";
-print("Press RETURN to continue\n");
-<STDIN>;
+#print "**NOTE: You may need to edit your web server configuration file \n";
+#print "and specify $CGIBIN_PWD as a cgi-bin directory.\n";
+#print "For Apache, use the ScriptAlias directive.\n\n";
+#print("Press RETURN to continue\n");
+#<STDIN>;
 
 
 print "\nSee http://glimpse.cs.arizona.edu/webglimpse for more\n";
@@ -619,25 +621,25 @@
 print "You may configure an archive at any time with the command \n";
 print "$WEBGLIMPSE_HOME/confarc\n\n";
 
-print "To configure one or more archives now, just enter the directory to index or URL to traverse.\n";
-print "A directory should be a full path starting with   /  \n";
-print "A URL should be absolute starting with    http://  \n\n";
+#print "To configure one or more archives now, just enter the directory to index or URL to traverse.\n";
+#print "A directory should be a full path starting with   /  \n";
+#print "A URL should be absolute starting with    http://  \n\n";
 
-$archivepath = &prompt("Enter directory or URL to index, return to quit:", '');
-while($archivepath ne '') {
+#$archivepath = &prompt("Enter directory or URL to index, return to quit:", '');
+#while($archivepath ne '') {
 
 	# We want to make certain simplified assumptions here.
 	# User can get full flexibility by running confarc from
 	# command line later.
-	$type = 'D';
-	if ($archivepath =~ /^http/) {
-		$type = 'T';
-	}
+#        $type = 'D';
+#        if ($archivepath =~ /^http/) {
+#                $type = 'T';
+#        }
 
-	system("$WEBGLIMPSE_HOME/confarc -i $archivepath -t $type -l $archivepath");
+#        system("$WEBGLIMPSE_HOME/confarc -i $archivepath -t $type -l $archivepath");
 
-	$archivepath = &prompt("Enter directory or URL to index, return to quit:", '');
-}
+#        $archivepath = &prompt("Enter directory or URL to index, return to quit:", '');
+#}
 
 1;
 
@@ -703,8 +705,8 @@
 			print TEMP "\$CGIBIN = \"$CGIBIN\";\n";
 		}elsif(/^\$gunzip *=/){
 			print TEMP "\$gunzip = \"$gunzip\";\n";
-		}elsif(/^#!\/usr\/local\/bin\/perl$/){
-			print TEMP "#!$PERL\n";
+		}elsif(/^#!\/usr\/local\/bin[^ ]*\/perl(.*)/){
+			print TEMP "#!$PERL$1\n";
 		}else{
 			print TEMP $_;
 		}