The Perforce directory browser. Version 1.0 alpha This file outlines the procedure for installing the Perforce directory browser onto a machine. Copyright 1999 Greg Spencer (greg_spencer@acm.org) It is available under the "Artistic License", like perl. See ARTISTIC.txt for more info. To install the perforce browser, your web browser must support server-side perl script execution. Almost all of them do, but the servers I have used this with are: - Apache server V1.3.3 for IRIX - Netscape FastTrack 2.01 for IRIX If you use it successfully with another server configuration, please let me know, and I'll add it to the list of "tested" configurations. Please test it before telling me that it works, of course. To Install: 1) Set up your server to support cgi-bin scripts from a certain directory. I call that directory "cgi-bin", but you can call it whatever you like. 2) Copy the contents of the cgi-bin subdirectory in this distribution to the cgi-bin directory: p4dir - This is the "main" script for listing dirs p4Config.pm - This sets up the local configuration p4Util.pm - This contains some useful utility functions p4file2html - This serves the syntax highlighted version p4cat - This will simply blast a file out of the database p4browse - This is a modified version of what's on the perforce web site) ` SourceToHtml.pm - This is an independent module that converts the source to HTML. You can use this for just about anything. .media.types - This simply contains the media type mappings for determining file type. Copy the contents of the scripts subdirectory in this distribution to a directory on your server. I use "/scripts" for this: p4gen.js - This contains the javascript code for generating and sorting the directory listings p4mode.js - This contains the javascript code for switching between browse mode and source mode p4record.js - This contains the javascript "record" which is a data container for the directory listing. Copy the contents of the images subdirectory in this distribution to a directory on your server. I use "/images" for this: p4magnify.gif - The image of a little magnifier for the directory listing p4folder.gif - The image of a little folder for the directory listing 3) Make the following hard links in the cgi-bin directory: ln p4dir p4dirbrowse ln p4file2html p4file2htmldata If you are on Windows, you can copy the files (or use the Cygnus tools to do hard links on NTFS). It is important to use the "browse" and "data" suffices, since they are what the script keys off of to know what mode those scripts are in. If you want to change that, you'll have to modify some things. 4) Make sure that the CGI, LWP, and HTTP perl packages are installed. These are all available from the CPAN, which is located at: http://www.metronet.com/perlinfo/CPAN.html ftp://ftp.sedl.org/pub/mirrors/CPAN/modules/by-module/CGI/CGI.pm-2.46.tar.gz ftp://ftp.sedl.org/pub/mirrors/CPAN//modules/by-module/HTTP/libwww-perl-5.41.tar.gz The libwww library will complain about prequisites that it needs. You may wish to install them so you have a completely funtional libwww, but p4dir doesn't need them to operate. You can get it from any CPAN host, not just ftp.sedl.org (that's just the closest one to me). This is probably the most painful part of the install, but I figured that rolling my own was stupid, especially when there are so many good perl hackers out there working on this stuff. 5) Edit the file p4Config.pm to reflect the situation at your site. (read the comments in this file for guidance) 6) You may need to modify the location for perl in the header line of each perl executable (p4dir, p4browse, p4file2html) to reflect your local setup (mine is in /bin/perl5). The file "file2html" is a command-line perl script that converts a source file to HTML. It doesn't use perforce, and it isn't really for use on a web server. Just a freebie. That's it! Enjoy! -Greg Spencer ( greg_spencer@acm.org )