PerLDAP installation instructions
==================================

Building this package is fairly straight forward, but requires some
knowledge about using compilers and compiler tools on your system. If you
are uncomfortable using these tools, we recommend you get one of the
prebuilt binary distributions instead.


Prerequisites
=============

In order to build the module, you'll need

	- Perl, version 5.005 or later, although it's only been
	tested and developed using 5.008.

	- An ANSI-C compiler, e.g. gcc-2.x, or Visual C++ 5.0.

	- The LDAP client libraries and include files, either from the
	mozilla.org source, or precompiled packages from sun.com
	(http://wwws.sun.com/software/download/app_dev.html#sdks)
	See the README file for information on retrieving binaries.

You can download (or CVS checkout) the Directory SDK source, see further
information available on

	http://www.mozilla.org/directory/

RedHat also provide C-SDK builds, available at

	ftp://ftp.redhat.com/pub/redhat/ldapsdk/

For NSPR and NSS (SSL) support, you might also need to download those
SDKs, for instance

      ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.6.1/
      ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_11_RTM/


There's also a semi-obsoloete FAQ at

	http://www.mozilla.org/directory/faq/perldap-faq.html



Building
========

This package uses the normal Perl5 MakeMaker installation system. To
generate a Makefile appropriate for your platform, run perl on the
provided Makefile.PL script, e.g.

	% perl Makefile.PL


You might have to use the command `perl5' or `perl-5.004', depending on
how you installed Perl-5. The script will now ask you a few questions to
find the necessary library and include files. A typical configuration
session is

    computer (13:19) 1096/1 $ perl Makefile.PL
 
    PerLDAP - Perl 5 Module for LDAP
    ================================
    Directory containing 'include' and 'lib' directory of the Netscape
    LDAP Software Developer Kit (default: /usr): /usr/local/ldapsdk5
    Using LDAPv3 Developer Kit (default: yes)?
    Include SSL Support (default: yes)?
    Libraries to link with (default: -lldap50 -lssldap50 -lssl3):
    Writing Makefile for Mozilla::LDAP::API

The important question is where your LDAP SDK is installed, in the example
above the base directory is /usr/local/ldapsdk5. This directory should have two
subdirectories, named "lib" and "include". If you installed the SDK in the
standard /usr hierarchy, use the default value as provided by the install
script.

Assuming you get no errors or warning, proceed with the build and install:

	$ make
	$ make install


That should be it!


Automated Configuration and Installs
====================================

The Makefile.PL script also honors a set of environment variables to make
it possible to do configuration and installs non-interactively. The
variables are

        LDAPSDKDIR    - Full path to the C SDK base directory
        LDAPSDKSSL    - Set to "N" to disable SSL (SSL is default)
	LDAPPR        - Enable prldap_ functionality (off by default)


With these variables set, you will not be asked any of the questions above
(but it will echo the paramaters). Just run the Makefile.PL script, and
finish the build, e.g.

        $ perl5 Makefile.PL
	$ make
	$ make install

RPM
===

The script Makefile.PL.rpm is used instead of Makefile.PL for building the RPM.
See the spec file perl-Mozilla-LDAP.spec for more details.
