>>> PREREQUISITES

* Perl 5.005_03 or better
* Apache 1.3.*
* mod_perl 1.25 or better
* HTML::Mason 1.03 or better
* ImageMagick and Image::Magick module
* Image::Size module
* Image::Info module
* The "jhead" utility for EXIF thumbnail support
* PostgreSQL for search support (MySQL in the next release)
* Ruby for search support

>>> INSTALLATION

Simply move this whole directory to whereever you want the gallery to run 
(under the webtree), rename the dir to whatever you want (e.g. "pics" or
"gallery"), and edit gallery/m/config to set any variables you'd like to 
change.  All currently available variables are set to defaults and commented
in that location.  The only other REQUIRED step is to edit the .htaccess
file contained in this directory to have any permissions you might wish to
add and to configure the DirectoryIndex to the full web path of the 
index.html

Example:

# cd /usr/local/apache/htdocs
# tar zxvpf /tmp/mason-gallery-1.1.tar.gz
# mv mason-gallery-1.1 pics
# cd pics
# vi .htaccess
...change:
SET THIS: DirectoryIndex /path/to/your/index.html
to: 
DirectoryIndex /pics/index.html
# cd pics/gallery/m
# vi config
...set various things

You will also need the following module use lines in your handler.pl for
Mason:

   use DBI;	## if you want to use search
   use Image::Size qw(imgsize html_imgsize);
   use Image::Info qw(image_info);
   use Image::Magick;
   use File::Basename;
   use POSIX 'strftime';

I think that's it.  If it turns out there are more, please let me know.

If you don't have/don't wish to use the EXIF thumbnail extraction feature,
make sure you set the jhead_path parameter in the config to undef.

>>> SEARCH SETUP

If you wish to set up search, create the database/table structure by 
editing gallery-search.sql to substitute __USERNAME__ for your db username,
and __DBNAME__ with whatever you want the database called, then run that
SQL to create the structure.  NOTE: This currently only works with pgsql,
but the db code in the search isn't really db-specific, I just happened to
use pg instead of mysql this time; anyone who would like to port the table
making sql for me, be my guest.

Next, edit the config to contain a proper DSN connection thingy for the 
database (there's an example, it's not that hard).

Finally, edit the script gallery/m/update_keywords to contain your preferred
synonyms and to point at the same db DSN, and give update_keywords a run.

The keywords are gleaned from the directory paths above a file, the 
dash-separated components of the filename, and any keywords in the file
.keywords underneath a given directory, in the same format as .comments (see
README for details).  Rerun update_keywords occasionally to update the 
search db.  It's not terribly efficient, but seems fast enough.  I wrote this
script in Ruby because I felt like it.  Anyone wishing to port it to Perl,
be my guest.

>> AFTERWORD

That's it.  In theory, you should even be able to install this at the top
of the document root (presumably on a virtualhost), but

1) You'd have to set up mason for that virtualhost too.
2) I've never tried this.

Additional note: If you are using mod_speling and it's turned on, make sure
you uncomment "CheckSpelling off" in the top level .htaccess.

Finally, you can remove INSTALL, README, ChangeLog, gallery-search.sql, and 
UPGRADE

Good luck,

--David Bushong
